-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New module for mergestr #12015
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
Open
KondratievaOlesya
wants to merge
2
commits into
nf-core:master
Choose a base branch
from
KondratievaOlesya:trtools_mergestr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New module for mergestr #12015
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - "bioconda::trtools=6.1.0" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| process TRTOOLS_MERGESTR { | ||
| tag "$meta.id" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? | ||
| 'https://depot.galaxyproject.org/singularity/trtools:6.1.0--pyhdfd78af_0': | ||
| 'quay.io/biocontainers/trtools:6.1.0--pyhdfd78af_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(vcfs), path(tbis) | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.vcf.gz"), emit: vcf | ||
| tuple val(meta), path("*.vcf.gz.tbi"), emit: tbi | ||
| tuple val("${task.process}"), val('trtools'), eval("mergeSTR --version | sed 's/mergeSTR //'"), topic: versions, emit: versions_trtools | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}_mergestr" | ||
| def input = vcfs.sort { vcf -> vcf.toString() }.join(",") | ||
|
|
||
| """ | ||
| mergeSTR \\ | ||
| --vcfs ${input} \\ | ||
| --out ${prefix} \\ | ||
| ${args} | ||
|
|
||
| bgzip -f ${prefix}.vcf | ||
| tabix -f -p vcf ${prefix}.vcf.gz | ||
| """ | ||
|
|
||
| stub: | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
KondratievaOlesya marked this conversation as resolved.
Outdated
|
||
|
|
||
| """ | ||
| echo "" | gzip > ${prefix}.vcf.gz | ||
| touch ${prefix}.vcf.gz.tbi | ||
| """ | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: "trtools_mergestr" | ||
| description: MergeSTR merges multiple VCF files produced by the same TR | ||
| genotyper into a single VCF file. | ||
| keywords: | ||
| - tandem repeats | ||
| - str | ||
| - vcf | ||
| - merge | ||
| - trtools | ||
| tools: | ||
| - "trtools": | ||
| description: "Toolkit for genome-wide analysis of tandem repeats" | ||
| homepage: "https://trtools.readthedocs.io/" | ||
| documentation: "https://trtools.readthedocs.io/" | ||
| tool_dev_url: "https://github.com/gymrek-lab/TRTools" | ||
| doi: "10.1093/bioinformatics/btaa736" | ||
| licence: | ||
| - "MIT" | ||
| identifier: biotools:trtools | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - vcfs: | ||
| type: file | ||
| description: List containing 2 or more bgzipped tandem repeat VCF files | ||
| e.g. [ 'file1.vcf,gz', 'file2.vcf.gz' ] | ||
|
KondratievaOlesya marked this conversation as resolved.
Outdated
|
||
| pattern: "*.{vcf.gz}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3016" | ||
| - tbis: | ||
| type: file | ||
| description: List containing the tbi index files corresponding to the vcfs | ||
| input files e.g. [ 'file1.vcf.gz.tbi', 'file2.vcf.gz.tbi' ] | ||
| pattern: "*.{vcf.gz.tbi}" | ||
| ontologies: [] | ||
|
KondratievaOlesya marked this conversation as resolved.
Outdated
|
||
| output: | ||
| vcf: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*.vcf.gz": | ||
| type: file | ||
| description: Merged VCF file with the merged genotypes | ||
| pattern: "*.vcf.gz" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3016" | ||
| - edam: "http://edamontology.org/format_3989" | ||
| tbi: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*.vcf.gz.tbi": | ||
| type: file | ||
| description: Tabix index for the merged VCF file | ||
| pattern: "*.vcf.gz.tbi" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3700" | ||
| versions_trtools: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - trtools: | ||
| type: string | ||
| description: The name of the tool | ||
| - mergeSTR --version | sed 's/mergeSTR //': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - trtools: | ||
| type: string | ||
| description: The name of the tool | ||
| - mergeSTR --version | sed 's/mergeSTR //': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@KondratievaOlesya" | ||
| maintainers: | ||
| - "@KondratievaOlesya" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process TRTOOLS_MERGESTR" | ||
| script "../main.nf" | ||
| config "./nextflow.config" | ||
| process "TRTOOLS_MERGESTR" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "gangstr" | ||
| tag "trtools" | ||
| tag "trtools/mergestr" | ||
|
|
||
| setup { | ||
| run("GANGSTR", alias: "GANGSTR1") { | ||
| script "modules/nf-core/gangstr/main.nf" | ||
|
|
||
| process { | ||
| """ | ||
| bed1 = Channel.of('chr22\t3000\t3020\t5\tCGCGC') | ||
| .collectFile(name: 'genome1.bed', newLine: true) | ||
|
|
||
| input[0] = Channel.of([ | ||
| [id:'test1'], | ||
| 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) | ||
| ]).combine(bed1) | ||
|
|
||
| input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists:true) | ||
| input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists:true) | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| run("GANGSTR", alias: "GANGSTR2") { | ||
| script "modules/nf-core/gangstr/main.nf" | ||
|
|
||
| process { | ||
| """ | ||
| bed2 = Channel.of('chr22\t3000\t3020\t5\tCGCGC') | ||
| .collectFile(name: 'genome2.bed', newLine: true) | ||
|
|
||
| input[0] = Channel.of([ | ||
| [id:'test2'], | ||
| 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) | ||
| ]).combine(bed2) | ||
|
|
||
| input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists:true) | ||
| input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists:true) | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("homo_sapiens - gangstr vcfs") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = GANGSTR1.out.vcf | ||
| .combine(GANGSTR2.out.vcf) | ||
| .combine(GANGSTR1.out.index) | ||
| .combine(GANGSTR2.out.index) | ||
| .map { meta1, vcf1, meta2, vcf2, meta3, tbi1, meta4, tbi2 -> | ||
| [ | ||
| [ id: 'test' ], | ||
| [ vcf1, vcf2 ], | ||
| [ tbi1, tbi2 ] | ||
| ] | ||
| } | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| path(process.out.vcf.get(0).get(1)).vcf.summary, | ||
| file(process.out.tbi[0][1]).name, | ||
| process.out.findAll { key, val -> key.startsWith('versions') } | ||
| ).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("homo_sapiens - gangstr vcfs - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = GANGSTR1.out.vcf | ||
| .combine(GANGSTR2.out.vcf) | ||
| .combine(GANGSTR1.out.index) | ||
| .combine(GANGSTR2.out.index) | ||
| .map { meta1, vcf1, meta2, vcf2, meta3, tbi1, meta4, tbi2 -> | ||
| [ | ||
| [ id: 'test' ], | ||
| [ vcf1, vcf2 ], | ||
| [ tbi1, tbi2 ] | ||
| ] | ||
| } | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() } | ||
| ) | ||
| } | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| { | ||
| "homo_sapiens - gangstr vcfs - stub": { | ||
| "content": [ | ||
| { | ||
| "tbi": [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "vcf": [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" | ||
| ] | ||
| ], | ||
| "versions_trtools": [ | ||
| [ | ||
| "TRTOOLS_MERGESTR", | ||
| "trtools", | ||
| "6.1.0" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-06-16T14:19:01.247840767", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "26.04.3" | ||
| } | ||
| }, | ||
| "homo_sapiens - gangstr vcfs": { | ||
| "content": [ | ||
| "VcfFile [chromosomes=[chr22], sampleCount=2, variantCount=1, phased=false, phasedAutodetect=false]", | ||
| "test_mergestr.vcf.gz.tbi", | ||
| { | ||
| "versions_trtools": [ | ||
| [ | ||
| "TRTOOLS_MERGESTR", | ||
| "trtools", | ||
| "6.1.0" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-06-16T14:11:27.91327297", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "26.04.3" | ||
| } | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| process { | ||
| withName: TRTOOLS_MERGESTR { | ||
| ext.args = '--vcftype gangstr --update-sample-from-file' | ||
| } | ||
| withName: GANGSTR1 { | ||
| ext.args = '--insertmean 300 --insertsdev 50 --min-sample-reads 1 --max-proc-read 100000' | ||
| } | ||
|
|
||
| withName: GANGSTR2 { | ||
| ext.args = '--insertmean 300 --insertsdev 50 --min-sample-reads 1 --max-proc-read 100000' | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.