Skip to content

Commit

Permalink
Add library parameter to samplesheet (#88)
Browse files Browse the repository at this point in the history
* adding library parameter to the samplesheet for normal mode and parallel mode

* update test_10 samples input samplesheet

* substitute params.library_name by meta.library

* add default outdir [ci skip]

* relabel tbfull [ci skip]

* remove custom process_max label [ci skip]

* add retry label [ci skip]

* remove the requirement of library field from tbfull [ci skip]

* use custom process label for tbfull [ci skip]

* update the pipeline schema

* disable the publication of renamed files [ci skip]

---------

Co-authored-by: Abhinav Sharma <[email protected]>
Co-authored-by: Abhinav Sharma <[email protected]>
  • Loading branch information
3 people authored Aug 30, 2024
1 parent 9b8ef94 commit 8b3cffc
Show file tree
Hide file tree
Showing 20 changed files with 189 additions and 104 deletions.
6 changes: 3 additions & 3 deletions assets/samplesheet.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sample,fastq_1,fastq_2
SAMPLE_PAIRED_END,/path/to/fastq/files/AEG588A1_S1_L002_R1_001.fastq.gz,/path/to/fastq/files/AEG588A1_S1_L002_R2_001.fastq.gz
SAMPLE_SINGLE_END,/path/to/fastq/files/AEG588A4_S4_L003_R1_001.fastq.gz,
sample,library,fastq_1,fastq_2
SAMPLE_PAIRED_END,illumina,/path/to/fastq/files/AEG588A1_S1_L002_R1_001.fastq.gz,/path/to/fastq/files/AEG588A1_S1_L002_R2_001.fastq.gz
SAMPLE_SINGLE_END,illumina,/path/to/fastq/files/AEG588A4_S4_L003_R1_001.fastq.gz,
6 changes: 6 additions & 0 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"errorMessage": "Sample name must be provided and cannot contain spaces",
"meta": ["id"]
},
"library": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "Library preparation protocol name must be provided and cannot contain spaces",
"meta": ["library"]
},
"fastq_1": {
"type": "string",
"format": "file-path",
Expand Down
9 changes: 3 additions & 6 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,13 @@ process {
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
time = { check_max( 16.h * task.attempt, 'time' ) }
}
withLabel:process_max {
cpus = params.max_cpus
memory = params.max_memory
time = params.max_time
}
withLabel:process_long {
time = { check_max( 20.h * task.attempt, 'time' ) }
}
withLabel:process_high_memory {
withLabel:process_tbfull {
cpus = 8
memory = { check_max( 200.GB * task.attempt, 'memory' ) }
time = { check_max( 336.h * task.attempt, 'time' ) }
}
withLabel:error_ignore {
errorStrategy = 'ignore'
Expand Down
11 changes: 11 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ process {
]
}


withName: RENAME_FILES {
publishDir = [
path: { "${params.outdir}/rename_files" },
mode: params.publish_dir_mode,
enabled: false
]
}



withName: 'MULTIQC' {
ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' }
publishDir = [
Expand Down
2 changes: 2 additions & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ params {
// TODO nf-core: Give any required params for the test so that command line flags are not needed
input = "${projectDir}/data/test_data/test_3_samples.csv"

output = "test-profile-results"


}
7 changes: 3 additions & 4 deletions conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ params {
// Input data for full size test
// TODO nf-core: Specify the paths to your full test data ( on nf-core/test-datasets or directly in repositories, e.g. SRA)
// TODO nf-core: Give any required params for the test so that command line flags are not needed
input = "${launchDir}/data/test_data/test_10_samples.csv"
input = "${projectDir}/data/test_data/test_10_samples.csv"

output = "test-full-profile-results"

// Fasta references
fasta = 'https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/genome/NC_045512.2/GCF_009858895.2_ASM985889v3_genomic.200409.fna.gz'

input = "${launchDir}/data/10samples.csv"
}
11 changes: 11 additions & 0 deletions data/test_data/publication.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sample,library,fastq_1,fastq_2
6639-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_2.fastq.gz
6640-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_2.fastq.gz
6769-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_2.fastq.gz
7520-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553024/ERR553024_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553024/ERR553024_2.fastq.gz
7538-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552282/ERR552282_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552282/ERR552282_2.fastq.gz
7538-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552281/ERR552281_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552281/ERR552281_2.fastq.gz
8082-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553347/ERR553347_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553347/ERR553347_2.fastq.gz
8864-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553000/ERR553000_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553000/ERR553000_2.fastq.gz
8867-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR551/ERR551118/ERR551118_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR551/ERR551118/ERR551118_2.fastq.gz
8868-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552427/ERR552427_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552427/ERR552427_2.fastq.gz
23 changes: 11 additions & 12 deletions data/test_data/test_10_samples.csv
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
sample,fastq_1,fastq_2
6639-04,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_2.fastq.gz
6640-04,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_2.fastq.gz
6769-04,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_2.fastq.gz
7520-04,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553024/ERR553024_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553024/ERR553024_2.fastq.gz
7538-03,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552282/ERR552282_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552282/ERR552282_2.fastq.gz
7538-03,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552281/ERR552281_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552281/ERR552281_2.fastq.gz
8082-03,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553347/ERR553347_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553347/ERR553347_2.fastq.gz
8864-03,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553000/ERR553000_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553000/ERR553000_2.fastq.gz
8867-03,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR551/ERR551118/ERR551118_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR551/ERR551118/ERR551118_2.fastq.gz
8868-03,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552427/ERR552427_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552427/ERR552427_2.fastq.gz

sample,library,fastq_1,fastq_2
6639-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_2.fastq.gz
6640-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_2.fastq.gz
6769-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_2.fastq.gz
7520-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553024/ERR553024_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553024/ERR553024_2.fastq.gz
7538-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552282/ERR552282_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552282/ERR552282_2.fastq.gz
7538-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552281/ERR552281_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552281/ERR552281_2.fastq.gz
8082-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553347/ERR553347_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553347/ERR553347_2.fastq.gz
8864-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553000/ERR553000_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR553/ERR553000/ERR553000_2.fastq.gz
8867-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR551/ERR551118/ERR551118_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR551/ERR551118/ERR551118_2.fastq.gz
8868-03,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552427/ERR552427_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552427/ERR552427_2.fastq.gz
8 changes: 4 additions & 4 deletions data/test_data/test_3_samples.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,fastq_1,fastq_2
6639-04,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_2.fastq.gz
6640-04,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_2.fastq.gz
6769-04,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_2.fastq.gz
sample,library,fastq_1,fastq_2
6639-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552979/ERR552979_2.fastq.gz
6640-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR552/ERR552647/ERR552647_2.fastq.gz
6769-04,illumina,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_1.fastq.gz,ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR550/ERR550942/ERR550942_2.fastq.gz
14 changes: 7 additions & 7 deletions modules/mtbseq/tbbwa.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ process TBBWA {
conda "bioconda::mtbseq=1.1.0"
container "${'quay.io/biocontainers/mtbseq:1.1.0--hdfd78af_0'}"
input:
tuple val(meta), path("${meta.id}_${params.library_name}_R?.fastq.gz")
tuple val(meta), path("${meta.id}_${meta.library}_R?.fastq.gz")
env(USER)
tuple path(ref_resistance_list), path(ref_interesting_regions), path(ref_gene_categories), path(ref_base_quality_recalibration)

output:
path("Bam/${meta.id}_${params.library_name}*.{bam,bai,bamlog}")
tuple val(meta), path("Bam/${meta.id}_${params.library_name}*.{bam,bai}"), emit: bam_tuple
path("Bam/${meta.id}_${params.library_name}*.bam"), emit: bam
path("Bam/${meta.id}_${meta.library}*.{bam,bai,bamlog}")
tuple val(meta), path("Bam/${meta.id}_${meta.library}*.{bam,bai}"), emit: bam_tuple
path("Bam/${meta.id}_${meta.library}*.bam"), emit: bam

script:

Expand Down Expand Up @@ -51,9 +51,9 @@ process TBBWA {
touch ${task.process}_${meta.id}_err.log
mkdir Bam
touch Bam/${meta.id}_${params.library_name}.bam
touch Bam/${meta.id}_${params.library_name}.bai
touch Bam/${meta.id}_${params.library_name}.bamlog
touch Bam/${meta.id}_${meta.library}.bam
touch Bam/${meta.id}_${meta.library}.bai
touch Bam/${meta.id}_${meta.library}.bamlog
"""

Expand Down
35 changes: 18 additions & 17 deletions modules/mtbseq/tbfull.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
process TBFULL {
tag "cohort"
label 'process_max'
label 'process_tbfull'
label 'error_retry'

publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

conda "bioconda::mtbseq=1.1.0"
Expand All @@ -17,8 +19,8 @@ process TBFULL {
path("Statistics")
path("Statistics/Mapping_and_Variant_Statistics.tab"), emit: statistics
path("Classification/Strain_Classification.tab"), emit: classification
path("Called/*_${params.library_name}*gatk_position_variants*.tab"), emit: position_variants
path("Position_Tables/*_${params.library_name}*.gatk_position_table.tab"), emit: position_tables
path("Called/*gatk_position_variants*.tab"), emit: position_variants
path("Position_Tables/*.gatk_position_table.tab"), emit: position_tables
path "versions.yml", emit: versions

script:
Expand Down Expand Up @@ -68,26 +70,25 @@ process TBFULL {
mkdir GATK_Bam
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.bam
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.bai
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.bamlog
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.grp
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.intervals
touch GATK_Bam/stub.gatk.bam
touch GATK_Bam/stub.gatk.bai
touch GATK_Bam/stub.gatk.bamlog
touch GATK_Bam/stub.gatk.grp
touch GATK_Bam/stub.gatk.intervals
mkdir Bam
mkdir Bam/${meta.id}
touch Bam/${meta.id}_${params.library_name}.bam
touch Bam/${meta.id}_${params.library_name}.bai
touch Bam/${meta.id}_${params.library_name}.bamlog
touch Bam/stub.bam
touch Bam/stub.bai
touch Bam/stub.bamlog
mkdir Called
touch Called/${meta.id}_${params.library_name}.gatk_position_uncovered_cf${params.mincovf}_cr${params.mincovr}_fr${params.minfreq}_ph${params.minphred}_outmode000.tab
touch Called/${meta.id}_${params.library_name}.gatk_position_variants_cf${params.mincovf}_cr${params.mincovr}_fr${params.minfreq}_ph${params.minphred}_outmode000.tab
touch Called/stub.gatk_position_uncovered_cf${params.mincovf}_cr${params.mincovr}_fr${params.minfreq}_ph${params.minphred}_outmode000.tab
touch Called/stub.gatk_position_variants_cf${params.mincovf}_cr${params.mincovr}_fr${params.minfreq}_ph${params.minphred}_outmode000.tab
mkdir Mpileup
touch Mpileup/${meta.id}_${params.library_name}.gatk.mpileup
touch Mpileup/${meta.id}_${params.library_name}.gatk.mpileuplog
touch Mpileup/stub.gatk.mpileup
touch Mpileup/stub.gatk.mpileuplog
mkdir Classification
touch Classification/Strain_Classification.tab
mkdir Position_Tables
touch Position_Tables/${meta.id}_${params.library_name}.gatk_position_table.tab
touch Position_Tables/stub.gatk_position_table.tab
mkdir Statistics
touch Statistics/Mapping_and_Variant_Statistics.tab
Expand Down
10 changes: 5 additions & 5 deletions modules/mtbseq/tblist.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ process TBLIST {
conda "bioconda::mtbseq=1.1.0"
container "${'quay.io/biocontainers/mtbseq:1.1.0--hdfd78af_0'}"
input:
tuple val(meta), path("Mpileup/${meta.id}_${params.library_name}*.gatk.mpileup")
tuple val(meta), path("Mpileup/${meta.id}_${meta.library}*.gatk.mpileup")
env(USER)
tuple path(ref_resistance_list), path(ref_interesting_regions), path(ref_gene_categories), path(ref_base_quality_recalibration)

output:
path("Position_Tables/${meta.id}_${params.library_name}*.gatk_position_table.tab"), emit: tbjoin_input
tuple val(meta), path("Position_Tables/${meta.id}_${params.library_name}*.gatk_position_table.tab"), emit: position_table_tuple
path("Position_Tables/${meta.id}_${params.library_name}*.gatk_position_table.tab"), emit: position_table
path("Position_Tables/${meta.id}_${meta.library}*.gatk_position_table.tab"), emit: tbjoin_input
tuple val(meta), path("Position_Tables/${meta.id}_${meta.library}*.gatk_position_table.tab"), emit: position_table_tuple
path("Position_Tables/${meta.id}_${meta.library}*.gatk_position_table.tab"), emit: position_table

script:
def args = task.ext.args ?: "--minbqual ${params.minbqual}"
Expand Down Expand Up @@ -55,7 +55,7 @@ process TBLIST {
touch ${task.process}_${meta.id}_err.log
mkdir Position_Tables
touch Position_Tables/${meta.id}_${params.library_name}.gatk_position_table.tab
touch Position_Tables/${meta.id}_${meta.library}.gatk_position_table.tab
"""

Expand Down
8 changes: 4 additions & 4 deletions modules/mtbseq/tbpile.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ process TBPILE {
tuple path(ref_resistance_list), path(ref_interesting_regions), path(ref_gene_categories), path(ref_base_quality_recalibration)

output:
path("Mpileup/${meta.id}_${params.library_name}*.gatk.{mpileup,mpileuplog}")
tuple val(meta), path("Mpileup/${meta.id}_${params.library_name}*.gatk.mpileup"), emit: mpileup
path("Mpileup/${meta.id}_${meta.library}*.gatk.{mpileup,mpileuplog}")
tuple val(meta), path("Mpileup/${meta.id}_${meta.library}*.gatk.mpileup"), emit: mpileup

script:

Expand Down Expand Up @@ -47,8 +47,8 @@ process TBPILE {
sleep \$[ ( \$RANDOM % 10 ) + 1 ]s
mkdir Mpileup
touch Mpileup/${meta.id}_${params.library_name}.gatk.mpileup
touch Mpileup/${meta.id}_${params.library_name}.gatk.mpileuplog
touch Mpileup/${meta.id}_${meta.library}.gatk.mpileup
touch Mpileup/${meta.id}_${meta.library}.gatk.mpileuplog
"""

Expand Down
12 changes: 6 additions & 6 deletions modules/mtbseq/tbrefine.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process TBREFINE {
tuple path(ref_resistance_list), path(ref_interesting_regions), path(ref_gene_categories), path(ref_base_quality_recalibration)

output:
tuple val(meta), path("GATK_Bam/${meta.id}_${params.library_name}*gatk.{bam,bai,bamlog,grp,intervals}"), emit: gatk_bam
tuple val(meta), path("GATK_Bam/${meta.id}_${meta.library}*gatk.{bam,bai,bamlog,grp,intervals}"), emit: gatk_bam

script:

Expand Down Expand Up @@ -46,10 +46,10 @@ process TBREFINE {
mkdir GATK_Bam
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.bam
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.bai
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.bamlog
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.grp
touch GATK_Bam/${meta.id}_${params.library_name}.gatk.intervals
touch GATK_Bam/${meta.id}_${meta.library}.gatk.bam
touch GATK_Bam/${meta.id}_${meta.library}.gatk.bai
touch GATK_Bam/${meta.id}_${meta.library}.gatk.bamlog
touch GATK_Bam/${meta.id}_${meta.library}.gatk.grp
touch GATK_Bam/${meta.id}_${meta.library}.gatk.intervals
"""
}
8 changes: 4 additions & 4 deletions modules/mtbseq/tbvariants.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ process TBVARIANTS {
tuple path(ref_resistance_list), path(ref_interesting_regions), path(ref_gene_categories), path(ref_base_quality_recalibration)

output:
path("Called/${meta.id}_${params.library_name}*gatk_position_{uncovered,variants}*.tab")
path("Called/${meta.id}_${params.library_name}*gatk_position_variants*.tab"), emit: tbjoin_input
path("Called/${meta.id}_${meta.library}*gatk_position_{uncovered,variants}*.tab")
path("Called/${meta.id}_${meta.library}*gatk_position_variants*.tab"), emit: tbjoin_input

script:
def args = task.ext.args ?: "--mincovf ${params.mincovf} --mincovr ${params.mincovr} --minphred ${params.minphred} --minfreq ${params.minfreq}"
Expand Down Expand Up @@ -53,8 +53,8 @@ process TBVARIANTS {
mkdir Called
touch Called/${meta.id}_${params.library_name}.gatk_position_uncovered_cf${params.mincovf}_cr${params.mincovr}_fr${params.minfreq}_ph${params.minphred}_outmode000.tab
touch Called/${meta.id}_${params.library_name}.gatk_position_variants_cf${params.mincovf}_cr${params.mincovr}_fr${params.minfreq}_ph${params.minphred}_outmode000.tab
touch Called/${meta.id}_${meta.library}.gatk_position_uncovered_cf${params.mincovf}_cr${params.mincovr}_fr${params.minfreq}_ph${params.minphred}_outmode000.tab
touch Called/${meta.id}_${meta.library}.gatk_position_variants_cf${params.mincovf}_cr${params.mincovr}_fr${params.minfreq}_ph${params.minphred}_outmode000.tab
"""

Expand Down
6 changes: 3 additions & 3 deletions modules/utils/rename_files.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ process RENAME_FILES {
tuple val(meta), path(reads)

output:
path("${meta.id}_${params.library_name}_R?.fastq.gz")
path("${meta.id}_${meta.library}_R?.fastq.gz")

script:
"""
echo "Renaming ${reads} files as per MTBseq requirements."
cp ${reads[0]} ${meta.id}_${params.library_name}_R1.fastq.gz
cp ${reads[1]} ${meta.id}_${params.library_name}_R2.fastq.gz
cp ${reads[0]} ${meta.id}_${meta.library}_R1.fastq.gz
cp ${reads[1]} ${meta.id}_${meta.library}_R2.fastq.gz
"""

}
Loading

0 comments on commit 8b3cffc

Please sign in to comment.