forked from nf-core/phaseimpute
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nf-core#20 from LouisLeNezet/auto_chr_rename
Add auto detection of chr prefix and auto fixing
- Loading branch information
Showing
30 changed files
with
822 additions
and
221 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
name: vcfchrextract | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::bcftools=1.18 |
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,49 @@ | ||
process VCFCHREXTRACT { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': | ||
'biocontainers/bcftools:1.18--h8b25389_0' }" | ||
|
||
input: | ||
tuple val(meta), path(input) | ||
|
||
output: | ||
tuple val(meta), path("*.txt"), emit: chr | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
bcftools \\ | ||
head \\ | ||
$input \\ | ||
\| grep -o -E '^##contig=<ID=([^,>]*)' | cut -d'=' -f3 \\ | ||
> ${prefix}.txt | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bcftools: \$( bcftools --version |& sed '1!d; s/^.*bcftools //' ) | ||
grep: \$( grep --help |& grep -o -E '[0-9]+\\.[0-9]+\\.[0-9]+' ) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.txt | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
bcftools: \$( bcftools --version |& sed '1!d; s/^.*bcftools //' ) | ||
grep: \$( grep --help |& grep -o -E '[0-9]+\\.[0-9]+\\.[0-9]+' ) | ||
END_VERSIONS | ||
""" | ||
} |
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,41 @@ | ||
name: vcfchrextract | ||
description: Extract all contigs name into txt file | ||
keywords: | ||
- bcftools | ||
- vcf | ||
- head | ||
- contig | ||
tools: | ||
- head: | ||
description: Extract header from variant calling file. | ||
homepage: http://samtools.github.io/bcftools/bcftools.html | ||
documentation: https://samtools.github.io/bcftools/bcftools.html#head | ||
doi: 10.1093/bioinformatics/btp352 | ||
licence: ["MIT"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- input: | ||
type: file | ||
description: Query VCF or BCF file, can be either uncompressed or compressed | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- chr: | ||
type: file | ||
description: List of contigs in the VCF file | ||
pattern: "*{txt}" | ||
authors: | ||
- "@louislenezet" | ||
maintainers: | ||
- "@louislenezet" |
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,32 @@ | ||
nextflow_process { | ||
|
||
name "Test Process VCFCHREXTRACT" | ||
script "../main.nf" | ||
process "VCFCHREXTRACT" | ||
|
||
tag "modules" | ||
tag "modules_local" | ||
tag "vcfchrextract" | ||
|
||
test("Extract chr from vcf") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
} |
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,35 @@ | ||
{ | ||
"Extract chr from vcf": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.txt:md5,3a9ea6d336e113a74d7fdca5e7b623fc" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,7e6d75a47df5ce3a975172dcd47fd247" | ||
], | ||
"chr": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.txt:md5,3a9ea6d336e113a74d7fdca5e7b623fc" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,7e6d75a47df5ce3a975172dcd47fd247" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-03-22T15:09:21.585363234" | ||
} | ||
} |
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,2 @@ | ||
vcfchrextract: | ||
- "modules/local/vcfchrextract/**" |
Oops, something went wrong.