-
Notifications
You must be signed in to change notification settings - Fork 440
add tests for normalization and concat + normalize #1815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maxulysse
merged 14 commits into
nf-core:dev_normalization
from
maxulysse:pytest_migration_normalization
Mar 4, 2025
Merged
Changes from 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
31be115
add tests for normalization and concat + normaliz
maxulysse 0094050
CI
maxulysse d5f2cbe
regenerate snapshots
maxulysse 6e7387a
fix and regenerate tests
maxulysse d7f3782
Apply suggestions from code review
maxulysse f9310a7
sort modules import
maxulysse a87b50b
add file to .nftignore
maxulysse 236b230
regenerate snapshots
maxulysse 96075a0
not this snap
maxulysse 5563ba2
unstable file
maxulysse c05e3f2
fix snapshots
maxulysse 7f4fa75
update snapshot
maxulysse 09aaed8
not a stable file
maxulysse 4fb8dbb
add file to .nftignore
maxulysse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -22,8 +22,8 @@ process { | |
publishDir = [ enabled: false ] | ||
} | ||
|
||
withName: 'ADD_INFO_TO_VCF'{ | ||
ext.when = { params.concatenate_vcfs } | ||
withName: 'ADD_INFO_TO_VCF' { | ||
ext.when = { params.concatenate_vcfs || params.normalize_vcfs } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is where our issue was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happens if you only normalize? no info needed? |
||
publishDir = [ enabled: false ] | ||
} | ||
|
||
|
@@ -49,8 +49,8 @@ process { | |
|
||
withName: 'VCFS_NORM' { | ||
ext.args = { [ | ||
'--multiallelics -both', //split multiallelic sites into biallelic records and both SNPs and indels should be merged separately into two records | ||
'--rm-dup all' //output only the first instance of a record which is present multiple times | ||
'--multiallelics -both', // split multiallelic sites into biallelic records and both SNPs and indels should be merged separately into two records | ||
'--rm-dup all' // output only the first instance of a record which is present multiple times | ||
].join(' ') } | ||
ext.when = { params.normalize_vcfs } | ||
publishDir = [ | ||
|
@@ -62,9 +62,10 @@ process { | |
withName: 'TABIX_EXT_VCF' { | ||
ext.prefix = { "${input.baseName}" } | ||
ext.when = { params.concatenate_vcfs || params.normalize_vcfs } | ||
publishDir = [ enabled: false ] | ||
} | ||
|
||
withName: 'TABIX_GERMLINE_VCFS_CONCAT_SORT'{ | ||
withName: 'TABIX_GERMLINE_VCFS_CONCAT_SORT' { | ||
ext.prefix = { "${meta.id}.germline" } | ||
ext.when = { params.concatenate_vcfs } | ||
publishDir = [ | ||
|
@@ -74,7 +75,7 @@ process { | |
] | ||
} | ||
|
||
withName: 'TABIX_VCFS_NORM_SORT'{ | ||
withName: 'TABIX_VCFS_NORM_SORT' { | ||
ext.prefix = { "${meta.id}.${meta.variantcaller}.norm" } | ||
ext.when = { params.normalize_vcfs } | ||
publishDir = [ | ||
|
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
File renamed without changes.
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,47 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test pipeline" | ||
script "../main.nf" | ||
tag "pipeline" | ||
tag "pipeline_sarek" | ||
|
||
test("-profile test --normalize_vcfs --concatenate_vcfs --tools freebayes,haplotypecaller") { | ||
|
||
when { | ||
params { | ||
|
||
input = "${projectDir}/tests/csv/3.0/mapped_joint_bam.csv" | ||
step = 'variant_calling' | ||
normalize_vcfs = true | ||
concatenate_vcfs = true | ||
tools = 'freebayes,haplotypecaller' | ||
modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/' | ||
outdir = "$outputDir" | ||
} | ||
} | ||
|
||
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') | ||
// vcf_files: All vcf files | ||
def vcf_files = getAllFilesFromDir(params.outdir, include: ['**/*.vcf.gz']) | ||
assertAll( | ||
{ assert workflow.success}, | ||
{ assert snapshot( | ||
// Number of successful tasks | ||
workflow.trace.succeeded().size(), | ||
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions | ||
removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), | ||
// All stable path name, with a relative path | ||
stable_name, | ||
// All files with stable contents | ||
stable_path, | ||
// All vcf files | ||
vcf_files.collect { file -> [file.getName(), path(file.toString()).vcf.variantsMD5] } | ||
).match() } | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO in #1770