-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into krakentools_fixmeta
- Loading branch information
Showing
9 changed files
with
335 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
nextflow_process { | ||
|
||
name "Test Process SENTIEON_READWRITER" | ||
script "../main.nf" | ||
process "SENTIEON_READWRITER" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "sentieon" | ||
tag "sentieon/readwriter" | ||
|
||
test("merge bam") { | ||
config "./nextflow.config" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [id: 'test' ], | ||
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), | ||
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) | ||
] | ||
input[1] = [[:],[]] | ||
input[2] = [[:],[]] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
bam(process.out.output[0][1], stringency: "lenient").getReadsMD5(), | ||
file(process.out.index.get(0).get(1)).name, | ||
process.out.versions | ||
).match() } | ||
|
||
) | ||
} | ||
|
||
} | ||
|
||
test("cram") { | ||
config "./nextflow_outputcram.config" | ||
when { | ||
process { | ||
""" | ||
input[0] = [ [id: 'test', fasta: params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta' ], | ||
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), | ||
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) | ||
] | ||
input[1] = [ [ id:'fasta' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] | ||
input[2] = [ [ id:'fasta' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
bam(process.out.output[0][1], process.out.output[0][0].fasta).getReadsMD5(), | ||
file(process.out.index.get(0).get(1)).name, | ||
process.out.versions | ||
).match() } | ||
|
||
) | ||
} | ||
} | ||
|
||
test("merging - output bam") { | ||
config "./nextflow.config" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [id: 'test' ], | ||
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true) | ||
], | ||
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) | ||
] | ||
] | ||
input[1] = [[:],[]] | ||
input[2] = [[:],[]] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
bam(process.out.output[0][1], stringency: "lenient").getReadsMD5(), | ||
file(process.out.index.get(0).get(1)).name, | ||
process.out.versions | ||
).match() } | ||
|
||
) | ||
} | ||
|
||
} | ||
|
||
test("merging - output bam to cram") { | ||
config "./nextflow_outputcram.config" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [id: 'test', fasta: params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta' ], | ||
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true) | ||
], | ||
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) | ||
] | ||
] | ||
input[1] = [ [ id:'fasta' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] | ||
input[2] = [ [ id:'fasta' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
bam(process.out.output[0][1], process.out.output[0][0].fasta).getReadsMD5(), | ||
file(process.out.index.get(0).get(1)).name, | ||
process.out.versions | ||
).match() } | ||
|
||
) | ||
} | ||
|
||
} | ||
|
||
test("sentieon readwriter - stub") { | ||
options "-stub" | ||
config "./nextflow.config" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [id: 'test' ], | ||
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), | ||
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) | ||
] | ||
input[1] = [ [ id:'fasta' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] | ||
input[2] = [ [ id:'fasta' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
125 changes: 125 additions & 0 deletions
125
modules/nf-core/sentieon/readwriter/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"merge bam": { | ||
"content": [ | ||
"2f11e4fe3390b8ad0a1852616fd1da04", | ||
"test.bam.bai", | ||
[ | ||
"versions.yml:md5,7e0e065f92de4419098841b16968fbed" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-08-01T13:14:43.34615" | ||
}, | ||
"cram": { | ||
"content": [ | ||
"2f11e4fe3390b8ad0a1852616fd1da04", | ||
"test.cram.crai", | ||
[ | ||
"versions.yml:md5,7e0e065f92de4419098841b16968fbed" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-08-01T13:14:53.60186" | ||
}, | ||
"merging - output bam": { | ||
"content": [ | ||
"ed89d81d2d6adafdbb819a1a4ec86493", | ||
"test.bam.bai", | ||
[ | ||
"versions.yml:md5,7e0e065f92de4419098841b16968fbed" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-08-01T13:15:03.780064" | ||
}, | ||
"merging - output bam to cram": { | ||
"content": [ | ||
"ed89d81d2d6adafdbb819a1a4ec86493", | ||
"test.cram.crai", | ||
[ | ||
"versions.yml:md5,7e0e065f92de4419098841b16968fbed" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-08-01T13:15:15.313494" | ||
}, | ||
"sentieon readwriter - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"2": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.cram:md5,d41d8cd98f00b204e9800998ecf8427e", | ||
"test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"3": [ | ||
"versions.yml:md5,7e0e065f92de4419098841b16968fbed" | ||
], | ||
"index": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"output": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"output_index": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.cram:md5,d41d8cd98f00b204e9800998ecf8427e", | ||
"test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,7e0e065f92de4419098841b16968fbed" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-08-01T13:15:23.88137" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
env { | ||
// NOTE This is how pipeline users will use Sentieon in real world use | ||
SENTIEON_LICENSE = "$SENTIEON_LICSRVR_IP" | ||
// NOTE This should only happen in GitHub actions or nf-core MegaTests | ||
SENTIEON_AUTH_MECH = "$SENTIEON_AUTH_MECH" | ||
SENTIEON_AUTH_DATA = secrets.SENTIEON_AUTH_DATA | ||
// NOTE This is how pipeline users will test out Sentieon with a license file | ||
// nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat <sentieon_license_file.lic> | base64 -w 0) | ||
} |
16 changes: 16 additions & 0 deletions
16
modules/nf-core/sentieon/readwriter/tests/nextflow_outputcram.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
env { | ||
// NOTE This is how pipeline users will use Sentieon in real world use | ||
SENTIEON_LICENSE = "$SENTIEON_LICSRVR_IP" | ||
// NOTE This should only happen in GitHub actions or nf-core MegaTests | ||
SENTIEON_AUTH_MECH = "$SENTIEON_AUTH_MECH" | ||
SENTIEON_AUTH_DATA = secrets.SENTIEON_AUTH_DATA | ||
// NOTE This is how pipeline users will test out Sentieon with a license file | ||
// nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat <sentieon_license_file.lic> | base64 -w 0) | ||
} | ||
|
||
|
||
process { | ||
withName: "SENTIEON_READWRITER" { | ||
ext.prefix = { "${meta.id}.cram" } | ||
} | ||
} |
Oops, something went wrong.