Skip to content

Commit

Permalink
Merge pull request #42 from phac-nml/testing-no-skip
Browse files Browse the repository at this point in the history
Adding Additional Testing
  • Loading branch information
apetkau authored Mar 12, 2024
2 parents 26b1211 + 865fe4d commit e21f0a7
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ jobs:
run: |
nf-test test
- name: Nextflow run with test profile
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results
29 changes: 21 additions & 8 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,28 @@ params {
config_profile_description = 'Minimal test dataset to check pipeline function'

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

// 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 = 'https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'
input = "https://raw.githubusercontent.com/phac-nml/mikrokondo/dev/tests/data/samplesheets/samplesheet-small-assembly.csv"
outdir = "results"

// Genome references
genome = 'R64-1-1'
platform = "illumina"

mash.mash_sketch = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy-staph-ecoli.msh"
mash.min_kmer = 1

r_contaminants.mega_mm2_idx = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy.mmi"

fastp.args.illumina = "-Q"
min_reads = 100

skip_bakta = true
skip_staramr = false
skip_mobrecon = false
skip_checkm = false
skip_raw_read_metrics = false
skip_polishing = false
}
2 changes: 2 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,8 @@ profiles {
test_stub {includeConfig 'conf/test_stub.config'}
// Remove when merge into main
test_samplesheet {includeConfig 'conf/test_sample_sheet.config'}

test { includeConfig 'conf/test.config' }
}

plugins {
Expand Down
50 changes: 40 additions & 10 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ nextflow_pipeline {

platform = "illumina"

mash { mash_sketch = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy-staph-ecoli.msh" }
mash
{
mash_sketch = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy-staph-ecoli.msh"
min_kmer = 1
}

r_contaminants { mega_mm2_idx = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy.mmi" }

fastp { args { illumina = "-Q"} }
min_reads = 100
mash { min_kmer = 1 }

skip_bakta = true
skip_staramr = true
Expand Down Expand Up @@ -71,19 +75,23 @@ nextflow_pipeline {

platform = "illumina"

mash { mash_sketch = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy-staph-ecoli.msh" }
mash
{
mash_sketch = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy-staph-ecoli.msh"
min_kmer = 1
}

r_contaminants { mega_mm2_idx = "https://github.com/phac-nml/mikrokondo/raw/dev/tests/data/databases/campy.mmi" }

fastp { args { illumina = "-Q"} }
min_reads = 100
mash { min_kmer = 1 }

skip_bakta = true
skip_staramr = true
skip_mobrecon = true
skip_checkm = true
skip_raw_read_metrics = true
skip_polishing = true
skip_staramr = false
skip_mobrecon = false
skip_checkm = false
skip_raw_read_metrics = false
skip_polishing = false

max_memory = "2.GB"
max_cpus = 1
Expand All @@ -97,6 +105,11 @@ nextflow_pipeline {
// parse output json file
def json = path("$launchDir/results/SummaryReport/final_report.json").json

assert json.short.short.RawReadSummary.R1."total_bp".equals(118750)
assert json.short.short.RawReadSummary.R1."total_reads".equals(475)
assert json.short.short.RawReadSummary.R1."read_qual_mean".equals(40.0)
assert json.short.short.RawReadSummary.R1."mean_sequence_length".equals(250.0)

assert json.short.short.FastP.summary.sequencing.equals("paired end (250 cycles + 250 cycles)")
assert json.short.short.FastP.summary.before_filtering.total_reads.equals(950)
assert json.short.short.FastP.filtering_result.passed_filter_reads.equals(950)
Expand All @@ -116,12 +129,29 @@ nextflow_pipeline {
assert json.short.short.QUAST."0"."GC (%)".equals("52.96")
assert json.short.short.QUAST."0"."Avg. coverage depth".equals("47")

assert json.short.short.StarAMR."0"."Isolate ID".equals("short_polished")
assert json.short.short.StarAMR."0"."Data Type".equals("MLST")
assert json.short.short.StarAMR."1"."Isolate ID".equals("short_polished")
assert json.short.short.StarAMR."1"."Data Type".equals("Plasmid")
assert json.short.short.StarAMR."2"."Isolate ID".equals("short_polished")
assert json.short.short.StarAMR."2"."Data Type".equals("Resistance")
assert json.short.short.StarAMR."2"."Predicted Phenotype".equals("Sensitive")

assert json.short.short.CheckM."0"."# genomes".equals("5656")
assert json.short.short.CheckM."0"."# markers".equals("56")
assert json.short.short.CheckM."0"."# marker sets".equals("24")
assert json.short.short.CheckM."0".Contamination.equals("0.00")

assert json.short.short.SevenGeneMLSTReport[0].filename.equals("short_polished.fasta.gz")

assert json.short.short.Abricate."0".RESISTANCE.equals("NoData") // All Abricate results for this are "NoData".

def assembly_path = "$launchDir/results/assembly/length_filtered_contigs/short_filtered.fasta.gz"
assert path(assembly_path).exists()

// parse assembly file
def assembly_header = path(assembly_path).linesGzip[0]
assert assembly_header.equals(">NODE_1_length_4949_cov_23.917254")
assert assembly_header.startsWith(">NODE_1_length_4949_cov_23.917254") // _pilon_pilon_pilon gets appended

// compare IRIDA Next JSON output
def iridanext_json = path("$launchDir/results/iridanext.output.json").json
Expand Down

0 comments on commit e21f0a7

Please sign in to comment.