Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lofreq somatic and callparallel #5931

Merged
merged 23 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions modules/nf-core/lofreq/callparallel/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ process LOFREQ_CALLPARALLEL {
'biocontainers/lofreq:2.1.5--py38h588ecb2_4' }"

input:
tuple val(meta), path(bam), path(bai), path(intervals)
tuple val(meta), path(tumor), path(tumor_index), path(intervals)
famosab marked this conversation as resolved.
Show resolved Hide resolved
path fasta
path fai

Expand All @@ -23,15 +23,25 @@ process LOFREQ_CALLPARALLEL {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def options_intervals = intervals ? "-l ${intervals}" : ""

def tumor_cram = tumor.Extension == "cram" ? true : false
def tumor_bam = tumor.Extension == "bam" ? true : false
def tumor_out = tumor_cram ? tumor.BaseName + ".bam" : "${tumor}"

def samtools_cram_convert = ''
SPPearce marked this conversation as resolved.
Show resolved Hide resolved
samtools_cram_convert += tumor_cram ? " samtools view -T $fasta $tumor -@ $task.cpus -o $tumor_out\n" : ''
samtools_cram_convert += tumor_cram ? " samtools index $tumor_out\n" : ''
"""
$samtools_cram_convert
SPPearce marked this conversation as resolved.
Show resolved Hide resolved

lofreq \\
call-parallel \\
--pp-threads $task.cpus \\
$args \\
$options_intervals \\
-f $fasta \\
-o ${prefix}.vcf.gz \\
$bam
$tumor_out

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
6 changes: 4 additions & 2 deletions modules/nf-core/lofreq/callparallel/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ input:
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- bam:
- tumor:
type: file
description: Sorted BAM file
famosab marked this conversation as resolved.
Show resolved Hide resolved
pattern: "*.{bam}"
- bai:
- tumor_index:
type: file
description: BAM index file
pattern: "*.{bai}"
famosab marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -58,3 +58,5 @@ authors:
maintainers:
- "@kaurravneet4123"
- "@bjohnnyd"
- "@nevinwu"
- "@AitorPeseta"
23 changes: 18 additions & 5 deletions modules/nf-core/lofreq/somatic/main.nf
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
process LOFREQ_SOMATIC {
tag "$meta.id"
label "process_high"
label 'process_high'

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

input:
tuple val(meta), path(tumor_bam), path(tumor_bai), path(normal_bam), path(normal_bai), path(target_bed)
tuple val(meta), path(tumor), path(tumor_index), path(normal), path(normal_index), path(target_bed)
tuple val(meta2), path(fasta)
tuple val(meta3), path(fai)

Expand All @@ -23,14 +22,28 @@ process LOFREQ_SOMATIC {
def args = task.ext.args ?: ""
def prefix = task.ext.prefix ?: "${meta.id}"
def options_target_bed = target_bed ? "-l ${target_bed}" : ""

def tumor_cram = tumor.Extension == "cram" ? true : false
def normal_cram = normal.Extension == "cram" ? true : false

def tumor_out = tumor_cram ? tumor.BaseName + ".bam" : "${tumor}"
def normal_out = normal_cram ? normal.BaseName + ".bam" : "${normal}"

def samtools_cram_convert = ''
samtools_cram_convert += normal_cram ? " samtools view -T $fasta $normal -@ $task.cpus -o $normal_out\n" : ''
samtools_cram_convert += normal_cram ? " samtools index $normal_out\n" : ''
samtools_cram_convert += tumor_cram ? " samtools view -T $fasta $tumor -@ $task.cpus -o $tumor_out\n" : ''
samtools_cram_convert += tumor_cram ? " samtools index $tumor_out\n" : ''
"""
$samtools_cram_convert

lofreq \\
somatic \\
--threads $task.cpus \\
$args \\
-f $fasta \\
-t $tumor_bam \\
-n $normal_bam \\
-t $tumor_out \\
-n $normal_out \\
${options_target_bed} \\
-o ${prefix}

Expand Down
11 changes: 6 additions & 5 deletions modules/nf-core/lofreq/somatic/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
homepage: https://csb5.github.io/lofreq/
documentation: https://csb5.github.io/lofreq/commands/
doi: 10.1093/nar/gks918
licence: "['MIT']"
licence: ["MIT"]
input:
- meta:
type: map
Expand All @@ -23,19 +23,19 @@ input:
- meta3:
type: map
description: Groovy Map containing reference information
- tumor_bam:
- tumor:
type: file
description: tumor sample input BAM file
pattern: "*.{bam}"
- tumor_bai:
- tumor_index:
type: file
description: tumor sample BAM index file
pattern: "*.{bai}"
famosab marked this conversation as resolved.
Show resolved Hide resolved
- normal_bam:
- normal:
type: file
description: normal sample input BAM file
pattern: "*.{bam}"
- normal_bai:
- normal_index:
type: file
description: normal sample BAM index file
pattern: "*.{bai}"
famosab marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -69,3 +69,4 @@ authors:
- "@nevinwu"
maintainers:
- "@nevinwu"
- "@AitorPeseta"
Loading