Skip to content

Commit

Permalink
Merge pull request #173 from TORCH-Consortium/filtering_bug
Browse files Browse the repository at this point in the history
Filtering bug
  • Loading branch information
LennertVerboven authored Aug 21, 2023
2 parents b218fb6 + c2af534 commit e0a4a45
Show file tree
Hide file tree
Showing 3 changed files with 290 additions and 24 deletions.
290 changes: 288 additions & 2 deletions conf/server.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
executor {
queueSize = 1
queueSize = 10
}

conda {
Expand All @@ -11,5 +11,291 @@ process {
memory = 14.GB
//errorStrategy = 'ignore'
// errorStrategy = { task.attempt < 2 ? 'retry' : 'ignore' }

withName: 'CALL_WF:BCFTOOLS_VIEW' {
cpus = 14
memory = 1.GB
}
withName: 'CALL_WF:BGZIP__LOFREQ' {
cpus = 2
memory = 1.GB
}
withName: 'CALL_WF:DELLY_CALL' {
cpus = 2
memory = 1.GB
}
withName: 'CALL_WF:GATK_COLLECT_WGS_METRICS' {
cpus = 2
memory = 2.GB
}
withName: 'CALL_WF:GATK_FLAG_STAT' {
cpus = 4
memory = 1.GB
}
withName: 'CALL_WF:GATK_HAPLOTYPE_CALLER' {
cpus = 5
memory = 3.GB
}
withName: 'CALL_WF:GATK_INDEX_FEATURE_FILE__LOFREQ' {
cpus = 5
memory = 1.GB
}
withName: 'CALL_WF:GATK_INDEX_FEATURE_FILE__SV' {
cpus = 5
memory = 1.GB
}
withName: 'CALL_WF:GATK_MARK_DUPLICATES' {
cpus = 4
memory = 7.GB
}
withName: 'CALL_WF:GATK_SELECT_VARIANTS__INCLUSION' {
cpus = 5
memory = 1.GB
}
withName: 'CALL_WF:LOFREQ_CALL' {
cpus = 8
memory = 1.GB
}
withName: 'CALL_WF:LOFREQ_CALL__NTM' {
cpus = 2
memory = 1.GB
}
withName: 'CALL_WF:LOFREQ_FILTER' {
cpus = 2
memory = 1.GB
}
withName: 'CALL_WF:LOFREQ_INDELQUAL' {
cpus = 1
memory = 1.GB
}
withName: 'CALL_WF:SAMTOOLS_INDEX' {
cpus = 2
memory = 1.GB
}
withName: 'CALL_WF:SAMTOOLS_INDEX__LOFREQ' {
cpus = 2
memory = 1.GB
}
withName: 'CALL_WF:SAMTOOLS_MERGE' {
cpus = 6
memory = 1.GB
}
withName: 'CALL_WF:SAMTOOLS_STATS' {
cpus = 2
memory = 1.GB
}
withName: 'CALL_WF:UTILS_COHORT_STATS' {
cpus = 1
memory = 1.GB
}
withName: 'CALL_WF:UTILS_REFORMAT_LOFREQ' {
cpus = 6
memory = 1.GB
}
withName: 'CALL_WF:UTILS_SAMPLE_STATS' {
cpus = 2
memory = 1.GB
}
withName: 'MAP_WF:BWA_MEM' {
cpus = 9
memory = 8.GB
}
withName: 'MERGE_WF:CLUSTER_ANALYSIS__EXCOMPLEX:CLUSTERPICKER__12SNP' {
cpus = 2
memory = 1.GB
}
withName: 'MERGE_WF:CLUSTER_ANALYSIS__EXCOMPLEX:CLUSTERPICKER__5SNP' {
cpus = 2
memory = 1.GB
}
withName: 'MERGE_WF:CLUSTER_ANALYSIS__INCCOMPLEX:CLUSTERPICKER__12SNP' {
cpus = 2
memory = 1.GB
}
withName: 'MERGE_WF:CLUSTER_ANALYSIS__INCCOMPLEX:CLUSTERPICKER__5SNP' {
cpus = 2
memory = 1.GB
}
withName: 'MERGE_WF:GATK_MERGE_VCFS__INC' {
cpus = 3
memory = 2.GB
}
withName: 'MERGE_WF:INDEL_ANALYSIS:GATK_SELECT_VARIANTS__INDEL' {
cpus = 3
memory = 2.GB
}
withName: 'MERGE_WF:MAJOR_VARIANT_ANALYSIS:TBPROFILER_COLLATE__COHORT' {
cpus = 1
memory = 1.GB
}
withName: 'MERGE_WF:MAJOR_VARIANT_ANALYSIS:TBPROFILER_VCF_PROFILE__COHORT' {
cpus = 3
memory = 1.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__EXCOMPLEX:GATK_SELECT_VARIANTS__PHYLOGENY' {
cpus = 2
memory = 2.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__EXCOMPLEX:GATK_VARIANTS_TO_TABLE' {
cpus = 2
memory = 2.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__EXCOMPLEX:IQTREE' {
cpus = 8
memory = 2.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__EXCOMPLEX:SNPDISTS' {
cpus = 1
memory = 1.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__EXCOMPLEX:SNPSITES' {
cpus = 2
memory = 1.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__INCCOMPLEX:GATK_SELECT_VARIANTS__PHYLOGENY' {
cpus = 2
memory = 2.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__INCCOMPLEX:GATK_VARIANTS_TO_TABLE' {
cpus = 2
memory = 2.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__INCCOMPLEX:IQTREE' {
cpus = 11
memory = 2.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__INCCOMPLEX:SNPDISTS' {
cpus = 1
memory = 1.GB
}
withName: 'MERGE_WF:PHYLOGENY_ANALYSIS__INCCOMPLEX:SNPSITES' {
cpus = 2
memory = 1.GB
}
withName: 'MERGE_WF:PREPARE_COHORT_VCF:BGZIP' {
cpus = 1
memory = 1.GB
}
withName: 'MERGE_WF:PREPARE_COHORT_VCF:GATK_COMBINE_GVCFS' {
cpus = 2
memory = 3.GB
}
withName: 'MERGE_WF:PREPARE_COHORT_VCF:GATK_GENOTYPE_GVCFS' {
cpus = 2
memory = 2.GB
}
withName: 'MERGE_WF:PREPARE_COHORT_VCF:GATK_INDEX_FEATURE_FILE__COHORT' {
cpus = 4
memory = 2.GB
}
withName: 'MERGE_WF:PREPARE_COHORT_VCF:SNPEFF' {
cpus = 2
memory = 1.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:GATK_APPLY_VQSR__SNP' {
cpus = 4
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:GATK_SELECT_VARIANTS__EXCLUSION__SNP' {
cpus = 3
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:GATK_SELECT_VARIANTS__SNP' {
cpus = 2
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:GATK_VARIANT_RECALIBRATOR__ANN2' {
cpus = 4
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:GATK_VARIANT_RECALIBRATOR__ANN3' {
cpus = 4
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:GATK_VARIANT_RECALIBRATOR__ANN4' {
cpus = 3
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:GATK_VARIANT_RECALIBRATOR__ANN5' {
cpus = 3
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:GATK_VARIANT_RECALIBRATOR__ANN6' {
cpus = 3
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:GATK_VARIANT_RECALIBRATOR__ANN7' {
cpus = 2
memory = 2.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:UTILS_ELIMINATE_ANNOTATION__ANN2' {
cpus = 2
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:UTILS_ELIMINATE_ANNOTATION__ANN3' {
cpus = 2
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:UTILS_ELIMINATE_ANNOTATION__ANN4' {
cpus = 2
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:UTILS_ELIMINATE_ANNOTATION__ANN5' {
cpus = 1
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:UTILS_ELIMINATE_ANNOTATION__ANN6' {
cpus = 2
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:UTILS_ELIMINATE_ANNOTATION__ANN7' {
cpus = 2
memory = 1.GB
}
withName: 'MERGE_WF:SNP_ANALYSIS:OPTIMIZE_VARIANT_RECALIBRATION:UTILS_SELECT_BEST_ANNOTATIONS' {
cpus = 2
memory = 1.GB
}
withName: 'MINOR_VARIANT_ANALYSIS_WF:BCFTOOLS_MERGE' {
cpus = 2
memory = 1.GB
}
withName: 'MINOR_VARIANT_ANALYSIS_WF:BGZIP' {
cpus = 1
memory = 1.GB
}
withName: 'MINOR_VARIANT_ANALYSIS_WF:TBPROFILER_COLLATE__LOFREQ' {
cpus = 1
memory = 1.GB
}
withName: 'MINOR_VARIANT_ANALYSIS_WF:TBPROFILER_VCF_PROFILE__LOFREQ' {
cpus = 3
memory = 1.GB
}
withName: 'MINOR_VARIANT_ANALYSIS_WF:UTILS_MULTIPLE_INFECTION_FILTER' {
cpus = 2
memory = 1.GB
}
withName: 'QUALITY_CHECK_WF:FASTQC' {
cpus = 3
memory = 1.GB
}
withName: 'REPORTS_WF:MULTIQC' {
cpus = 1
memory = 4.GB
}
withName: 'REPORTS_WF:UTILS_SUMMARIZE_RESISTANCE_RESULTS' {
cpus = 1
memory = 1.GB
}
withName: 'UTILS_MERGE_COHORT_STATS' {
cpus = 5
memory = 1.GB
}
withName: 'VALIDATE_FASTQS_WF:FASTQ_VALIDATOR' {
cpus = 1
memory = 1.GB
}
withName: 'VALIDATE_FASTQS_WF:SAMPLESHEET_VALIDATION' {
cpus = 5
memory = 1.GB
}
withName: 'VALIDATE_FASTQS_WF:UTILS_FASTQ_COHORT_VALIDATION' {
cpus = 1
memory = 1.GB
}
}
2 changes: 1 addition & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ workflow {
MERGE_WF.out.major_variants_results_ch,
STRUCTURAL_VARIANTS_ANALYSIS_WF.out.structural_variants_results_ch)

}
}

}

22 changes: 1 addition & 21 deletions workflows/merge_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ workflow MERGE_WF {
// Filter the approved samples
//---------------------------------------------------------------------------------

//NOTE: Read the approved_samples tsv file and isolate the names of the approved samples
approved_samples_minor_variants_ch = approved_samples_ch
.splitCsv(header: false, skip: 1, sep: '\t' )
.map { row -> [ row.first() ] }
.collect()
.dump(tag:'MERGE_WF: approved_samples_minor_variants_ch', pretty: true)

//NOTE: Reshape the flattened output of gvch_ch into the tuples of [sampleName, gvcf, gvcf.tbi]
collated_gvcfs_ch = gvcf_ch
.flatten()
Expand All @@ -53,21 +46,8 @@ workflow MERGE_WF {
.map { [ it[0] ] }
.dump(tag:'MERGE_WF: approved_call_wf_samples_ch', pretty: true)

/* approved_call_wf_samples_ch */
/* .collect() */
/* .dump(tag:'approved_call_wf_samples_ch.collect()') */

//NOTE: Join the approved samples from MINOR_VARIANTS_ANALYSIS_WF and CALL_WF
fully_approved_samples_ch = approved_samples_minor_variants_ch
.join(approved_call_wf_samples_ch)
.flatten()
.dump(tag:'MERGE_WF: fully_approved_samples_ch', pretty: true)
//.collect()
//.collectFile(name: "$params.outdir/approved_samples_ch.txt")


//NOTE: Join the fully approved samples with the gvcf channel
selected_gvcfs_ch = collated_gvcfs_ch.join(fully_approved_samples_ch)
selected_gvcfs_ch = collated_gvcfs_ch.join(approved_call_wf_samples_ch)
.flatten()
.dump(tag:'MERGE_WF: selected_gvcfs_ch', pretty: true)

Expand Down

0 comments on commit e0a4a45

Please sign in to comment.