Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nextflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
nextflow
Commits
2e4cc629
Verified
Commit
2e4cc629
authored
Jun 22, 2021
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
gatk4: change file_prefix definition to handle Map
parent
d42ded32
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nf_modules/gatk4/main.nf
+36
-100
36 additions, 100 deletions
src/nf_modules/gatk4/main.nf
with
36 additions
and
100 deletions
src/nf_modules/gatk4/main.nf
+
36
−
100
View file @
2e4cc629
version
=
"4.2.0.0"
version
=
"4.2.0.0"
container_url
=
"broadinstitute/gatk:${version}"
container_url
=
"broadinstitute/gatk:${version}"
def
get_file_prefix
(
file_id
)
{
if
(
file_id
instanceof
List
){
file_prefix
=
file_id
[
0
]
}
else
if
(
file_id
instanceof
Map
)
{
library
=
file_id
[
0
]
file_prefix
=
file_id
[
0
]
if
(
file_id
.
containsKey
(
'library'
))
{
library
=
file_id
.
library
file_prefix
=
file_id
.
id
}
}
else
{
file_prefix
=
file_id
}
return
file_prefix
}
include
{
include
{
index_fasta
as
samtools_index_fasta
;
index_fasta
as
samtools_index_fasta
;
}
from
'./../samtools/main.nf'
}
from
'./../samtools/main.nf'
...
@@ -76,11 +92,7 @@ process index_vcf {
...
@@ -76,11 +92,7 @@ process index_vcf {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" IndexFeatureFile \
gatk --java-options "-Xmx${xmx_memory}G" IndexFeatureFile \
-I ${vcf}
-I ${vcf}
...
@@ -100,11 +112,7 @@ process compute_base_recalibration {
...
@@ -100,11 +112,7 @@ process compute_base_recalibration {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
def
vcf_cmd
=
""
def
vcf_cmd
=
""
if
(
vcf
instanceof
List
){
if
(
vcf
instanceof
List
){
for
(
vcf_file
in
vcf
){
for
(
vcf_file
in
vcf
){
...
@@ -135,11 +143,7 @@ process apply_base_recalibration {
...
@@ -135,11 +143,7 @@ process apply_base_recalibration {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" ApplyBQSR \
gatk --java-options "-Xmx${xmx_memory}G" ApplyBQSR \
-R ${fasta} \
-R ${fasta} \
...
@@ -163,11 +167,7 @@ process call_variants_per_sample {
...
@@ -163,11 +167,7 @@ process call_variants_per_sample {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" HaplotypeCaller \
gatk --java-options "-Xmx${xmx_memory}G" HaplotypeCaller \
-R ${fasta} \
-R ${fasta} \
...
@@ -215,11 +215,7 @@ process index_gvcf {
...
@@ -215,11 +215,7 @@ process index_gvcf {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" IndexFeatureFile \
gatk --java-options "-Xmx${xmx_memory}G" IndexFeatureFile \
-I ${gvcf} 2> ${gvcf.simpleName}_IndexFeatureFile_report.txt
-I ${gvcf} 2> ${gvcf.simpleName}_IndexFeatureFile_report.txt
...
@@ -238,11 +234,7 @@ process validate_gvcf {
...
@@ -238,11 +234,7 @@ process validate_gvcf {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" ValidateVariants \
gatk --java-options "-Xmx${xmx_memory}G" ValidateVariants \
-V ${gvcf} \
-V ${gvcf} \
...
@@ -263,11 +255,7 @@ process consolidate_gvcf {
...
@@ -263,11 +255,7 @@ process consolidate_gvcf {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
def
gvcf_cmd
=
""
def
gvcf_cmd
=
""
if
(
gvcf
instanceof
List
){
if
(
gvcf
instanceof
List
){
for
(
gvcf_file
in
gvcf
){
for
(
gvcf_file
in
gvcf
){
...
@@ -302,11 +290,7 @@ process genomic_db_call {
...
@@ -302,11 +290,7 @@ process genomic_db_call {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
def
gvcf_cmd
=
""
def
gvcf_cmd
=
""
if
(
gvcf
instanceof
List
){
if
(
gvcf
instanceof
List
){
for
(
gvcf_file
in
gvcf
){
for
(
gvcf_file
in
gvcf
){
...
@@ -343,11 +327,7 @@ process variant_calling {
...
@@ -343,11 +327,7 @@ process variant_calling {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" HaplotypeCaller \
gatk --java-options "-Xmx${xmx_memory}G" HaplotypeCaller \
${params.variant_calling} \
${params.variant_calling} \
...
@@ -374,11 +354,7 @@ process filter_snp {
...
@@ -374,11 +354,7 @@ process filter_snp {
tuple
val
(
file_id
),
path
(
"*_snp.vcf"
),
emit:
vcf
tuple
val
(
file_id
),
path
(
"*_snp.vcf"
),
emit:
vcf
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" SelectVariants \
gatk --java-options "-Xmx${xmx_memory}G" SelectVariants \
${params.filter_snp} \
${params.filter_snp} \
...
@@ -406,11 +382,7 @@ process filter_indels {
...
@@ -406,11 +382,7 @@ process filter_indels {
tuple
val
(
file_id
),
path
(
"*_indel.vcf"
),
emit:
vcf
tuple
val
(
file_id
),
path
(
"*_indel.vcf"
),
emit:
vcf
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" SelectVariants \
gatk --java-options "-Xmx${xmx_memory}G" SelectVariants \
${params.filter_indels} \
${params.filter_indels} \
...
@@ -439,11 +411,7 @@ process high_confidence_snp {
...
@@ -439,11 +411,7 @@ process high_confidence_snp {
tuple
val
(
file_id
),
path
(
"*_snp.vcf"
),
emit:
vcf
tuple
val
(
file_id
),
path
(
"*_snp.vcf"
),
emit:
vcf
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" VariantFiltration \
gatk --java-options "-Xmx${xmx_memory}G" VariantFiltration \
-R ${fasta} \
-R ${fasta} \
...
@@ -471,11 +439,7 @@ process high_confidence_indels {
...
@@ -471,11 +439,7 @@ process high_confidence_indels {
tuple
val
(
file_id
),
path
(
"*_indel.vcf"
),
emit:
vcf
tuple
val
(
file_id
),
path
(
"*_indel.vcf"
),
emit:
vcf
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" VariantFiltration \
gatk --java-options "-Xmx${xmx_memory}G" VariantFiltration \
-R ${fasta} \
-R ${fasta} \
...
@@ -502,11 +466,7 @@ process recalibrate_snp_table {
...
@@ -502,11 +466,7 @@ process recalibrate_snp_table {
tuple
val
(
file_id
),
path
(
"recal_data_table"
),
emit:
recal_table
tuple
val
(
file_id
),
path
(
"recal_data_table"
),
emit:
recal_table
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" IndexFeatureFile \
gatk --java-options "-Xmx${xmx_memory}G" IndexFeatureFile \
-I ${snp_file}
-I ${snp_file}
...
@@ -539,11 +499,7 @@ process recalibrate_snp {
...
@@ -539,11 +499,7 @@ process recalibrate_snp {
tuple
val
(
file_id
),
path
(
"*.bam"
),
emit:
bam
tuple
val
(
file_id
),
path
(
"*.bam"
),
emit:
bam
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" ApplyBQSR \
gatk --java-options "-Xmx${xmx_memory}G" ApplyBQSR \
${params.recalibrate_snp} \
${params.recalibrate_snp} \
...
@@ -571,11 +527,7 @@ process haplotype_caller {
...
@@ -571,11 +527,7 @@ process haplotype_caller {
tuple
val
(
file_id
),
path
(
"*.gvcf"
),
emit:
gvcf
tuple
val
(
file_id
),
path
(
"*.gvcf"
),
emit:
gvcf
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" HaplotypeCaller \
gatk --java-options "-Xmx${xmx_memory}G" HaplotypeCaller \
${params.haplotype_caller} \
${params.haplotype_caller} \
...
@@ -603,11 +555,7 @@ process gvcf_genotyping {
...
@@ -603,11 +555,7 @@ process gvcf_genotyping {
tuple
val
(
file_id
),
path
(
"*.vcf.gz"
),
emit:
vcf
tuple
val
(
file_id
),
path
(
"*.vcf.gz"
),
emit:
vcf
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" GenotypeGVCFs \
gatk --java-options "-Xmx${xmx_memory}G" GenotypeGVCFs \
${params.gvcf_genotyping} \
${params.gvcf_genotyping} \
...
@@ -634,11 +582,7 @@ process select_variants_snp {
...
@@ -634,11 +582,7 @@ process select_variants_snp {
tuple
val
(
file_id
),
path
(
"*_joint_snp.vcf"
),
emit:
vcf
tuple
val
(
file_id
),
path
(
"*_joint_snp.vcf"
),
emit:
vcf
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}GG" SelectVariants \
gatk --java-options "-Xmx${xmx_memory}GG" SelectVariants \
${params.select_variants_snp} \
${params.select_variants_snp} \
...
@@ -666,11 +610,7 @@ process select_variants_indels {
...
@@ -666,11 +610,7 @@ process select_variants_indels {
tuple
val
(
file_id
),
path
(
"*_joint_indel.vcf"
),
emit:
vcf
tuple
val
(
file_id
),
path
(
"*_joint_indel.vcf"
),
emit:
vcf
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" SelectVariants \
gatk --java-options "-Xmx${xmx_memory}G" SelectVariants \
${params.select_variants_indels} \
${params.select_variants_indels} \
...
@@ -699,11 +639,7 @@ process personalized_genome {
...
@@ -699,11 +639,7 @@ process personalized_genome {
script:
script:
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
xmx_memory
=
"${task.memory}"
-
~
/\s*GB/
if
(
file_id
instanceof
List
){
file_prefix
=
get_file_prefix
(
file_id
)
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
}
"""
"""
gatk --java-options "-Xmx${xmx_memory}G" FastaAlternateReferenceMaker\
gatk --java-options "-Xmx${xmx_memory}G" FastaAlternateReferenceMaker\
${params.personalized_genome} \
${params.personalized_genome} \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment