Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheww95 committed Oct 29, 2024
1 parent 0d81ebf commit c036fb5
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- RASUSA now used for down sampling of Nanopore or PacBio data. [PR 125](https://github.com/phac-nml/mikrokondo/pull/125)

- Sample names (`sample_name` field) can no longer begin with a period. [PR 125](https://github.com/phac-nml/mikrokondo/pull/125)

### `Updated`

- Documentation and workflow diagram has been updated. [PR 123](https://github.com/phac-nml/mikrokondo/pull/123)
Expand Down
4 changes: 2 additions & 2 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"sample_name": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "Optional. Used to override sample when used in tools like IRIDA-Next.",
"pattern": "^[^\\.]\\S+$",
"errorMessage": "Optional. Used to override sample when used in tools like IRIDA-Next. Input cannot start with period.",
"meta": ["id"]
},
"fastq_1": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sample,sample_name,fastq_1,fastq_2,long_reads,assembly
INX,iridanext_output.,,,,https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/fake_contigs/vibrio_cholerae/st_120.fa.gz
62 changes: 62 additions & 0 deletions tests/pipelines/main.from_assemblies.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -796,4 +796,66 @@ nextflow_pipeline {
}
}

test("Test Stupid Name in Input Sheet") {
tag "from_assemblies_stupidnames"

when {
params {
// Need to update with 7 gene when complete
input = "$baseDir/tests/data/samplesheets/samplesheet-test-from-assemblies-vibrio-stupid-names.csv"
outdir = "results"

platform = "illumina"

mash_sketch = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/mash.msh"
dehosting_idx = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy.mmi"
kraken2_db = "$baseDir/tests/data/kraken2/test"
lx_allele_database = "$baseDir/tests/data/databases/locidex_dbs"
qt_min_contig_length = 1

skip_bakta = true
skip_mobrecon = true
skip_checkm = true
skip_raw_read_metrics = true
skip_polishing = true
skip_mlst = true
skip_version_gathering = true
skip_staramr = true
skip_length_filtering_contigs = true

skip_subtyping = false
skip_allele_calling = false
lx_report_max_stop = 100
max_memory = "2.GB"
max_cpus = 1
}
}

then {
assert workflow.success
assert path("$launchDir/results").exists()

// Compare IRIDANext json
assert path("$launchDir/results/iridanext.output.json").exists()
def iridanext_json = path("$launchDir/results/iridanext.output.json").json
def iridanext_global = iridanext_json.files.global
def iridanext_samples = iridanext_json.files.samples
def iridanext_metadata = iridanext_json.metadata.samples
def vibrio_metadata = iridanext_metadata.INX

// Output files
assert iridanext_global.findAll { it.path == "FinalReports/Aggregated/Json/final_report.json" }.size() == 1
assert iridanext_global.findAll { it.path == "FinalReports/Aggregated/Tables/final_report.tsv" }.size() == 1

assert vibrio_metadata.locidex_db_name == "Vibrio cholerae"
assert vibrio_metadata.locidex_db_date == "2024-07-30"
assert vibrio_metadata.locidex_db_version == "1.0.0"
assert vibrio_metadata.total_loci == 7
assert vibrio_metadata.count_loci_found == 6
assert vibrio_metadata.count_loci_missing == 1

}
}


}

0 comments on commit c036fb5

Please sign in to comment.