Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fellen31 committed Oct 25, 2024
1 parent f7787ea commit 1e0ec67
Show file tree
Hide file tree
Showing 10 changed files with 254 additions and 208 deletions.
4 changes: 2 additions & 2 deletions modules/local/add_found_in_tag/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ process ADD_FOUND_IN_TAG {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//')
busybox-awk: \$(awk 2>&1 | sed -n 's/.*v\\([^ ]*\\) (.*/\\1/p')
END_VERSIONS
"""

Expand All @@ -90,7 +90,7 @@ process ADD_FOUND_IN_TAG {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
busybox-awk: \$(awk -Wversion | sed -n 's/.*v\\([^ ]*\\) (.*/\\1/p')
busybox-awk: \$(awk 2>&1 | sed -n 's/.*v\\([^ ]*\\) (.*/\\1/p')
END_VERSIONS
"""
}
12 changes: 6 additions & 6 deletions modules/local/add_found_in_tag/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"content": [
"7ce88babfa8801b2a913faf40c6f7edd",
[
"versions.yml:md5,366aba7250a7ed36b3a0fa4b534ad33d"
"versions.yml:md5,5d810c4fbc154928fabfe136fad38704"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-09-17T12:12:10.307079371"
"timestamp": "2024-10-25T09:33:11.23710858"
},
"sarscov2 - [vcf, []], variant_caller -stub": {
"content": [
Expand Down Expand Up @@ -191,7 +191,7 @@

],
"3": [
"versions.yml:md5,2ae45bee794ce6db65e7dc9c5cd036df"
"versions.yml:md5,5d810c4fbc154928fabfe136fad38704"
],
"csi": [

Expand Down Expand Up @@ -369,14 +369,14 @@
]
],
"versions": [
"versions.yml:md5,2ae45bee794ce6db65e7dc9c5cd036df"
"versions.yml:md5,5d810c4fbc154928fabfe136fad38704"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-24T16:40:24.837767435"
"timestamp": "2024-10-25T09:33:18.256743972"
}
}
112 changes: 56 additions & 56 deletions subworkflows/local/call_svs/tests/main.nf.test.snap

Large diffs are not rendered by default.

96 changes: 48 additions & 48 deletions subworkflows/local/short_variant_calling/tests/main.nf.test.snap

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions tests/.nftignore_unstable_variants
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
paraphase/**/*.vcf.gz
snvs/**/*.vcf.gz
svs/**/*.vcf.gz
6 changes: 3 additions & 3 deletions tests/samplesheet.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ nextflow_pipeline {
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
// bam_files: All bam files
def bam_files = getAllFilesFromDir(params.outdir, include: ['**/*.bam'])
// all_vcf_files: All vcf files
// all_vcf_files: All vcf files - can have unstable variants and/or unstable headers
def all_vcf_files = getAllFilesFromDir(params.outdir, include: ['**/*.vcf.gz'])
// stable_vcf_files: Vcf files whose variants are stable
def stable_vcf_files = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore', include: ['**/*.vcf.gz'])
// stable_vcf_files: Vcf files with stable variants - can be snapshot unsing variantsMD5
def stable_vcf_files = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore_unstable_variants', include: ['**/*.vcf.gz'])
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand Down
74 changes: 45 additions & 29 deletions tests/samplesheet.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"ADD_FOUND_IN_TAG": {
"bcftools": 1.2,
"gawk": null
"busybox-awk": "1.36.1"
},
"ADD_MOST_SEVERE_CSQ": {
"add_most_severe_consequence": "v1.0",
Expand Down Expand Up @@ -121,7 +121,7 @@
"gunzip": 1.1
},
"HIFIASM": {
"hifiasm": "0.19.8-r603"
"hifiasm": "0.20.0-r639"
},
"HIFICNV": {
"hificnv": "0.1.7-70e9988"
Expand Down Expand Up @@ -389,25 +389,25 @@
"svs/single_sample/HG002_Revio/HG002_Revio_svs_annotated.vcf.gz.tbi"
],
[
"HG002_Revio.asm.bp.hap1.p_ctg.assembly_summary:md5,e4da3107f2421d42c6e2f59bff4e47d9",
"HG002_Revio.asm.bp.hap1.p_ctg.fasta.gz:md5,eff16bf92abff02c36cceb2eb5a9871c",
"HG002_Revio.asm.bp.hap2.p_ctg.assembly_summary:md5,bf908610472e602fd986b9d4a4d58b9e",
"HG002_Revio.asm.bp.hap2.p_ctg.fasta.gz:md5,e28c886baffe24c1a2972a1d95b1b250",
"HG002_Revio.dip.bed:md5,4e3cde029bceaa9363402e997f12f280",
"HG002_Revio.dip.vcf.gz:md5,9259613d7b01347b2d817d4e547c4203",
"HG002_Revio.hap1.bam:md5,5c739e8b3c2f659c3847498848280bbf",
"HG002_Revio.hap1.bam.bai:md5,a57472fa9365470db09f5ea8c7a7420a",
"HG002_Revio.hap1.bed:md5,3d75c9538e748a7672b934bdbde90df3",
"HG002_Revio.hap1.paf.gz:md5,46a3056ecd833d9a932c53fc46a3cafc",
"HG002_Revio.hap1.sam.gz:md5,0a161b44c29c0581ada87fee50be38c2",
"HG002_Revio.hap1.var.gz:md5,173218f6c3f5f067e0932a8331f12e3d",
"HG002_Revio.hap2.bam:md5,df63e7bb5dcee6ca5e731272dad0eb99",
"HG002_Revio.hap2.bam.bai:md5,ed8184223edea0297c7f9283ea7927bf",
"HG002_Revio.hap2.bed:md5,9ac411d49f08a8ec70e4792890e9faf9",
"HG002_Revio.hap2.paf.gz:md5,a99e451e4af96a7ab120cedd49eea618",
"HG002_Revio.hap2.sam.gz:md5,410acad899eda2f0a4a3e1eb4acf81cb",
"HG002_Revio.hap2.var.gz:md5,53dc16fc893a529a95067da161b4dad6",
"HG002_Revio.pair.vcf.gz:md5,a390558ab50ce0dc9efec070b1c70c22",
"HG002_Revio.asm.bp.hap1.p_ctg.assembly_summary:md5,b949217515292b5a7735af4ad4bd5b11",
"HG002_Revio.asm.bp.hap1.p_ctg.fasta.gz:md5,380ed173f8d50419a86c229dd81a20c2",
"HG002_Revio.asm.bp.hap2.p_ctg.assembly_summary:md5,c3e50f54e9e2871771d1735c54e57c5e",
"HG002_Revio.asm.bp.hap2.p_ctg.fasta.gz:md5,6ca4cd66b46b2bf7b1ed1ee959fba6ab",
"HG002_Revio.dip.bed:md5,8230ffcc5539eef359ab5128fa60e765",
"HG002_Revio.dip.vcf.gz:md5,747ea6c9532679ae7eb5ce06f511c4c2",
"HG002_Revio.hap1.bam:md5,91467717def7554e5ed667a103b52ebb",
"HG002_Revio.hap1.bam.bai:md5,3d7137693801619c4afb4cb493c35d40",
"HG002_Revio.hap1.bed:md5,44dcedabe0edb29af441df1f0b55210a",
"HG002_Revio.hap1.paf.gz:md5,680a7278a2d492ed6ee5c7b19dd5d80f",
"HG002_Revio.hap1.sam.gz:md5,87781cea76b064c23d1b63a34423b23f",
"HG002_Revio.hap1.var.gz:md5,bd714e935825d8c665445d93c7d82206",
"HG002_Revio.hap2.bam:md5,f1da738bd01db5c6e5e8b18906fe30f2",
"HG002_Revio.hap2.bam.bai:md5,04a41250610872ae3bf86108be610883",
"HG002_Revio.hap2.bed:md5,6b4b879d4ebe97f778921252469a029c",
"HG002_Revio.hap2.paf.gz:md5,77ff9e7c1b0ed8454f7a10beba01cbf9",
"HG002_Revio.hap2.sam.gz:md5,6d512a060c74428f7758aa51a99ae8c8",
"HG002_Revio.hap2.var.gz:md5,9ba9303b30730e419138e177c7d1e0c2",
"HG002_Revio.pair.vcf.gz:md5,1909dffa43850282fe7e5ae2b2d273a7",
"HG002_Revio.copynum.bedgraph:md5,517bc59c1b235490c79aa8319437b033",
"HG002_Revio.depth.bw:md5,0b9cae1d0646fdd2f690d4255282ee8f",
"HG002_Revio.maf.bw:md5,bacc69449af34efe8576245ae8188719",
Expand All @@ -433,7 +433,7 @@
"test.ped:md5,bd5cec27ba7337a85cf98e787131e2b5",
"HG002_Revio_cramino_aligned_phased.arrow:md5,a76219e9046db32c4b3d6d78425c5d78",
"HG002_Revio_cramino_aligned.arrow:md5,a76219e9046db32c4b3d6d78425c5d78",
"HG002_Revio_fastqc.html:md5,cf0b867d310438dd34bd9cdabab7d639",
"HG002_Revio_fastqc.html:md5,1080b519dbbb66f45eee74e311d4922c",
"HG002_Revio.mosdepth.global.dist.txt:md5,63701e857361046628f89cb84988ea1d",
"HG002_Revio.mosdepth.region.dist.txt:md5,6b46396518979ff9d9771cb8a8fbbab0",
"HG002_Revio.mosdepth.summary.txt:md5,311aad293c6d8a646b6dd4edc337845c",
Expand All @@ -449,11 +449,11 @@
],
[
"HG002_Revio.hap1.bam",
"514d30ef8ff2c0a3d9a19ebc702ba883"
"da103c401cf854a00aa75a57cda0f34d"
],
[
"HG002_Revio.hap2.bam",
"2f245ef6c8405acc80bc9df75553f276"
"e8599cef23fc88e2fe09d2bda5ea372f"
],
[
"HG002_Revio.paraphase.bam",
Expand All @@ -467,11 +467,11 @@
[
[
"HG002_Revio.dip.vcf.gz",
"VcfFile [chromosomes=[chrX, chr16], sampleCount=1, variantCount=2175, phased=true, phasedAutodetect=false]"
"VcfFile [chromosomes=[chrX, chr16], sampleCount=1, variantCount=1917, phased=true, phasedAutodetect=false]"
],
[
"HG002_Revio.pair.vcf.gz",
"VcfFile [chromosomes=[chrX, chr16], sampleCount=2, variantCount=2175, phased=false, phasedAutodetect=false]"
"VcfFile [chromosomes=[chrX, chr16], sampleCount=2, variantCount=1917, phased=false, phasedAutodetect=false]"
],
[
"HG002_Revio.vcf.gz",
Expand Down Expand Up @@ -517,22 +517,38 @@
[
[
"HG002_Revio.dip.vcf.gz",
"4c6e0d636226da4518af943966ca67ef"
"db10cdb233cb09a46c1694536c2e79e7"
],
[
"HG002_Revio.pair.vcf.gz",
"7eecef7377b98744cacaae36201c67e2"
"fa3bfacdab5449526d29d642340d6708"
],
[
"HG002_Revio.vcf.gz",
"ab9044066c7bd041966eed43e0d00f13"
],
[
"HG002_Revio_phased.vcf.gz",
"dfb1409ffb74988cbbc104e3ec133af6"
],
[
"HG002_Revio_repeat_expansion_stranger.vcf.gz",
"492a5d1a0f1656e1f7fc1b97c922cab4"
],
[
"test.vcf.gz",
"4ab22ba6012b9f579f1831248bb95da"
],
[
"HG002_Revio_sorted.vcf.gz",
"43b909ba9628b92f5062be6c413e560d"
]
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-24T16:29:57.416435345"
"timestamp": "2024-10-25T09:49:20.607165"
}
}
9 changes: 4 additions & 5 deletions tests/samplesheet_multisample_bam.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ nextflow_pipeline {

}
}

then {
then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
// bam_files: All bam files
def bam_files = getAllFilesFromDir(params.outdir, include: ['**/*.bam'])
// all_vcf_files: All vcf files
// all_vcf_files: All vcf files - can be unstable and are therefore snapshot with vcf.summary
def all_vcf_files = getAllFilesFromDir(params.outdir, include: ['**/*.vcf.gz'])
// stable_vcf_files: Vcf files whose variants are stable
def stable_vcf_files = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore', include: ['**/*.vcf.gz'])
// stable_vcf_files: Vcf files with stable variants - can be snapshot using vcf.variantsMD5
def stable_vcf_files = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore_unstable_variants', include: ['**/*.vcf.gz'])
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand Down
Loading

0 comments on commit 1e0ec67

Please sign in to comment.