Skip to content

Commit

Permalink
add fastq size filter
Browse files Browse the repository at this point in the history
  • Loading branch information
erinyoung committed Mar 4, 2024
1 parent c99ff12 commit ff69167
Showing 1 changed file with 36 additions and 33 deletions.
69 changes: 36 additions & 33 deletions donut_falls.nf
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ ch_input_files
// label "process_medium"
// publishDir "${params.outdir}/${meta.id}", mode: 'copy'
// container 'staphb/ontime:0.2.3'
// errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// //errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// time '45m'
//
// input:
Expand Down Expand Up @@ -173,7 +173,7 @@ ch_input_files
// label "process_high"
// publishDir "${params.outdir}/${meta.id}", mode: 'copy'
// container 'staphb/dragonflye:1.1.2'
// errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// //errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// time '10h'
//
// input:
Expand Down Expand Up @@ -220,7 +220,7 @@ ch_input_files
// label "process_high"
// publishDir "${params.outdir}/${meta.id}", mode: 'copy'
// container 'quay.io/biocontainers/hybracter:0.6.0--pyhdfd78af_0'
// errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// //errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// time '10h'
//
// input:
Expand Down Expand Up @@ -257,7 +257,7 @@ ch_input_files
// label "process_single"
// publishDir "${params.outdir}/test_files/nfcore", mode: 'copy'
// container 'staphb/multiqc:1.19'
// errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// //errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// time '1h'

// output:
Expand All @@ -277,7 +277,7 @@ ch_input_files
// label "process_single"
// publishDir "${params.outdir}/test_files/great", mode: 'copy'
// container 'staphb/multiqc:1.19'
// errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// //errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// time '1h'

// output:
Expand All @@ -301,7 +301,7 @@ ch_input_files
// label "process_single"
// publishDir "${params.outdir}/test_files/good", mode: 'copy'
// container 'staphb/multiqc:1.19'
// errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// //errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// time '1h'

// output:
Expand All @@ -322,7 +322,7 @@ ch_input_files
// label "process_single"
// publishDir "${params.outdir}/test_files/mediocre", mode: 'copy'
// container 'staphb/multiqc:1.19'
// errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// //errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// time '1h'

// output:
Expand All @@ -345,7 +345,7 @@ ch_input_files
// label "process_single"
// publishDir "${params.outdir}/test_files/bad", mode: 'copy'
// container 'staphb/multiqc:1.19'
// errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// //errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
// time '1h'

// output:
Expand Down Expand Up @@ -402,7 +402,7 @@ process bandage {
label "process_low"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'quay.io/biocontainers/bandage:0.8.1--hc9558a2_2'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -437,7 +437,7 @@ process busco {
label "process_medium"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/busco:5.6.1-prok-bacteria_odb10_2024-01-08'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '45m'

input:
Expand Down Expand Up @@ -473,7 +473,7 @@ process bwa {
label 'process_high'
// no publishDir because the sam files are too big
container 'staphb/bwa:0.7.17'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '2h'

input:
Expand Down Expand Up @@ -508,7 +508,7 @@ process circulocov {
label "process_medium"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'quay.io/uphl/circulocov:0.1.20240104-2024-02-21'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '1h'

input:
Expand Down Expand Up @@ -553,7 +553,7 @@ process copy {
label "process_single"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/multiqc:1.19'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -656,7 +656,7 @@ process dnaapler {
label "process_medium"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/dnaapler:0.7.0'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '1h'

input:
Expand Down Expand Up @@ -693,7 +693,7 @@ process fastp {
label "process_low"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/fastp:0.23.4'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -756,7 +756,7 @@ process flye {
label "process_high"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/flye:2.9.3'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10h'

input:
Expand Down Expand Up @@ -803,7 +803,7 @@ process gfastats {
label "process_medium"
publishDir "${params.outdir}/${meta.id}", mode: 'copy', pattern: 'gfastats/*'
container 'staphb/gfastats:1.3.6'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -847,7 +847,7 @@ process gfa_to_fasta {
label "process_low"
// no publishDir
container 'staphb/multiqc:1.19'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -907,7 +907,7 @@ process medaka {
label "process_medium"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'ontresearch/medaka:v1.11.3'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '30m'

input:
Expand Down Expand Up @@ -950,7 +950,7 @@ process multiqc {
label "process_low"
publishDir "${params.outdir}", mode: 'copy'
container 'staphb/multiqc:1.19'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -1136,7 +1136,7 @@ process nanoplot_summary {
label "process_low"
publishDir "${params.outdir}/summary", mode: 'copy'
container 'staphb/nanoplot:1.42.0'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -1174,7 +1174,7 @@ process nanoplot {
label "process_low"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/nanoplot:1.42.0'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
////errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -1218,7 +1218,7 @@ process polypolish {
label "process_medium"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/polypolish:0.6.0'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
////errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '45m'

input:
Expand Down Expand Up @@ -1264,7 +1264,7 @@ process pypolca {
label "process_medium"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/pypolca:0.3.1'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
////errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '30m'

input:
Expand Down Expand Up @@ -1320,7 +1320,7 @@ process rasusa {
label "process_medium"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/rasusa:0.8.0'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
////errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand All @@ -1341,7 +1341,9 @@ process rasusa {
rasusa ${args} \
--input ${fastq} \
--output rasusa/${prefix}_rasusa.fastq.gz
--output rasusa/${prefix}_rasusa.fastq
gzip --force rasusa/${prefix}_rasusa.fastq
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -1355,7 +1357,7 @@ process raven {
label "process_high"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/raven:1.8.3'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
////errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10h'

input:
Expand Down Expand Up @@ -1394,7 +1396,7 @@ process summary {
label "process_single"
publishDir "${params.outdir}/summary", mode: 'copy'
container 'staphb/multiqc:1.19'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
////errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10m'

input:
Expand Down Expand Up @@ -1551,7 +1553,7 @@ process unicycler {
label "process_high"
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
container 'staphb/unicycler:0.5.0'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
////errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '10h'

input:
Expand Down Expand Up @@ -1595,7 +1597,7 @@ process versions {
publishDir "${params.outdir}/summary", mode: 'copy'
container 'staphb/multiqc:1.19'
time '10m'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
////errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}

input:
file(input)
Expand Down Expand Up @@ -1703,7 +1705,7 @@ process test_unicycler {
label "process_single"
publishDir "${params.outdir}/test_files/unicycler", mode: 'copy'
container 'staphb/multiqc:1.19'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '1h'

output:
Expand All @@ -1725,7 +1727,7 @@ process test_donut_falls {
label "process_single"
publishDir "${params.outdir}/test_files/df", mode: 'copy'
container 'staphb/multiqc:1.19'
errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
//errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'}
time '1h'

output:
Expand Down Expand Up @@ -1786,8 +1788,8 @@ workflow DONUT_FALLS {
ch_versions = ch_versions.mix(fastp.out.versions)
ch_summary = ch_summary.mix(fastp.out.summary)

// TODO : filter out fastp reads when there aren't "enough"
fastp.out.fastq
.filter { it[1].size() > 200 }
.branch { it ->
nanopore: it[2] == 'nanopore'
illumina: it[2] == 'illumina'
Expand Down Expand Up @@ -1937,6 +1939,7 @@ workflow DONUT_FALLS {
}
.set { ch_assemblies }

// TODO : test this
ch_assemblies.dragonflye
.join(ch_nanopore_input, by: 0 , remainder: false).join(ch_illumina_input, by: 0, remainder: true)
.mix(ch_assemblies.flye.join(ch_nanopore_input, by: 0 , remainder: false).join(ch_illumina_input, by: 0, remainder: true))
Expand Down

0 comments on commit ff69167

Please sign in to comment.