Skip to content

Commit

Permalink
Merge branch 'master' into malt_update
Browse files Browse the repository at this point in the history
  • Loading branch information
jfy133 authored Nov 21, 2024
2 parents 86662ce + 2d20463 commit 5818510
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 65 deletions.
1 change: 0 additions & 1 deletion modules/nf-core/bowtie2/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ process BOWTIE2_ALIGN {
} else {
create_unmapped = save_unaligned ? "touch ${prefix}.unmapped_1.fastq.gz && touch ${prefix}.unmapped_2.fastq.gz" : ""
}
def reference = fasta && extension=="cram" ? "--reference ${fasta}" : ""
if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output"

def create_index = ""
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/bwa/index/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ process BWA_INDEX {
tuple val(meta), path(fasta)

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

when:
task.ext.when == null || task.ext.when
Expand Down
7 changes: 5 additions & 2 deletions modules/nf-core/bwa/index/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ output:
description: |
Groovy Map containing reference information.
e.g. [ id:'test', single_end:false ]
pattern: "*.{amb,ann,bwt,pac,sa}"
- bwa:
type: file
description: BWA genome index files
type: map
description: |
Groovy Map containing reference information.
e.g. [ id:'test', single_end:false ]
pattern: "*.{amb,ann,bwt,pac,sa}"
- versions:
- versions.yml:
Expand Down
2 changes: 0 additions & 2 deletions modules/nf-core/bwa/mem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ process BWA_MEM {
"""

stub:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def samtools_command = sort_bam ? 'sort' : 'view'
def extension = args2.contains("--output-fmt sam") ? "sam" :
args2.contains("--output-fmt cram") ? "cram":
sort_bam && args2.contains("-O cram")? "cram":
Expand Down
3 changes: 0 additions & 3 deletions modules/nf-core/bwamem2/mem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,11 @@ process BWAMEM2_MEM {

stub:

def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def samtools_command = sort_bam ? 'sort' : 'view'
def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/
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 create_index = ""
Expand Down
4 changes: 0 additions & 4 deletions modules/nf-core/dragmap/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ process DRAGMAP_ALIGN {
"""

stub:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def reads_command = meta.single_end ? "-1 $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
def samtools_command = sort_bam ? 'sort' : 'view'
def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/
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 create_index = ""
Expand Down
14 changes: 1 addition & 13 deletions modules/nf-core/gridss/gridss/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,5 @@
"nextflow": "24.04.2"
},
"timestamp": "2024-07-10T11:48:45.270441"
},
"human - bam - assembly": {
"content": [
[
"versions.yml:md5,139867df5d7eaf22a89ae574f08e8d80"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-09T14:13:21.550069"
}
}
}
1 change: 0 additions & 1 deletion modules/nf-core/md5sum/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ process MD5SUM {
}

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
if ( as_separate_files ) {
"""
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/samtools/coverage/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ process SAMTOOLS_COVERAGE {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.txt
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/samtools/flagstat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ process SAMTOOLS_FLAGSTAT {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
samtools \\
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/samtools/getrg/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ process SAMTOOLS_GETRG {

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
samtools \\
view \\
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/samtools/idxstats/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ process SAMTOOLS_IDXSTATS {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/samtools/import/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ process SAMTOOLS_IMPORT {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/samtools/mpileup/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ process SAMTOOLS_MPILEUP {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def intervals = intervals ? "-l ${intervals}" : ""
intervals = intervals ? "-l ${intervals}" : ""
"""
samtools mpileup \\
--fasta-ref $fasta \\
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/samtools/reheader/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ process SAMTOOLS_REHEADER {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bam
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/samtools/stats/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ process SAMTOOLS_STATS {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def reference = fasta ? "--reference ${fasta}" : ""
"""
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/samtools/view/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ process SAMTOOLS_VIEW {
input.getExtension()
if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"

def index = args.contains("--write-index") ? "touch ${prefix}.${file_type}.csi" : ""
index = args.contains("--write-index") ? "touch ${prefix}.${file_type}.csi" : ""

"""
touch ${prefix}.${file_type}
Expand Down
22 changes: 11 additions & 11 deletions subworkflows/nf-core/bcl_demultiplex/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ workflow BCL_DEMULTIPLEX {
// Split flowcells into separate channels containing run as tar and run as path
// https://nextflow.slack.com/archives/C02T98A23U7/p1650963988498929
ch_flowcell
.branch { meta, samplesheet, run ->
.branch { _meta, _samplesheet, run ->
tar: run.toString().endsWith(".tar.gz")
dir: true
}.set { ch_flowcells }
Expand Down Expand Up @@ -88,18 +88,18 @@ workflow BCL_DEMULTIPLEX {
line = line.substring(1)
// expected format is like:
// xx:yy:FLOWCELLID:LANE:... (seven fields)
fields = line.split(':')
def fields = line.split(':')
// CASAVA 1.8+ format, from https://support.illumina.com/help/BaseSpace_OLH_009008/Content/Source/Informatics/BS/FileFormat_FASTQ-files_swBS.htm
// "@<instrument>:<run number>:<flowcell ID>:<lane>:<tile>:<x-pos>:<y-pos>:<UMI> <read>:<is filtered>:<control number>:<index>"
sequencer_serial = fields[0]
run_nubmer = fields[1]
fcid = fields[2]
lane = fields[3]
index = fields[-1] =~ /[GATC+-]/ ? fields[-1] : ""
ID = [fcid, lane].join(".")
PU = [fcid, lane, index].findAll().join(".")
PL = "ILLUMINA"
SM = fastq.getSimpleName().toString() - ~/_S[0-9]+.*$/
//def sequencer_serial = fields[0]
//def run_nubmer = fields[1]
def fcid = fields[2]
def lane = fields[3]
def index = fields[-1] =~ /[GATC+-]/ ? fields[-1] : ""
def ID = [fcid, lane].join(".")
def PU = [fcid, lane, index].findAll().join(".")
def PL = "ILLUMINA"
def SM = fastq.getSimpleName().toString() - ~/_S[0-9]+.*$/
meta.readgroup = [
"ID": ID,
"SM": SM,
Expand Down
33 changes: 16 additions & 17 deletions subworkflows/nf-core/fastq_align_dna/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,36 @@ workflow FASTQ_ALIGN_DNA {
ch_versions = Channel.empty()

// Align fastq files to reference genome and (optionally) sort
switch (aligner) {
case 'bowtie2':
if (aligner == 'bowtie2') {
BOWTIE2_ALIGN(ch_reads, ch_aligner_index, ch_fasta, false, sort) // if aligner is bowtie2
ch_bam = ch_bam.mix(BOWTIE2_ALIGN.out.bam)
ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions)
break
case 'bwamem':
}
else if (aligner == 'bwamem'){
BWAMEM1_MEM (ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is bwa-mem
ch_bam = ch_bam.mix(BWAMEM1_MEM.out.bam)
ch_bam_index = ch_bam_index.mix(BWAMEM1_MEM.out.csi)
ch_versions = ch_versions.mix(BWAMEM1_MEM.out.versions)
break
case 'bwamem2':
}
else if (aligner == 'bwamem2'){
BWAMEM2_MEM (ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is bwa-mem2
ch_bam = ch_bam.mix(BWAMEM2_MEM.out.bam)
ch_versions = ch_versions.mix(BWAMEM2_MEM.out.versions)
break
case 'dragmap':
}
else if (aligner == 'dragmap'){
DRAGMAP_ALIGN(ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is dragmap
ch_bam = ch_bam.mix(DRAGMAP_ALIGN.out.bam)
ch_reports = ch_reports.mix(DRAGMAP_ALIGN.out.log)
ch_versions = ch_versions.mix(DRAGMAP_ALIGN.out.versions)
break
case 'snap':
SNAP_ALIGN (ch_reads, ch_aligner_index) // If aligner is snap
ch_bam = ch_bam.mix(SNAP_ALIGN.out.bam)
ch_bam_index.mix(SNAP_ALIGN.out.bai)
ch_versions = ch_versions.mix(SNAP_ALIGN.out.versions)
break
default:
error "Unknown aligner: ${aligner}"
}
else if (aligner == 'snap'){
SNAP_ALIGN (ch_reads, ch_aligner_index) // If aligner is snap
ch_bam = ch_bam.mix(SNAP_ALIGN.out.bam)
ch_bam_index.mix(SNAP_ALIGN.out.bai)
ch_versions = ch_versions.mix(SNAP_ALIGN.out.versions)
}
else {
error "Unknown aligner: ${aligner}"
}

emit:
Expand Down

0 comments on commit 5818510

Please sign in to comment.