mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
Picard liftover vcf (#1431)
* Building Picard liftovervcf module * Building Picard liftovervcf module_test * Building Picard liftovervcf pytest * Module for picard liftover vcf created * Fixed files after linting test * Fixed trailing whitespace * Checked files with prettier * further formatting with prettier * Fixed test.yml * Fixed input variable names * Changed contain test.liftef.vcf * Changed contain in test.yml test.liftef.vcf * Run prittier * Going back to previous version of test.yml * downgrading picard to 2.26.10 from 2.26.11 * Update modules/picard/liftovervcf/main.nf Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> * Update modules/picard/liftovervcf/main.nf Print available memory Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> * Output from .vcf to .vcf.gz * Added spaces to align emit * Update modules/picard/liftovervcf/meta.yml Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> * Update modules/picard/liftovervcf/meta.yml Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> * Update modules/picard/liftovervcf/meta.yml Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> * Removing md5sum test Co-authored-by: jemten <jemten@users.noreply.github.com> Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com> Co-authored-by: Maxime U. Garcia <max.u.garcia@gmail.com>
This commit is contained in:
parent
d2726fcf75
commit
f079367416
6 changed files with 141 additions and 0 deletions
49
modules/picard/liftovervcf/main.nf
Normal file
49
modules/picard/liftovervcf/main.nf
Normal file
|
@ -0,0 +1,49 @@
|
|||
process PICARD_LIFTOVERVCF {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::picard=2.26.10" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/picard:2.26.10--hdfd78af_0' :
|
||||
'quay.io/biocontainers/picard:2.26.10--hdfd78af_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(input_vcf)
|
||||
path dict
|
||||
path chain
|
||||
path fasta
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*lifted.vcf.gz") , emit: vcf_lifted
|
||||
tuple val(meta), path("*unlifted.vcf.gz"), emit: vcf_unlifted
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
def avail_mem = 1
|
||||
if (!task.memory) {
|
||||
log.info '[Picard LiftoverVcf] Available memory not known - defaulting to 1GB. Specify process memory requirements to change this.'
|
||||
} else {
|
||||
avail_mem = task.memory.giga
|
||||
}
|
||||
"""
|
||||
picard \\
|
||||
-Xmx${avail_mem}g \\
|
||||
LiftoverVcf \\
|
||||
$args \\
|
||||
I=$input_vcf \\
|
||||
O=${prefix}.lifted.vcf.gz \\
|
||||
CHAIN=$chain \\
|
||||
REJECT=${prefix}.unlifted.vcf.gz \\
|
||||
R=$fasta
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
picard: \$(picard LiftoverVcf --version 2>&1 | grep -o 'Version.*' | cut -f2- -d:)
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
55
modules/picard/liftovervcf/meta.yml
Normal file
55
modules/picard/liftovervcf/meta.yml
Normal file
|
@ -0,0 +1,55 @@
|
|||
name: picard_liftovervcf
|
||||
description: convert between genome builds
|
||||
keywords:
|
||||
- liftOver
|
||||
- picard
|
||||
tools:
|
||||
- picard:
|
||||
description: Move annotations from one assembly to another
|
||||
homepage: https://gatk.broadinstitute.org/hc/en-us/articles/360037060932-LiftoverVcf-Picard
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/articles/360037060932-LiftoverVcf-Picard
|
||||
tool_dev_url: https://github.com/broadinstitute/picard
|
||||
doi: ""
|
||||
licence: ["MIT"]
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- input_vcf:
|
||||
type: file
|
||||
description: VCF file
|
||||
pattern: "*.{vcf,vcf.gz}"
|
||||
- chain:
|
||||
type: file
|
||||
description: The liftover chain file
|
||||
- fasta:
|
||||
type: file
|
||||
description: fasta file
|
||||
pattern: "*.fasta"
|
||||
- dict:
|
||||
type: file
|
||||
description: dictionary for fasta file
|
||||
pattern: "*.{dict}"
|
||||
|
||||
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"
|
||||
- vcf_lifted:
|
||||
type: file
|
||||
description: VCF file containing successfully lifted variants
|
||||
pattern: "*.{lifted.vcf.gz}"
|
||||
- vcf_unlifted:
|
||||
type: file
|
||||
description: VCF file containing unsuccessfully lifted variants
|
||||
pattern: "*.{unlifted.vcf.gz}"
|
||||
|
||||
authors:
|
||||
- "@lucpen"
|
|
@ -1351,6 +1351,10 @@ picard/fixmateinformation:
|
|||
- modules/picard/fixmateinformation/**
|
||||
- tests/modules/picard/fixmateinformation/**
|
||||
|
||||
picard/liftovervcf:
|
||||
- modules/picard/liftovervcf/**
|
||||
- tests/modules/picard/liftovervcf/**
|
||||
|
||||
picard/markduplicates:
|
||||
- modules/picard/markduplicates/**
|
||||
- tests/modules/picard/markduplicates/**
|
||||
|
|
17
tests/modules/picard/liftovervcf/main.nf
Normal file
17
tests/modules/picard/liftovervcf/main.nf
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { PICARD_LIFTOVERVCF } from '../../../../modules/picard/liftovervcf/main.nf'
|
||||
|
||||
workflow test_picard_liftovervcf {
|
||||
|
||||
input_vcf = [ [ id:'test' ],
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true)
|
||||
]
|
||||
dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
chain = file(params.test_data['homo_sapiens']['genome']['genome_chain_gz'], checkIfExists: true)
|
||||
fasta = [ file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ]
|
||||
|
||||
PICARD_LIFTOVERVCF ( input_vcf, dict, chain, fasta )
|
||||
}
|
5
tests/modules/picard/liftovervcf/nextflow.config
Normal file
5
tests/modules/picard/liftovervcf/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
ext.args = "WARN_ON_MISSING_CONTIG=true"
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
11
tests/modules/picard/liftovervcf/test.yml
Normal file
11
tests/modules/picard/liftovervcf/test.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
- name: picard liftovervcf test_picard_liftovervcf
|
||||
command: nextflow run tests/modules/picard/liftovervcf -entry test_picard_liftovervcf -c tests/config/nextflow.config
|
||||
tags:
|
||||
- picard/liftovervcf
|
||||
- picard
|
||||
files:
|
||||
- path: output/picard/test.lifted.vcf.gz
|
||||
contains:
|
||||
- "chr22"
|
||||
- path: output/picard/test.unlifted.vcf.gz
|
||||
- path: output/picard/versions.yml
|
Loading…
Reference in a new issue