Skip to content

Commit

Permalink
Merge pull request #47 from nf-core/16-add-survivor-merge
Browse files Browse the repository at this point in the history
16 add survivor merge
  • Loading branch information
kubranarci authored Jun 7, 2024
2 parents cfd9c07 + 1691c3e commit ef29e34
Show file tree
Hide file tree
Showing 18 changed files with 628 additions and 4 deletions.
26 changes: 24 additions & 2 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ process {
ext.when = { params.method.split(',').contains('svanalyzer') }
publishDir = [
path: {"${params.outdir}/${meta.id}/svanalyzer_bench"},
pattern: "*{.vcf,distances,log,report}",
pattern: "*{.vcf.gz,tbi,distances,log,report}",
mode: params.publish_dir_mode
]
}
Expand Down Expand Up @@ -242,7 +242,7 @@ process {
withName: MERGE_REPORTS {
ext.prefix = {"${meta.benchmark_tool}.${meta.vartype}"}
publishDir = [
path: {"${params.outdir}/summary"},
path: {"${params.outdir}/summary/tables"},
pattern: "*{txt}",
mode: params.publish_dir_mode
]
Expand All @@ -255,6 +255,28 @@ process {
mode: params.publish_dir_mode
]
}

withName: TABIX_BGZIP_BENCH{
ext.prefix = {input.toString() - ".vcf.gz"}
}

withName: SURVIVOR_MERGE {
ext.prefix = {"${meta.id}.${meta.vartype}.${meta.tag}"}
publishDir = [
path: {"${params.outdir}/summary/merged_vcf"},
pattern: "*{vcf}",
mode: params.publish_dir_mode
]
}
withName: BCFTOOLS_QUERY {
ext.prefix = {"${meta.id}.${meta.vartype}.${meta.tag}"}
ext.args = {"-f '%CHROM\t%POS\t%INFO/SVTYPE\t%INFO/SVLEN\t%INFO/SUPP_VEC\t%INFO/SUPP\t%ID[\t%SAMPLE]'" }
publishDir = [
path: {"${params.outdir}/summary/merged_vcf"},
pattern: "*{.txt}",
mode: params.publish_dir_mode
]
}
}
//
// Don't publish results for these processes
Expand Down
2 changes: 1 addition & 1 deletion conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ params {

// Processes
analysis = 'germline'
method = 'rtgtools,happy,truvari,svanalyzer' //
method = 'happy,truvari,svanalyzer' //
similarity = 0
preprocess = "normalization,deduplication,prepy"
//variant_filtering = "include" // null, include, exclude
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09",
"installed_by": ["modules"]
},
"bcftools/query": {
"branch": "master",
"git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f",
"installed_by": ["modules"]
},
"bcftools/reheader": {
"branch": "master",
"git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09",
Expand Down Expand Up @@ -75,6 +80,11 @@
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
},
"survivor/merge": {
"branch": "master",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
},
"survivor/stats": {
"branch": "master",
"git_sha": "398375d72766cac92c4ffcf6927cac2d65310cfd",
Expand Down
7 changes: 7 additions & 0 deletions modules/local/visualize_tagged/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: plots
channels:
- conda-forge
dependencies:
- r-base=4.1.*
- r-ggplot2=3.3.*
- r-reshape2=1.4.*
43 changes: 43 additions & 0 deletions modules/local/visualize_tagged/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
process VISUALIZE_TAGGED {
tag "$meta.benchmark_tool"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.4--r43hdfd78af_0':
'biocontainers/r-shinyngs:1.8.4--r43hdfd78af_0' }"

input:
tuple val(meta), path(vcf)

output:
tuple val(meta),path("*.txt"), emit: plots
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.benchmark_tool}"

"""
grep -o 'SUPP_VEC=[^,;]*' $vcf | awk -F'=' '{print \$2}' | sed -e 's/\\(.\\)/\\1 /g' > ${vcf}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
END_VERSIONS
"""
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.benchmark_tool}"
"""
touch ${vcf}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
END_VERSIONS
"""
}
7 changes: 7 additions & 0 deletions modules/nf-core/bcftools/query/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions modules/nf-core/bcftools/query/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions modules/nf-core/bcftools/query/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 101 additions & 0 deletions modules/nf-core/bcftools/query/tests/main.nf.test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ef29e34

Please sign in to comment.