Skip to content

Commit c218d8b

Browse files
authored
Merge pull request #393 from sanger-tol/dev
Merge dev into main for release
2 parents 19febb6 + 95cde15 commit c218d8b

25 files changed

+1066
-272
lines changed

conf/base.config

+10-9
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ process {
135135

136136
withName: '.*:.*:GENE_ALIGNMENT:.*:MINIPROT_INDEX' {
137137
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
138-
memory = { check_max( 1.GB * ( fasta.size() < 2e9 ? 50 : Math.ceil( ( fasta.size() / 1e+9 ) * 20 ) * Math.ceil( task.attempt * 1 ) ) , 'memory') }
138+
memory = { check_max( 1.GB * ( fasta.size() < 2e9 ? 50 : Math.ceil( ( fasta.size() / 1e+9 ) * 10 ) * Math.ceil( task.attempt * 1 ) ) , 'memory') }
139139
time = { check_max( 10.h * task.attempt, 'time' ) }
140140
}
141141

142142
// Standard parameters, covers most insecta. However the memory should be approx 10 * genome size
143143
withName: '.*:.*:READ_COVERAGE:MINIMAP2_ALIGN' {
144144
cpus = { check_max( 20 * 1, 'cpus' ) }
145-
memory = { check_max( 1.GB * ( reference.size() < 2e9 ? 50 : Math.ceil( ( reference.size() / 1e+9 ) * 20 ) * Math.ceil( task.attempt * 1 ) ) , 'memory') }
145+
memory = { check_max( 1.GB * ( reference.size() < 2e9 ? 50 : Math.ceil( ( reference.size() / 1e+9 ) * 2.5 ) * Math.ceil( task.attempt * 1 ) ) , 'memory') }
146146
time = { check_max( 1.h * ( reference.size() < 1e9 ? 10 : reference.size() < 10e9 ? 30 : 48), 'time' ) }
147147
}
148148

@@ -169,7 +169,7 @@ process {
169169

170170
withName: CRAM_FILTER_MINIMAP2_FILTER5END_FIXMATE_SORT {
171171
cpus = { check_max( 16 * 1 , 'cpus' ) }
172-
memory = { check_max( 1.GB * ( reference.size() < 2e9 ? 50 : Math.ceil( ( reference.size() / 1e+9 ) * 20 ) * Math.ceil( task.attempt * 1 ) ) , 'memory') }
172+
memory = { check_max( 1.GB * ( reference.size() < 2e9 ? 50 : Math.ceil( ( reference.size() / 1e+9 ) * 3 ) * Math.ceil( task.attempt * 1 ) ) , 'memory') }
173173
}
174174

175175
withName: SNAPSHOT_SRES {
@@ -204,19 +204,19 @@ process {
204204

205205
withName: MINIMAP2_INDEX {
206206
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
207-
memory = { check_max( 1.GB * Math.ceil( 30 * fasta.size() / 1e+9 ) * task.attempt, 'memory' ) }
207+
memory = { check_max( 1.GB * Math.ceil( 4 * fasta.size() / 1e+9 ) * task.attempt, 'memory' ) }
208208
}
209209

210210
// add a cpus 16 if bam.size() >= 50GB
211211
withName: BAMTOBED_SORT {
212212
cpus = { check_max( 12 * 1, 'cpus' ) }
213-
memory = { check_max( 2.GB * ( ( bam.size() < 150e9 ? Math.ceil( bam.size() / 1e+9 ) : Math.ceil( bam.size() / 4e+9 ) ) * Math.ceil( task.attempt * 1 ) ), 'memory' ) }
213+
memory = { check_max( 1.GB * ( ( bam.size() < 100e9 ? Math.ceil( bam.size() / 3e+9 ) : Math.ceil( bam.size() / 4e+9 ) ) * Math.ceil( task.attempt * 1 ) ), 'memory' ) }
214214
time = { check_max( 30.h * task.attempt, 'time' ) }
215215
}
216216

217217
withName: SAMTOOLS_MARKDUP {
218218
cpus = { check_max( 12 * 1, 'cpus' ) }
219-
memory = { check_max( 1.GB * Math.ceil( (input.size() / 1e+9) / 2 ) * task.attempt, 'memory' ) }
219+
memory = { check_max( 1.GB * Math.ceil( (input.size() / 1e+9) / 4 ) * task.attempt, 'memory' ) }
220220
}
221221

222222
withName: COOLER_CLOAD {
@@ -274,8 +274,9 @@ process {
274274
// SUBWORKFLOW: HIC_MAPPING
275275
//
276276
withName: GET_PAIRED_CONTACT_BED {
277-
cpus = { check_max( ${ file.size() > 1e11 ? 12 : 6 } , 'cpus' ) }
278-
memory = { check_max( 1.GB * Math.ceil( file.size() / 2e+9 ) * task.attempt , 'memory' ) }
277+
cpus = { check_max( 10 * 1, 'cpus' ) }
278+
memory = { check_max( 10.GB * task.attempt , 'memory' ) }
279+
//memory = { check_max( 1.GB * Math.ceil( file.size() / 2e+9 ) * task.attempt , 'memory' ) }
279280
time = { check_max( 30.h * task.attempt, 'time' ) }
280281
}
281282

@@ -305,7 +306,7 @@ process {
305306
}
306307

307308
withName: BEDTOOLS_INTERSECT {
308-
memory = { check_max( 6.GB * (task.attempt * task.attempt), 'memory' ) }
309+
memory = { check_max( 30.GB * (task.attempt * task.attempt), 'memory' ) }
309310
}
310311

311312
withName: GENERATE_CRAM_CSV {

conf/modules.config

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ process {
120120
//
121121
withName : MUMMER {
122122
ext.args = "-n -b -c -L -l 400"
123-
ext.prefix = { "${meta.rid}_VS_${meta.qid}" }
123+
ext.prefix = { "${meta.id}" }
124124
}
125125

126126

@@ -233,13 +233,13 @@ process {
233233
}
234234

235235
withName: ".*:.*:SELFCOMP:SEQKIT_SPLIT_REF" {
236-
ext.args = ""
236+
ext.args = { " -p ${meta.cn} --by-part-prefix ref_chunk --out-dir refchunks "}
237237
ext.prefix = { "${meta.id}_ref" }
238238
}
239239

240240
withName: ".*:.*:SELFCOMP:SEQKIT_SPLIT_QUERY" {
241-
ext.args = ""
242-
ext.prefix = { "${meta.id}_query" }
241+
ext.args = { " -p ${meta.cn} --by-part-prefix query_chunk --out-dir querychunks "}
242+
ext.prefix = { "${meta.id}_ref" }
243243
}
244244

245245
//

modules.json

+6
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@
167167
"git_sha": "669eb24fd82a9d3cb18ad0e73673ecb26827f683",
168168
"installed_by": ["modules"]
169169
},
170+
"seqkit/split2": {
171+
"branch": "master",
172+
"git_sha": "81880787133db07d9b4c1febd152c090eb8325dc",
173+
"installed_by": ["modules"],
174+
"patch": "modules/nf-core/seqkit/split2/seqkit-split2.diff"
175+
},
170176
"seqtk/cutn": {
171177
"branch": "master",
172178
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",

modules/local/pretext_graph.nf

+29-24
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ process PRETEXT_GRAPH {
88
tuple val(meta), path(pretext_file)
99
tuple val(gap), path(gap_file)
1010
tuple val(cov), path(coverage)
11-
tuple val(avg), path(avg_coverage)
1211
tuple val(telo), path(telomere_file)
1312
tuple val(rep), path(repeat_density)
1413

@@ -22,54 +21,60 @@ process PRETEXT_GRAPH {
2221
script:
2322
def args = task.ext.args ?: ''
2423
def prefix = task.ext.prefix ?: "${meta.id}"
25-
def PRXT_VERSION = '0.0.6'
2624
def UCSC_VERSION = '447' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
2725

2826
"""
29-
bigWigToBedGraph ${coverage} /dev/stdout | PretextGraph ${args} -i ${pretext_file} -n "coverage" -o coverage.pretext.part
30-
31-
bigWigToBedGraph ${repeat_density} /dev/stdout | PretextGraph ${args} -i coverage.pretext.part -n "repeat_density" -o repeat.pretext.part
32-
33-
bigWigToBedGraph ${avg_coverage} /dev/stdout | PretextGraph ${args} -i repeat.pretext.part -n "avg_coverage" -o avg.pretext.part
34-
35-
if [[ ${gap.sz} -ge 1 && ${telo.sz} -ge 1 ]]
27+
if [[ -s "${coverage}" ]];
3628
then
37-
echo "GAP AND TELO have contents!"
38-
cat ${gap_file} | PretextGraph ${args} -i avg.pretext.part -n "${gap.ft}" -o gap.pretext.part
39-
cat ${telomere_file} | PretextGraph -i gap.pretext.part -n "${telo.ft}" -o ${prefix}.pretext
29+
echo "PROCESSING COVERAGE..."
30+
bigWigToBedGraph ${coverage} /dev/stdout | PretextGraph ${args} -i ${pretext_file} -n "coverage" -o coverage.pretext.part
31+
else
32+
echo "SKIPPING COVERAGE"
33+
mv ${pretext_file} coverage.pretext.part
34+
fi
4035
41-
elif [[ ${gap.sz} -ge 1 && ${telo.sz} -eq 0 ]]
36+
if [[ -s "${repeat_density}" ]];
4237
then
43-
echo "GAP file has contents!"
44-
cat ${gap_file} | PretextGraph ${args} -i avg.pretext.part -n "${gap.ft}" -o ${prefix}.pretext
38+
echo "PROCESSING REPEAT_DENSITY..."
39+
bigWigToBedGraph ${repeat_density} /dev/stdout | PretextGraph ${args} -i coverage.pretext.part -n "repeat_density" -o repeat.pretext.part
40+
else
41+
echo "SKIPPING REPEAT_DENSITY"
42+
mv coverage.pretext.part repeat.pretext.part
43+
fi
4544
46-
elif [[ ${gap.sz} -eq 0 && ${telo.sz} -ge 1 ]]
47-
then
48-
echo "TELO file has contents!"
49-
cat ${telomere_file} | PretextGraph ${args} -i avg.pretext.part -n "${telo.ft}" -o ${prefix}.pretext
45+
if [[ -s "${gap_file}" ]]; then
46+
echo "Processing GAP file..."
47+
cat "${gap_file}" | PretextGraph ${args} -i repeat.pretext.part -n "${gap.ft}" -o gap.pretext.part
48+
input_file="gap.pretext.part"
49+
else
50+
input_file="repeat.pretext.part"
51+
fi
5052
53+
if [[ -s "${telomere_file}" ]]; then
54+
echo "Processing TELO file..."
55+
cat "${telomere_file}" | PretextGraph ${args} -i "\$input_file" -n "${telo.ft}" -o "${prefix}.pretext"
5156
else
52-
echo "NO GAP OR TELO FILE WITH CONTENTS - renaming part file"
53-
mv avg.pretext.part ${prefix}.pretext
57+
mv "\$input_file" "${prefix}.pretext"
5458
fi
5559
5660
cat <<-END_VERSIONS > versions.yml
5761
"${task.process}":
58-
PretextGraph: ${PRXT_VERSION}
62+
PretextGraph: \$(PretextGraph | grep "Version" | sed 's/Pretext.* Version //;')
63+
PretextMap: \$(PretextMap | grep "Version" | sed 's/Pretext.* Version//;')
5964
bigWigToBedGraph: ${UCSC_VERSION}
6065
END_VERSIONS
6166
"""
6267

6368
stub:
6469
def prefix = task.ext.prefix ?: "${meta.id}"
65-
def PRXT_VERSION = '0.0.7'
6670
def UCSC_VERSION = '448' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
6771
"""
6872
touch ${prefix}.pretext
6973
7074
cat <<-END_VERSIONS > versions.yml
7175
"${task.process}":
72-
PretextGraph: ${PRXT_VERSION}
76+
PretextGraph: \$(PretextGraph | grep "Version" | sed 's/Pretext* Version //;')
77+
PretextMap: \$(PretextMap | grep "Version" | sed 's/PretextMap Version//;')
7378
bigWigToBedGraph: ${UCSC_VERSION}
7479
END_VERSIONS
7580
"""

modules/local/selfcomp_mummer2bed.nf

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ process SELFCOMP_MUMMER2BED {
99

1010
input:
1111
tuple val(meta), path(mummerfile)
12-
val (motiflen)
1312

1413
output:
1514
tuple val(meta), path("*.bed"), emit: bedfile
@@ -23,7 +22,7 @@ process SELFCOMP_MUMMER2BED {
2322
def prefix = task.ext.prefix ?: "${meta.id}"
2423

2524
"""
26-
mummer2bed.py $args -i $mummerfile -l $motiflen > ${prefix}.bed
25+
mummer2bed.py $args -i $mummerfile -l 0 > ${prefix}.bed
2726
2827
cat <<-END_VERSIONS > versions.yml
2928
"${task.process}":

modules/local/seqkit/split/main.nf

-44
This file was deleted.

modules/nf-core/seqkit/split2/environment.yml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/seqkit/split2/main.nf

+80
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)