Open
Conversation
Comment on lines
+27
to
+46
| import pysam | ||
| from variant_extractor import VariantExtractor | ||
|
|
||
| vcf_in = pysam.VariantFile("${vcf}") | ||
| header = str(vcf_in.header).rstrip("\\n") | ||
| vcf_in.close() | ||
|
|
||
| extractor = VariantExtractor( | ||
| "${vcf}", | ||
| pass_only=${pass_only}, | ||
| ensure_pairs=${ensure_pairs} | ||
| ) | ||
|
|
||
| with open("${prefix}.extracted.vcf", "w") as out: | ||
| out.write(header + "\\n") | ||
| for variant_record in extractor: | ||
| out.write(str(variant_record) + "\\n") | ||
|
|
||
| extractor.close() | ||
| PYEOF |
Member
There was a problem hiding this comment.
Please use a template for this. There are a few examples in modules if you search for template such as the module ANNDATA_BARCODES.
You might need to remove the def before the variables so the python script can access the groovy variable values.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR checklist
Closes #9996
topic: versions- See version_topicslabelnf-core modules test variantextractor --profile dockernf-core modules test variantextractor --profile singularitynf-core modules test variantextractor --profile condaDescription
Add new module for
variant-extractor(EUCANCan), a Python library fordeterministic extraction and homogenization of SNVs, indels and structural
variants (SVs) from VCF files.
The tool has no CLI — the module wraps the Python API directly via an inline
python3script usingpysam+VariantExtractor.Related: nf-core/variantbenchmarking#264