Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nf-core/modules
Browse files Browse the repository at this point in the history
  • Loading branch information
WackerO committed Oct 2, 2023
2 parents af21f19 + 0aca984 commit 1e233cf
Show file tree
Hide file tree
Showing 84 changed files with 1,936 additions and 300 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ concurrency:
env:
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
prettier:
Expand Down Expand Up @@ -59,6 +60,7 @@ jobs:
id: filter
with:
filters: "tests/config/pytest_modules.yml"
token: "${{ secrets.GITHUB_TOKEN }}"

nf-core-lint:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -367,6 +369,7 @@ jobs:
id: filter
with:
filters: "tests/config/nftest_modules.yml"
token: "${{ secrets.GITHUB_TOKEN }}"

nf-test:
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/amrfinderplus/run/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ process AMRFINDERPLUS_RUN {
script:
def args = task.ext.args ?: ''
def is_compressed_fasta = fasta.getName().endsWith(".gz") ? true : false
def is_compressed_db = fasta.getName().endsWith(".gz") ? true : false
def is_compressed_db = db.getName().endsWith(".gz") ? true : false
prefix = task.ext.prefix ?: "${meta.id}"
organism_param = meta.containsKey("organism") ? "--organism ${meta.organism} --mutation_all ${prefix}-mutations.tsv" : ""
fasta_name = fasta.getName().replace(".gz", "")
Expand Down
12 changes: 8 additions & 4 deletions modules/nf-core/bamcmp/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ process BAMCMP {
prefix = task.ext.prefix ?: "${meta.id}_primary"
prefix2 = task.ext.prefix2 ?: "${meta.id}_contaminant"

if ("$primary_aligned_bam" == "${prefix}.bam" | "$contaminant_aligned_bam" == "${prefix}.bam" )
if ("$primary_aligned_bam" == "${prefix}.bam" | "$contaminant_aligned_bam" == "${prefix}.bam" ) {
error "Input and output names for the primary-genome bam file are the same, use \"task.ext.prefix\" to disambiguate!"
if ("$primary_aligned_bam" == "${prefix2}.bam" | "$contaminant_aligned_bam" == "${prefix2}.bam" )
}
if ("$primary_aligned_bam" == "${prefix2}.bam" | "$contaminant_aligned_bam" == "${prefix2}.bam" ) {
error "Input and output names for the contaminant-genome bam file are the same, use \"task.ext.prefix2\" to disambiguate!"
if ("primary_aligned_bam" == "contaminant_aligned_bam" )
}
if ("primary_aligned_bam" == "contaminant_aligned_bam" ) {
error "Input file names for the two bam files are the same, ensure they are renamed upstream."
if ("${prefix}.bam" == "${prefix2}.bam" )
}
if ("${prefix}.bam" == "${prefix2}.bam" ) {
error "Output names for the two bam files are identical, use \"task.ext.prefix\" and \"task.ext.prefix2\" to disambiguate!"
}

def VERSION = '2.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
Expand Down
14 changes: 14 additions & 0 deletions modules/nf-core/bcftools/index/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,18 @@ process BCFTOOLS_INDEX {
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def extension = args.contains("--tsi") || args.contains("-t") ? "tbi" :
"csi"
"""
touch ${vcf}.${extension}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
}
25 changes: 19 additions & 6 deletions modules/nf-core/blast/blastn/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ process BLAST_BLASTN {
tag "$meta.id"
label 'process_medium'

conda "bioconda::blast=2.13.0"
conda "bioconda::blast=2.14.1"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/blast:2.13.0--hf3cf87c_0' :
'biocontainers/blast:2.13.0--hf3cf87c_0' }"
'https://depot.galaxyproject.org/singularity/blast:2.14.1--pl5321h6f7f691_0':
'biocontainers/blast:2.14.1--pl5321h6f7f691_0' }"

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

output:
tuple val(meta), path('*.blastn.txt'), emit: txt
path "versions.yml" , emit: versions
tuple val(meta), path('*.txt'), emit: txt
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -28,7 +28,20 @@ process BLAST_BLASTN {
-db \$DB \\
-query $fasta \\
$args \\
-out ${prefix}.blastn.txt
-out ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//')
Expand Down
3 changes: 2 additions & 1 deletion modules/nf-core/blast/blastn/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ output:
- txt:
type: file
description: File containing blastn hits
pattern: "*.{blastn.txt}"
pattern: "*.txt"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@joseespinosa"
- "@drpatelh"
- "@vagkaratzas"
57 changes: 57 additions & 0 deletions modules/nf-core/blast/blastp/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
process BLAST_BLASTP {
tag "$meta.id"
label 'process_medium'

conda "bioconda::blast=2.14.1"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/blast:2.14.1--pl5321h6f7f691_0':
'biocontainers/blast:2.14.1--pl5321h6f7f691_0' }"

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

output:
tuple val(meta), path("*.csv"), emit: csv
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 is_compressed = fasta.name.endsWith(".gz")
def fasta_name = fasta.name.replace(".gz", "")
"""
if [ "$is_compressed" == "true" ]; then
gzip -c -d $fasta > $fasta_name
fi
DB=`find -L ./ -name "*.phr" | sed 's/\\.phr\$//'`
blastp \\
-db \$DB \\
-query ${fasta_name} \\
-out ${prefix}.csv \\
-num_threads ${task.cpus} \\
-outfmt 10 \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(blastp -version 2>&1 | sed 's/^.*blastp: //; s/ .*\$//')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.csv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(blastp -version 2>&1 | sed 's/^.*blastp: //; s/ .*\$//')
END_VERSIONS
"""
}
52 changes: 52 additions & 0 deletions modules/nf-core/blast/blastp/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: "blast_blastp"
description: BLASTP (Basic Local Alignment Search Tool- Protein) compares an amino acid (protein) query sequence against a protein database
keywords:
- fasta
- blast
- blastp
- protein
tools:
- "blast":
description: "BLAST+ is a new suite of BLAST tools that utilizes the NCBI C++ Toolkit."
homepage: "https://blast.ncbi.nlm.nih.gov/Blast.cgi"
documentation: "https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs"
doi: "10.1016/S0022-2836(05)80360-2"
licence: "['US-Government-Work']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- fasta:
type: file
description: Input fasta file containing queries sequences
pattern: "*.{fa,fasta}"

- db:
type: directory
description: Directory containing blast database
pattern: "*"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

- csv:
type: file
description: File containing blastp hits
pattern: "*.csv"

authors:
- "@vagkaratzas"
32 changes: 27 additions & 5 deletions modules/nf-core/blast/makeblastdb/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ process BLAST_MAKEBLASTDB {
tag "$fasta"
label 'process_medium'

conda "bioconda::blast=2.13.0"
conda "bioconda::blast=2.14.1"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/blast:2.13.0--hf3cf87c_0' :
'biocontainers/blast:2.13.0--hf3cf87c_0' }"
'https://depot.galaxyproject.org/singularity/blast:2.14.1--pl5321h6f7f691_0':
'biocontainers/blast:2.14.1--pl5321h6f7f691_0' }"

input:
path fasta

output:
path 'blast_db' , emit: db
path "versions.yml" , emit: versions
path 'blast_db' , emit: db
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -25,6 +25,28 @@ process BLAST_MAKEBLASTDB {
$args
mkdir blast_db
mv ${fasta}* blast_db
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
"""
touch ${fasta}.fasta
touch ${fasta}.fasta.ndb
touch ${fasta}.fasta.nhr
touch ${fasta}.fasta.nin
touch ${fasta}.fasta.njs
touch ${fasta}.fasta.not
touch ${fasta}.fasta.nsq
touch ${fasta}.fasta.ntf
touch ${fasta}.fasta.nto
mkdir blast_db
mv ${fasta}* blast_db
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(blastn -version 2>&1 | sed 's/^.*blastn: //; s/ .*\$//')
Expand Down
1 change: 1 addition & 0 deletions modules/nf-core/blast/makeblastdb/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ output:
authors:
- "@joseespinosa"
- "@drpatelh"
- "@vagkaratzas"
25 changes: 19 additions & 6 deletions modules/nf-core/blast/tblastn/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ process BLAST_TBLASTN {
tag "$meta.id"
label 'process_medium'

conda "bioconda::blast=2.13.0"
conda "bioconda::blast=2.14.1"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/blast:2.13.0--hf3cf87c_0' :
'biocontainers/blast:2.13.0--hf3cf87c_0' }"
'https://depot.galaxyproject.org/singularity/blast:2.14.1--pl5321h6f7f691_0':
'biocontainers/blast:2.14.1--pl5321h6f7f691_0' }"

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

output:
tuple val(meta), path('*.tblastn.txt') , emit: txt
path "versions.yml" , emit: versions
tuple val(meta), path('*.txt'), emit: txt
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -28,7 +28,20 @@ process BLAST_TBLASTN {
-db \$DB \\
-query $fasta \\
$args \\
-out ${prefix}.tblastn.txt
-out ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(tblastn -version 2>&1 | sed 's/^.*tblastn: //; s/ .*\$//')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blast: \$(tblastn -version 2>&1 | sed 's/^.*tblastn: //; s/ .*\$//')
Expand Down
3 changes: 2 additions & 1 deletion modules/nf-core/blast/tblastn/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ output:
- txt:
type: file
description: File containing blastn hits
pattern: "*.{tblastn.txt}"
pattern: "*.txt"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@yumisims"
- "@gq2"
- "@vagkaratzas"
Loading

0 comments on commit 1e233cf

Please sign in to comment.