Skip to content

Commit

Permalink
Merge branch 'dev' into release-3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peterk87 authored Jun 21, 2023
2 parents a07441c + 8f186d2 commit f2da3fa
Show file tree
Hide file tree
Showing 13 changed files with 154 additions and 324 deletions.
2 changes: 1 addition & 1 deletion conf/modules_illumina.config
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ process {
]
]
}
withName: 'CAT_FASTQ' {
withName: 'CAT_ILLUMINA_FASTQ' {
publishDir = [
[
path: { "${params.outdir}/fastq"},
Expand Down
6 changes: 0 additions & 6 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
"homePage": "https://github.com/CFIA-NCFAD/nf-flu",
"repos": {
"nf-core/modules": {
"blast/blastn": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"cat/fastq": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"custom/dumpsoftwareversions": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
Expand Down
6 changes: 3 additions & 3 deletions modules/local/blast_makeblastdb.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ process BLAST_MAKEBLASTDB {
tag "$fasta"
label 'process_low'

conda (params.enable_conda ? 'bioconda::blast=2.12.0' : null)
conda (params.enable_conda ? 'bioconda::blast=2.14.0' : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container 'https://depot.galaxyproject.org/singularity/blast:2.12.0--hf3cf87c_4'
container 'https://depot.galaxyproject.org/singularity/blast:2.14.0--h7d5a4b4_1'
} else {
container 'quay.io/biocontainers/blast:2.12.0--hf3cf87c_4'
container 'quay.io/biocontainers/blast:2.14.0--h7d5a4b4_1'
}

input:
Expand Down
39 changes: 39 additions & 0 deletions modules/local/blastn.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
process BLAST_BLASTN {
tag "$meta.id"
label 'process_high'

conda (params.enable_conda ? 'bioconda::blast=2.14.0' : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container 'https://depot.galaxyproject.org/singularity/blast:2.14.0--h7d5a4b4_1'
} else {
container 'quay.io/biocontainers/blast:2.14.0--h7d5a4b4_1'
}

input:
tuple val(meta), path(fasta)
path db

output:
tuple val(meta), path('*.blastn.txt'), emit: txt
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.id}"
"""
DB=`find -L ./ -name "*.ndb" | sed 's/.ndb//'`
blastn \\
-num_threads $task.cpus \\
-db \$DB \\
-query $fasta \\
$args \\
-out ${prefix}.blastn.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//')
END_VERSIONS
"""
}
102 changes: 102 additions & 0 deletions modules/local/cat_illumina_fastq.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// modified nf-core/modules CAT_FASTQ
// for paired end reads append 1:N:0:. or 2:N:0:. forward and reverse reads
// for compatability with IRMA assembly
process CAT_ILLUMINA_FASTQ {
tag "$meta.id"
label 'process_single'

conda (params.enable_conda ? "conda-forge::perl" : null)
// use BLAST container here since it has Perl and is required by other
// processes in the pipeline
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container 'https://depot.galaxyproject.org/singularity/blast:2.14.0--h7d5a4b4_1'
} else {
container 'quay.io/biocontainers/blast:2.14.0--h7d5a4b4_1'
}

input:
tuple val(meta), path(reads, stageAs: "input*/*")

output:
tuple val(meta), path("*.merged.fastq.gz"), emit: reads
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.id}"
def readList = reads instanceof List ? reads.collect{ it.toString() } : [reads.toString()]
def fqList = []
def fqgzList = []
readList.each {
if (it ==~ /^.*\.(fastq|fq)$/) {
fqList << it
} else if (it ==~ /^.*\.(fastq|fq)\.gz$/) {
fqgzList << it
}
}
if (meta.single_end) {
if (fqList.size >= 1 || fqgzList.size >= 1) {
"""
touch ${prefix}.merged.fastq.gz
if [[ ${fqList.size} > 0 ]]; then
cat ${readList.join(' ')} | gzip -ck >> ${prefix}.merged.fastq.gz
fi
if [[ ${fqgzList.size} > 0 ]]; then
cat ${readList.join(' ')} >> ${prefix}.merged.fastq.gz
fi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
"""
}
} else {
if (readList.size >= 2) {
def read1 = []
def read1gz = []
def read2 = []
def read2gz = []
fqList.eachWithIndex{ v, ix -> ( ix & 1 ? read2 : read1 ) << v }
fqgzList.eachWithIndex{ v, ix -> ( ix & 1 ? read2gz : read1gz ) << v }
"""
# append 1:N:0:. or 2:N:0:. to forward and reverse reads if "[12]:N:.*"
# not present in the FASTQ header for compatability with IRMA assembly
touch ${prefix}_1.merged.fastq.gz
touch ${prefix}_2.merged.fastq.gz
if [[ ${read1.size} > 0 ]]; then
cat ${read1.join(' ')} \\
| perl -ne 'if (\$_ =~ /^@.*/ && !(\$_ =~ /^@.* [12]:N:.*/)){ chomp \$_; print "\$_ 1:N:0:.\n"; } else { print "\$_"; }' \\
| gzip -ck \\
>> ${prefix}_1.merged.fastq.gz
fi
if [[ ${read1gz.size} > 0 ]]; then
zcat ${read1gz.join(' ')} \\
| perl -ne 'if (\$_ =~ /^@.*/ && !(\$_ =~ /^@.* [12]:N:.*/)){ chomp \$_; print "\$_ 1:N:0:.\n"; } else { print "\$_"; }' \\
| gzip -ck \\
>> ${prefix}_1.merged.fastq.gz
fi
if [[ ${read2.size} > 0 ]]; then
cat ${read2.join(' ')} \\
| perl -ne 'if (\$_ =~ /^@.*/ && !(\$_ =~ /^@.* [12]:N:.*/)){ chomp \$_; print "\$_ 2:N:0:.\n"; } else { print "\$_"; }' \\
| gzip -ck \\
>> ${prefix}_2.merged.fastq.gz
fi
if [[ ${read2gz.size} > 0 ]]; then
zcat ${read2gz.join(' ')} \\
| perl -ne 'if (\$_ =~ /^@.*/ && !(\$_ =~ /^@.* [12]:N:.*/)){ chomp \$_; print "\$_ 2:N:0:.\n"; } else { print "\$_"; }' \\
| gzip -ck \\
>> ${prefix}_2.merged.fastq.gz
fi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
"""
}
}
}
68 changes: 0 additions & 68 deletions modules/nf-core/modules/blast/blastn/functions.nf

This file was deleted.

37 changes: 0 additions & 37 deletions modules/nf-core/modules/blast/blastn/main.nf

This file was deleted.

41 changes: 0 additions & 41 deletions modules/nf-core/modules/blast/blastn/meta.yml

This file was deleted.

68 changes: 0 additions & 68 deletions modules/nf-core/modules/cat/fastq/functions.nf

This file was deleted.

Loading

0 comments on commit f2da3fa

Please sign in to comment.