-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
825 additions
and
223 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 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() } | ||
) | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.