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

Remove langage server warnings #6937

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions modules/nf-core/bcftools/mpileup/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ process BCFTOOLS_MPILEUP {
def args2 = task.ext.args2 ?: ''
def args3 = task.ext.args3 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def mpileup = save_mpileup ? "| tee ${prefix}.mpileup" : ""
def bgzip_mpileup = save_mpileup ? "bgzip ${prefix}.mpileup" : ""
def intervals = intervals ? "-T ${intervals}" : ""
def mpileup_command = save_mpileup ? "| tee ${prefix}.mpileup" : ""
def bgzip_command = save_mpileup ? "bgzip ${prefix}.mpileup" : ""
def intervals_command = intervals ? "-T ${intervals}" : ""
"""
echo "${meta.id}" > sample_name.list

Expand All @@ -38,13 +38,13 @@ process BCFTOOLS_MPILEUP {
--fasta-ref $fasta \\
$args \\
$bam \\
$intervals \\
$mpileup \\
$intervals_command \\
$mpileup_command \\
| bcftools call --output-type v $args2 \\
| bcftools reheader --samples sample_name.list \\
| bcftools view --output-file ${prefix}.vcf.gz --output-type z $args3

$bgzip_mpileup
$bgzip_command

tabix -p vcf -f ${prefix}.vcf.gz

Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/bwa/index/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ process BWA_INDEX {

output:
tuple val(meta), path("bwa") , emit: index
path "versions.yml" , emit: versions
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down
49 changes: 27 additions & 22 deletions modules/nf-core/bwamem2/mem/main.nf
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
process BWAMEM2_MEM {
tag "$meta.id"
tag "${meta.id}"
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2d15960ccea84e249a150b7f5d4db3a42fc2d6c3-0' :
'biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2d15960ccea84e249a150b7f5d4db3a42fc2d6c3-0' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2d15960ccea84e249a150b7f5d4db3a42fc2d6c3-0'
: 'biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2d15960ccea84e249a150b7f5d4db3a42fc2d6c3-0'}"

input:
tuple val(meta), path(reads)
tuple val(meta2), path(index)
tuple val(meta3), path(fasta)
val sort_bam
val sort_bam

output:
tuple val(meta), path("*.sam") , emit: sam , optional:true
tuple val(meta), path("*.bam") , emit: bam , optional:true
tuple val(meta), path("*.cram") , emit: cram, optional:true
tuple val(meta), path("*.crai") , emit: crai, optional:true
tuple val(meta), path("*.csi") , emit: csi , optional:true
path "versions.yml" , emit: versions
tuple val(meta), path("*.sam"), emit: sam, optional: true
tuple val(meta), path("*.bam"), emit: bam, optional: true
tuple val(meta), path("*.cram"), emit: cram, optional: true
tuple val(meta), path("*.crai"), emit: crai, optional: true
tuple val(meta), path("*.csi"), emit: csi, optional: true
Comment on lines +16 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this gone all wibbly-wobbly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to turn on the Harshil Alignment in the settings. I'll make a PR for the workspace.

path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -31,21 +30,23 @@ process BWAMEM2_MEM {
def samtools_command = sort_bam ? 'sort' : 'view'

def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/
def extension_matcher = (args2 =~ extension_pattern)
def extension_matcher = (args2 =~ extension_pattern)
def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam"
def reference = fasta && extension=="cram" ? "--reference ${fasta}" : ""
if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output"
def reference = fasta && extension == "cram" ? "--reference ${fasta}" : ""
if (!fasta && extension == "cram") {
error("Fasta reference is required for CRAM output")
}

"""
INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'`

bwa-mem2 \\
mem \\
$args \\
-t $task.cpus \\
${args} \\
-t ${task.cpus} \\
\$INDEX \\
$reads \\
| samtools $samtools_command $args2 -@ $task.cpus ${reference} -o ${prefix}.${extension} -
${reads} \\
| samtools ${samtools_command} ${args2} -@ ${task.cpus} ${reference} -o ${prefix}.${extension} -

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -59,14 +60,18 @@ process BWAMEM2_MEM {
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/
def extension_matcher = (args2 =~ extension_pattern)
def extension_matcher = (args2 =~ extension_pattern)
def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam"
if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output"

if (!fasta && extension == "cram") {
error("Fasta reference is required for CRAM output")
}

def create_index = ""
if (extension == "cram") {
create_index = "touch ${prefix}.crai"
} else if (extension == "bam") {
}
else if (extension == "bam") {
create_index = "touch ${prefix}.csi"
}

Expand Down
Loading