Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/sanger_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ jobs:
name: Run LSF tests
runs-on: ubuntu-latest
steps:
- name: Sets env vars for workflow_dispatch
run: |
echo "REVISION=${{ github.sha }}" >> $GITHUB_ENV
if: github.event_name == 'workflow_dispatch'

- name: Launch workflow via tower
uses: seqeralabs/action-tower-launch@v2
with:
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
revision: ${{ github.sha }}
workdir: ${{ secrets.TOWER_WORKDIR_PARENT }}/work/${{ github.repository }}/work-${{ github.sha }}
revision: ${{ env.REVISION }}
workdir: ${{ secrets.TOWER_WORKDIR_PARENT }}/work/${{ github.repository }}/work-${{ env.REVISION }}
parameters: |
{
"outdir": "${{ secrets.TOWER_WORKDIR_PARENT }}/results/${{ github.repository }}/results-${{ github.sha }}",
"outdir": "${{ secrets.TOWER_WORKDIR_PARENT }}/results/${{ github.repository }}/results-${{ env.REVISION }}",
"use_work_dir_as_temp": true,
}
profiles: test,sanger,singularity,cleanup

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Tower debug log file
path: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/sanger_test_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
"outdir": "${{ secrets.TOWER_WORKDIR_PARENT }}/results/${{ github.repository }}/results-${{ env.REVISION }}",
}
profiles: test_full,sanger,singularity,cleanup

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Tower debug log file
path: |
Expand Down
8 changes: 4 additions & 4 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ process {
maxErrors = '-1'

// Most of the pipeline requires very little resources
cpus = 1
cpus = 1
// but still gradually increase the resources to allow the pipeline to self-heal
memory = { 50.MB * task.attempt }
time = { 30.min * task.attempt }
memory = { 50.MB * task.attempt }
time = { 30.min * task.attempt }

// tabix needs pointers to the sequences in memory
withName: '.*:.*:FASTA_WINDOWS:TABIX_TABIX_.*' {
Expand All @@ -23,7 +23,7 @@ process {
}

// fasta_windows takes more memory on larger genomes
withName: 'FASTAWINDOWS' {
withName: FASTAWINDOWS {
// 1 CPU per 1 Gbp
cpus = { Math.ceil(fasta.size() / 1000000000) }
// 100 MB per 45 Mbp
Expand Down
9 changes: 4 additions & 5 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ process {
publishDir = [
path: { "${meta.outdir}/${meta.analysis_subdir}" },
mode: 'copy',
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: 'TABIX_BGZIP' {
withName: TABIX_BGZIP {
ext.args = "-i"
}
withName: 'TABIX_TABIX_CSI' {
withName: TABIX_TABIX_CSI {
ext.args = "--preset bed --csi"
}
withName: 'TABIX_TABIX_TBI' {
withName: TABIX_TABIX_TBI {
ext.args = "--preset bed"
}

}
4 changes: 2 additions & 2 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process {
resourceLimits = [
cpus: 4,
memory: '15.GB',
time: '1.h'
time: '1.h',
]
}

Expand All @@ -23,5 +23,5 @@ params {
config_profile_description = 'Minimal test dataset to check pipeline function'

// Input data
fasta = 'https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/927/399/515/GCA_927399515.1_gfLaeSulp1.1/GCA_927399515.1_gfLaeSulp1.1_genomic.fna.gz'
fasta = 'https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/927/399/515/GCA_927399515.1_gfLaeSulp1.1/GCA_927399515.1_gfLaeSulp1.1_genomic.fna.gz'
}
2 changes: 1 addition & 1 deletion conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ params {
config_profile_description = 'Full test dataset to check pipeline function'

// Input data for full size test
input = "${projectDir}/assets/samplesheet.csv"
input = "${projectDir}/assets/samplesheet.csv"
}
14 changes: 6 additions & 8 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_sequ
// WORKFLOW: Run main analysis pipeline depending on type of input
//
workflow SANGERTOL_SEQUENCECOMPOSITION {

take:
samplesheet // channel: samplesheet read in from --input

Expand All @@ -35,7 +34,7 @@ workflow SANGERTOL_SEQUENCECOMPOSITION {
//
// WORKFLOW: Run pipeline
//
SEQUENCECOMPOSITION (
SEQUENCECOMPOSITION(
samplesheet
)
}
Expand All @@ -46,12 +45,10 @@ workflow SANGERTOL_SEQUENCECOMPOSITION {
*/

workflow {

main:
//
// SUBWORKFLOW: Run initialisation tasks
//
PIPELINE_INITIALISATION (
PIPELINE_INITIALISATION(
params.version,
params.validate_params,
params.monochrome_logs,
Expand All @@ -60,19 +57,20 @@ workflow {
params.input,
params.help,
params.help_full,
params.show_hidden
params.show_hidden,
params.fasta,
)

//
// WORKFLOW: Run main workflow
//
SANGERTOL_SEQUENCECOMPOSITION (
SANGERTOL_SEQUENCECOMPOSITION(
PIPELINE_INITIALISATION.out.samplesheet
)
//
// SUBWORKFLOW: Run completion tasks
//
PIPELINE_COMPLETION (
PIPELINE_COMPLETION(
params.email,
params.email_on_fail,
params.plaintext_email,
Expand Down
14 changes: 7 additions & 7 deletions modules/local/extract_column.nf
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
process EXTRACT_COLUMN {
tag "$meta.id"
tag "${meta.id}"
label 'process_single'

conda "conda-forge::python=3.9.1"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/python:3.9--1' :
'biocontainers/python:3.9--1' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/python:3.9--1'
: 'biocontainers/python:3.9--1'}"

input:
tuple val(meta), path(tsv)
val(column_number)
val column_number

output:
tuple val(meta), path("*.bedGraph"), emit: bedgraph
path "versions.yml" , emit: versions
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
cut -f1-3,$column_number $tsv | tail -n +2 > ${prefix}.bedGraph
cut -f1-3,${column_number} ${tsv} | tail -n +2 > ${prefix}.bedGraph

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
Loading