Skip to content

Commit

Permalink
Added ancient_dna test and reproducibility for binning
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonJM committed Dec 15, 2023
1 parent 857fb2d commit 40b4ebf
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 21 deletions.
2 changes: 1 addition & 1 deletion conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ process {
}
//returns exit code 247 when running out of memory
withName: BOWTIE2_ASSEMBLY_ALIGN {
cpus = { check_max (2 * task.attempt, 'cpus' ) }
cpus = { check_bowtie2_cpus (8, 'cpus' ) }
memory = { check_max (8.GB * task.attempt, 'memory' ) }
time = { check_max (8.h * task.attempt, 'time' ) }
errorStrategy = { task.exitStatus in [143,137,104,134,139,247] ? 'retry' : 'finish' }
Expand Down
44 changes: 24 additions & 20 deletions conf/test_ancient_dna.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,31 @@ params {
config_profile_description = 'Minimal test dataset to check pipeline function for ancient DNA step'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '6.GB'
//max_cpus = 2
//max_memory = '6.GB'
max_time = '6.h'

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/mag/samplesheets/samplesheet.csv'
centrifuge_db = "https://raw.githubusercontent.com/nf-core/test-datasets/mag/test_data/minigut_cf.tar.gz"
kraken2_db = "https://raw.githubusercontent.com/nf-core/test-datasets/mag/test_data/minigut_kraken.tgz"
skip_krona = true
min_length_unbinned_contigs = 1
max_unbinned_contigs = 2
busco_db = "https://busco-data.ezlab.org/v5/data/lineages/bacteria_odb10.2020-03-06.tar.gz"
skip_gtdbtk = true
ancient_dna = true
binning_map_mode = 'own'
skip_spades = false
skip_spadeshybrid = true
bcftools_view_high_variant_quality = 0
bcftools_view_medium_variant_quality = 0
bcftools_view_minimal_allelesupport = 3
refine_bins_dastool = true
refine_bins_dastool_threshold = 0
skip_concoct = true
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/mag/samplesheets/samplesheet.csv'
skip_clipping = true
keep_phix = true
kraken2_db = null
centrifuge_db = null
skip_krona = true
megahit_fix_cpu_1 = true
skip_spades = false
spades_fix_cpus = 1
skip_spadeshybrid = true
ancient_dna = true
skip_quast = true
skip_prodigal = true
bowtie2_fix_cpu_1 = true
binning_map_mode = 'own'
metabat2_fix_cpu_1 = true
maxbin2_fix_cpu_1 = true
concoct_fix_cpu_1 = true
skip_binqc = true
skip_gtdbtk = true
skip_prokka = true
skip_metaeuk = true
}
15 changes: 15 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ params {
metabat_rng_seed = 1
bowtie2_seed = 1
bowtie2_fix_cpu_1 = false
metabat2_fix_cpu_1 = false
maxbin2_fix_cpu_1 = false
concoct_fix_cpu_1 = false

// Annotation options
skip_metaeuk = false
Expand Down Expand Up @@ -428,3 +431,15 @@ def check_spadeshybrid_cpus (x, attempt ) {
if (params.spadeshybrid_fix_cpus != -1) return check_max (params.spadeshybrid_fix_cpus, 'cpus' )
else return check_max (x * attempt, 'cpus' )
}
def check_metabat2_cpus (x, attempt ) {
if (params.metabat2_fix_cpu_1) return 1
else return check_max (x * attempt, 'cpus' )
}
def check_maxbin2_cpus (x, attempt ) {
if (params.maxbin2_fix_cpu_1) return 1
else return check_max (x * attempt, 'cpus' )
}
def check_concoct_cpus (x, attempt ) {
if (params.concoct_fix_cpu_1) return 1
else return check_max (x * attempt, 'cpus' )
}
2 changes: 2 additions & 0 deletions workflows/mag/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
test_adapterremoval:
- ./**
test_ancient_dna:
- ./**
test_bbnorm:
- ./**
test_host_rm:
Expand Down
34 changes: 34 additions & 0 deletions workflows/mag/tests/test_ancient_dna.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
nextflow_workflow {

name "Test workflow: MAG"
script "../main.nf"
workflow "MAG"
tag "workflows"
tag "mag"
tag "mag_test_ancient_dna"

test("Parameters: ancient_dna = true") {

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(
workflow.out.
short_reads,
//workflow.out.assemblies,
//workflow.out.prodigal,
//workflow.out.genomad,
//workflow.out.busco,
//workflow.out.checkm,
//workflow.out.gunc,
//workflow.out.quast_bins,
//workflow.out.cat,
//workflow.out.gtdbtk,
//workflow.out.prokka,
//workflow.out.metaeuk,
//workflow.out.versions
).match()}
)
}
}
}
31 changes: 31 additions & 0 deletions workflows/mag/tests/test_ancient_dna.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"Parameters: ancient_dna = true": {
"content": [
[
[
{
"id": "test_minigut",
"group": "0",
"single_end": false
},
[
"/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz",
"/nf-core/test-datasets/raw/mag/test_data/test_minigut_R2.fastq.gz"
]
],
[
{
"id": "test_minigut_sample2",
"group": "0",
"single_end": false
},
[
"/nf-core/test-datasets/raw/mag/test_data/test_minigut_sample2_R1.fastq.gz",
"/nf-core/test-datasets/raw/mag/test_data/test_minigut_sample2_R2.fastq.gz"
]
]
]
],
"timestamp": "2023-12-15T13:36:01.487711685"
}
}

0 comments on commit 40b4ebf

Please sign in to comment.