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

Linting upgrade #16

Merged
merged 19 commits into from
Sep 29, 2023
Merged
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
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ indent_style = space

[*.{md,yml,yaml,cff}]
indent_size = 2

[*.{cm,dmnd}]
charset = utf-8
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_size = unset
indent_style = unset
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// currently outputs the CSV only with outfmt = 10
process BLASTP {
process BLAST_BLASTP {
tag "$meta.id"
label 'process_medium'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "blastp"
name: "blast_blastp"
description: BLASTP (Basic Local Alignment Search Tool- Protein) compares an amino acid (protein) query sequence against a protein database
keywords:
- protein alignment
- functional annotation
- evolutionary analysis
tools:
- "blastp":
- "blast_blastp":
description: "BLASTP (Basic Local Alignment Search Tool- Protein) compares an amino acid (protein) query sequence against a protein database"
homepage: "https://blast.ncbi.nlm.nih.gov/Blast.cgi"
documentation: "https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs"
Expand Down
33 changes: 33 additions & 0 deletions modules/ebi-metagenomics/blast/makeblastdb/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
process BLAST_MAKEBLASTDB {
tag "$fasta"
label 'process_medium'

conda "bioconda::blast=2.13.0"
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' }"

input:
path fasta

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

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
"""
makeblastdb \\
-in $fasta \\
$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
"""
}
31 changes: 31 additions & 0 deletions modules/ebi-metagenomics/blast/makeblastdb/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: blast_makeblastdb
description: Builds a BLAST database
keywords:
- fasta
- blast
- database
tools:
- blast:
description: |
BLAST finds regions of similarity between biological sequences.
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:
- fasta:
type: file
description: Input fasta file
pattern: "*.{fa,fasta}"
output:
- db:
type: directory
description: Output directory containing blast database files
pattern: "*"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@joseespinosa"
- "@drpatelh"
12 changes: 7 additions & 5 deletions modules/ebi-metagenomics/bmtagger/bmtagger/main.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
process BMTAGGER {
process BMTAGGER_BMTAGGER {

tag "$meta.id"

label 'process_low'

debug true

conda "bioconda::bmtagger=3.101"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bmtagger:3.101--h470a237_4':
Expand All @@ -17,8 +19,8 @@ process BMTAGGER {
val output_file

output:
tuple val(meta), path("${output_file}") , emit: output_host
path "versions.yml" , emit: versions
tuple val(meta), path("${output_file}"), emit: output_host
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -32,7 +34,7 @@ process BMTAGGER {
} else if (input_format == 'fastq') {
args += ' -q1 '
} else {
print('unknown format')
error "Invalid format: ${input_format}"
}

if (meta.single_end) {
Expand Down Expand Up @@ -65,7 +67,7 @@ process BMTAGGER {

cat <<-END_VERSIONS > versions.yml
"${task.process}":
bmtagger: \$(bmtagger.sh -hV | grep 'version' )
bmtagger: \$(bmtagger.sh -hV 2>1 | grep version | grep -Eo '[0-9.]+')
END_VERSIONS
"""
}
6 changes: 3 additions & 3 deletions modules/ebi-metagenomics/bmtagger/bmtagger/meta.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: "bmtagger"
name: "bmtagger_bmtagger"
description: Bmtagger tools
keywords:
- decontamination
- host
- reference_genome
tools:
- "bmtagger":
- "bmtagger_bmtagger":
description: "Best Match Tagger for removing human reads from metagenomics datasets"
homepage: "https://bioconda-recipes-demo.readthedocs.io/en/docs/recipes/bmtagger/README.html"
documentation: "https://ftp.ncbi.nlm.nih.gov/pub/agarwala/bmtagger/README.bmtagger.txt"
Expand All @@ -19,7 +19,7 @@ input:
e.g. `[ id:'test', single_end:false ]`

- input:
type: list
type: file
description: fasta or fastq files
pattern: "*.{fa,fq,fasta,fastq}"

Expand Down
50 changes: 0 additions & 50 deletions modules/ebi-metagenomics/bmtagger/index_reference/main.nf

This file was deleted.

67 changes: 67 additions & 0 deletions modules/ebi-metagenomics/bmtagger/indexreference/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
process BMTAGGER_INDEXREFERENCE {
tag "${reference_fasta}"
label 'process_low'

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

input:
path(reference_fasta)

output:
path("${reference_fasta.simpleName}.bitmask") , emit: bitmask
path("${reference_fasta.simpleName}.srprism.*"), emit: srprism
path("${reference_fasta.simpleName}.n*") , emit: blast_db
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args_bmtool = task.ext.args_bmtool ?: '-A 0 -w 18'
def args_srprism = task.ext.args_srprism ?: '-M 7168'
def args_makeblastdb = task.ext.args_makeblastdb ?: '-dbtype nucl'
"""
bmtool -d ${reference_fasta} -o ${reference_fasta.simpleName}.bitmask ${args_bmtool}
srprism mkindex -i ${reference_fasta} -o ${reference_fasta.simpleName}.srprism ${args_srprism}
makeblastdb -in ${reference_fasta} ${args_makeblastdb}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
bmtool: \$(bmtool --version | tr ' ' '\\t' | cut -f2)
srprism: \$(srprism 2>&1 | grep version | sed 's/^.*version //; s/ .*\$//')
makeblastdb: \$(makeblastdb -version 2>&1 | sed 's/^.*makeblastdb: //; s/ .*\$//')
END_VERSIONS
"""

stub:
"""
touch ${reference_fasta.simpleName}.bitmask
touch ${reference_fasta.simpleName}.srprism.idx
touch ${reference_fasta.simpleName}.srprism.amp
touch ${reference_fasta.simpleName}.srprism.idx
touch ${reference_fasta.simpleName}.srprism.imp
touch ${reference_fasta.simpleName}.srprism.map
touch ${reference_fasta.simpleName}.srprism.pmp
touch ${reference_fasta.simpleName}.srprism.rmp
touch ${reference_fasta.simpleName}.srprism.ss
touch ${reference_fasta.simpleName}.srprism.ssa
touch ${reference_fasta.simpleName}.srprism.ssd
touch ${reference_fasta.simpleName}.nsq
touch ${reference_fasta.simpleName}.nhr
touch ${reference_fasta.simpleName}.nhr
touch ${reference_fasta.simpleName}.nin
touch ${reference_fasta.simpleName}.nin
touch ${reference_fasta.simpleName}.nsq
touch ${reference_fasta.simpleName}.nsq

cat <<-END_VERSIONS > versions.yml
"${task.process}":
bmtool: \$(bmtool --version | tr ' ' '\\t' | cut -f2)
srprism: \$(srprism 2>&1 | grep version | sed 's/^.*version //; s/ .*\$//')
makeblastdb: \$(makeblastdb -version 2>&1 | sed 's/^.*makeblastdb: //; s/ .*\$//')
END_VERSIONS
"""
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
name: "index_reference"
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "bmtagger_indexreference"
description: Create indexed reference DB for bmtagger
keywords:
- reference
- index
- fasta
tools:
- "bmtool":
description: "Tool from bmtagger to create a bitmask file for the reference genome"
Expand All @@ -15,7 +17,7 @@ tools:
documentation: "https://ftp.ncbi.nlm.nih.gov/pub/agarwala/bmtagger/README.bmtagger.txt"
- "makeblastdb":
description: "Tool from blast to index reference genome"
homepage: " ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/LATEST/"
homepage: "https://blast.ncbi.nlm.nih.gov/Blast.cgi"

input:
- reference_fasta:
Expand Down Expand Up @@ -46,3 +48,4 @@ output:

authors:
- "@KateSakharova"
- "@vagkaratzas"
9 changes: 9 additions & 0 deletions modules/ebi-metagenomics/combinedgenecaller/merge/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.9-slim

WORKDIR /combined_gene_caller

COPY . .

RUN pip install --no-cache .

CMD [ "combined_gene_caller" ]
21 changes: 21 additions & 0 deletions modules/ebi-metagenomics/fetchtool/assembly/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.9-slim

LABEL maintainer="Microbiome Informatics"
LABEL version="0.9.0"
LABEL description="EBI Fetch Tool Docker Image."

# We need curl to download aspera and ps for nextflow monitoring
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y curl procps && rm -rf /var/lib/apt/lists/*

COPY . .

RUN pip install --no-cache-dir .

# Aspera is an IBM library for data sharing
RUN ./install-aspera.sh

RUN export PATH=$PATH:/aspera-cli/cli/bin

CMD [ fetch-read-tool ]
3 changes: 0 additions & 3 deletions modules/ebi-metagenomics/prodigal/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// This module is a verbatim copy of https://github.com/nf-core/modules/blob/master/modules/nf-core/prodigal/main.nf
// I've copied this as I still have to figure out how to handle nf-core/subworkflows that have dependencies from > 1
// nf-core repo.
process PRODIGAL {
tag "$meta.id"
label 'process_single'
Expand Down
1 change: 0 additions & 1 deletion subworkflows/ebi-metagenomics/combined_gene_caller/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ workflow COMBINED_GENE_CALLER {
ffn = COMBINEDGENECALLER_MERGE.out.ffn // channel: [ val(meta), [ ffn ] ]
versions = ch_versions // channel: [ versions.yml ]
}

18 changes: 15 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
blastp:
- modules/ebi-metagenomics/blastp/**
- tests/modules/ebi-metagenomics/blastp/**
blast/makeblastdb:
- modules/ebi-metagenomics/blast/makeblastdb/**
- tests/modules/ebi-metagenomics/blast/makeblastdb/**

blast/blastp:
- modules/ebi-metagenomics/blast/blastp/**
- tests/modules/ebi-metagenomics/blast/blastp/**

bmtagger/bmtagger:
- modules/ebi-metagenomics/bmtagger/bmtagger/**
- tests/modules/ebi-metagenomics/bmtagger/bmtagger/**

bmtagger/indexreference:
- modules/ebi-metagenomics/bmtagger/indexreference/**
- tests/modules/ebi-metagenomics/bmtagger/indexreference/**

cmsearchtbloutdeoverlap:
- modules/ebi-metagenomics/cmsearchtbloutdeoverlap/**
- tests/modules/ebi-metagenomics/cmsearchtbloutdeoverlap/**
Expand Down Expand Up @@ -34,6 +42,10 @@ infernal/cmsearch:
- modules/ebi-metagenomics/infernal/cmsearch/**
- tests/modules/ebi-metagenomics/infernal/cmsearch/**

prodigal:
- modules/ebi-metagenomics/prodigal/**
- tests/modules/ebi-metagenomics/prodigal/**

seqtk/seq:
- modules/ebi-metagenomics/seqtk/seq/**
- tests/modules/ebi-metagenomics/seqtk/seq/**
Expand Down
Loading
Loading