Skip to content

Commit

Permalink
Get testing working
Browse files Browse the repository at this point in the history
  • Loading branch information
jfy133 committed May 23, 2024
1 parent 3e2377c commit 526ef0d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 19 deletions.
4 changes: 3 additions & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ params {
// Input data
// TODO nf-core: Specify the paths to your test data on nf-core/test-datasets
// TODO nf-core: Give any required params for the test so that command line flags are not needed
input = params.pipelines_testdata_base_path + 'createtaxdb/samplesheets/test.csv'
input = params.pipelines_testdata_base_path + 'createtaxdb/samplesheets/test.csv'

dbname = "database"

build_diamond = true
build_kaiju = true
Expand Down
8 changes: 8 additions & 0 deletions conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ params {
// 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 = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_full_illumina_amplicon.csv'

build_diamond = true
build_kaiju = true
build_malt = true
build_centrifuge = true
build_kraken2 = true
build_bracken = true

}
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ params {
validate_params = true

// General parameters
dbname = "database"
dbname = null
save_concatenated_fastas = false

accession2taxid = null
Expand Down
6 changes: 3 additions & 3 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "object",
"fa_icon": "fas fa-terminal",
"description": "Define where the pipeline should find input data and save output data.",
"required": ["input", "outdir"],
"required": ["input", "outdir", "dbname"],
"properties": {
"input": {
"type": "string",
Expand Down Expand Up @@ -43,7 +43,6 @@
},
"dbname": {
"type": "string",
"default": "database",
"description": "Specify name that resulting databases will be prefixed with.",
"fa_icon": "fas fa-id-badge"
},
Expand Down Expand Up @@ -149,7 +148,8 @@
"build_bracken": {
"type": "boolean",
"fa_icon": "fas fa-save",
"description": "Generate Bracken files required for abundance estimation."
"description": "Turn on extending of Kraken2 database to include Bracken files. Requires nucleotide FASTA File input.",
"help_text": "Bracken2 databases are simply just a Kraken2 database with two additional files.\n\nNote however this requires a Kraken2 database _with_ intermediate files still in it, thus can result in large database directories."
}
},
"fa_icon": "fas fa-database"
Expand Down
8 changes: 5 additions & 3 deletions tests/test.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ nextflow_pipeline {
path("$outputDir/centrifuge/"),
path("$outputDir/diamond/database.dmnd"),
path("$outputDir/kaiju/database.fmi"),
path("$outputDir/kraken2/db/hash.k2d"),
file("$outputDir/kraken2/db/opts.k2d").name,
path("$outputDir/kraken2/db/taxo.k2d"),
path("$outputDir/kraken2/database/hash.k2d"),
file("$outputDir/kraken2/database/opts.k2d").name,
path("$outputDir/kraken2/database/taxo.k2d"),
file("$outputDir/bracken/database/database100mers.kmer_distrib").name,
file("$outputDir/bracken/database/database100mers.kraken").name,
path("$outputDir/malt/malt-build.log").readLines().last().contains('Peak memory'),
path("$outputDir/malt/malt_index/index0.idx"),
path("$outputDir/malt/malt_index/ref.db"),
Expand Down
6 changes: 4 additions & 2 deletions tests/test.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"hash.k2d:md5,01122a04dcef29ceb3baa68a9f6e6ef5",
"opts.k2d",
"taxo.k2d:md5,cd8170a8c5a1b763a9ac1ffa2107cc88",
"database100mers.kmer_distrib",
"database100mers.kraken",
true,
"index0.idx:md5,876139dc930e68992cd2625e08bba48a",
"ref.db:md5,377073f58a9f9b85acca59fcf21744a9",
Expand All @@ -23,8 +25,8 @@
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nextflow": "24.04.1"
},
"timestamp": "2024-04-11T10:59:28.687364796"
"timestamp": "2024-05-23T08:00:31.799820635"
}
}
18 changes: 9 additions & 9 deletions workflows/createtaxdb.nf
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ workflow CREATETAXDB {
def k2_keepintermediates = params.kraken2_keepintermediate || params.build_bracken ? false : true
FASTA_BUILD_ADD_KRAKEN2_BRACKEN ( CAT_CAT_DNA.out.file_out, ch_taxonomy_namesdmp, ch_taxonomy_nodesdmp, ch_accession2taxid, k2_keepintermediates, params.build_bracken )
ch_versions = ch_versions.mix(FASTA_BUILD_ADD_KRAKEN2_BRACKEN.out.versions.first())
ch_kraken2_output = FASTA_BUILD_ADD_KRAKEN2_BRACKEN.out.db
ch_kraken2_bracken_output = FASTA_BUILD_ADD_KRAKEN2_BRACKEN.out.db
} else {
ch_kraken2_output = Channel.empty()
ch_kraken2_bracken_output = Channel.empty()
}

// Module: Run MALT/BUILD
Expand Down Expand Up @@ -229,13 +229,13 @@ workflow CREATETAXDB {
multiqc_report = MULTIQC.out.report.toList()

emit:
versions = ch_collated_versions
multiqc_report = MULTIQC.out.report.toList() // channel: /path/to/multiqc_report.html
centrifuge_database = ch_centrifuge_output
diamond_database = ch_diamond_output
kaiju_database = ch_kaiju_output
kraken2_database = ch_kraken2_output
malt_database = ch_malt_output
versions = ch_collated_versions
multiqc_report = MULTIQC.out.report.toList() // channel: /path/to/multiqc_report.html
centrifuge_database = ch_centrifuge_output
diamond_database = ch_diamond_output
kaiju_database = ch_kaiju_output
kraken2_bracken_database = ch_kraken2_bracken_output
malt_database = ch_malt_output
}

/*
Expand Down

0 comments on commit 526ef0d

Please sign in to comment.