Skip to content
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
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ These are the most common things requested on pull requests (PRs).

Remember that PRs should be made against the dev branch, unless you're preparing a pipeline release.

Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/seqsubmit/tree/main/.github/CONTRIBUTING.md)
Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/seqsubmit/tree/master/.github/CONTRIBUTING.md)
-->

## PR checklist

- [ ] This comment contains a description of changes (with reason).
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/seqsubmit/tree/main/.github/CONTRIBUTING.md)
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/seqsubmit/tree/master/.github/CONTRIBUTING.md)
- [ ] If necessary, also make a PR on the nf-core/seqsubmit _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
- [ ] Make sure your code lints (`nf-core pipelines lint`).
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
Expand Down
3 changes: 3 additions & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ lint:
- params.input
files_unchanged:
- .github/PULL_REQUEST_TEMPLATE.md
- docs/images/nf-core-seqsubmit_logo_light.png
- docs/images/nf-core-seqsubmit_logo_dark.png
- assets/nf-core-seqsubmit_logo_light.png
nf_core_version: 3.5.1
repository_type: pipeline
template:
Expand Down
Binary file modified assets/nf-core-seqsubmit_logo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/samplesheet_genomes.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sample,fasta,accession,assembly_software,binning_software,binning_parameters,stats_generation_software,completeness,contamination,genome_coverage,metagenome,co-assembly,broad_environment,local_environment,environmental_medium,rRNA_presence,NCBI_lineage
sample,fasta,accession,fastq_1,fastq_2,assembly_software,binning_software,binning_parameters,stats_generation_software,completeness,contamination,genome_coverage,metagenome,co-assembly,broad_environment,local_environment,environmental_medium,rRNA_presence,NCBI_lineage
lachnospira_eligens,https://github.com/nf-core/test-datasets/raw/seqsubmit/test_data/bins/bin_lachnospira_eligens.fa.gz,SRR24458089,spades_v3.15.5,mags_v1,default,CheckM2_v1.0.1,61.0,0.21,32.07,sediment metagenome,False,marine,cable bacteria,marine sediment,False,d__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__Desulfobacterales;f__Desulfobulbaceae;g__Candidatus Electrothrix;s__
lachnospiraceae,https://github.com/nf-core/test-datasets/raw/seqsubmit/test_data/bins/bin_lachnospiraceae.fa.gz,SRR24458087,spades_v3.15.5,mags_v1,default,CheckM2_v1.0.1,92.81,1.09,66.04,sediment metagenome,False,marine,cable bacteria,marine sediment,False,d__Bacteria;p__Proteobacteria;c__Deltaproteobacteria;o__Desulfobacterales;f__Desulfobulbaceae;g__Candidatus Electrothrix;s__Candidatus Electrothrix marina
55 changes: 49 additions & 6 deletions assets/schema_input_genome.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,38 @@
"type": "string",
"description": "Run or assembly ENA accession"
},
"fastq_1": {
"anyOf": [
{
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.(fq|fastq)(\\.gz)?$"
},
{
"type": "string",
"maxLength": 0
}
],
"errorMessage": "FASTQ file must have extension '.fq' or '.fastq' (optionally gzipped)",
"description": "Forward reads if paired-end or single-end reads FASTQ file"
},
"fastq_2": {
"anyOf": [
{
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.(fq|fastq)(\\.gz)?$"
},
{
"type": "string",
"maxLength": 0
}
],
"errorMessage": "FASTQ file for reverse reads must have extension '.fq' or '.fastq' (optionally gzipped)",
"description": "Reverse reads FASTQ file if paired-end. Leave empty for single-end reads"
},
"assembly_software": {
"type": "string",
"description": "Tool name and version that was used to assemble data"
Expand Down Expand Up @@ -58,8 +90,8 @@
"description": "ENA accepted metagenome name"
},
"co-assembly": {
"type": "boolean",
"description": "True if data was co-assembled, False otherwise"
"type": "string",
"description": "Yes if data was co-assembled, No otherwise"
},
"broad_environment": {
"type": "string",
Expand All @@ -73,15 +105,26 @@
"type": "string",
"description": "material displaced by the sample"
},
"rRNA_presence": {
"type": "boolean",
"description": "True/False if rRNA genes detected"
"RNA_presence": {
"type": "string",
"description": "Yes/No if rRNA genes detected"
},
"NCBI_lineage": {
"type": "string",
"description": "full NCBI lineage - format: x;y;z"
}
},
"required": ["sample", "fasta"]
"required": [
"sample",
"fasta",
"assembly_software",
"co-assembly",
"binning_software",
"binning_parameters",
"metagenome",
"broad_environment",
"local_environment",
"environmental_medium"
]
}
}
103 changes: 103 additions & 0 deletions bin/count_rna.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/usr/bin/env python

# This file is part of MGnify genome analysis pipeline.
#
# MGnify genome analysis pipeline is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# MGnify genome analysis pipeline is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with MGnify genome analysis pipeline. If not, see <https://www.gnu.org/licenses/>.


import argparse

AA = [
"Ala",
"Gly",
"Pro",
"Thr",
"Val",
"Ser",
"Arg",
"Leu",
"Phe",
"Asn",
"Lys",
"Asp",
"Glu",
"His",
"Gln",
"Ile",
"Met",
"Tyr",
"Cys",
"Trp",
]

def parse_args():
parser = argparse.ArgumentParser(description="Script detects counts of tRNA and rRNA")
parser.add_argument("-t", "--trna", dest="trna", help="trnas_stats.out from tRNAscan-SE",
required=True)
parser.add_argument("-r", "--rrna", dest="rrna", help="GFF from barrnap",
required=True)
parser.add_argument("-n", "--name", dest="name", help="FASTA Sequence identifier used for prediction",
required=True)
parser.add_argument("-o", "--output", dest="output", help="Name of output file (default: rna_decision.tsv)",
default="rna_decision.tsv", required=False)
parser.add_argument("--trna-limit", dest="trna_limit", help="Minimal required number of tRNA",
required=True, type=int)
parser.add_argument("--rrna-limit", dest="rrna_limit", help="Minimal required number of tRNA",
required=True, type=int)
return parser.parse_args()


def parse_trna(trna_input):
with open(trna_input, "r") as f:
trnas = 0
flag = 0
for line in f:
if "Isotype / Anticodon" in line:
flag = 1
elif flag == 1:
cols = line.split()
if len(cols) > 1:
aa_pred = line.split(":")[0].split()[0]
counts = int(line.split(":")[1].split()[0])
if aa_pred in AA:
trnas += counts
return trnas


def parse_rrna(rrna_input):
count = 0
with open(rrna_input, 'r') as file_in:
for line in file_in:
if 'rRNA' in line:
count+=1
return count

def main():
args = parse_args()
# parsing tRNA
trna_count = parse_trna(trna_input=args.trna)
print(f"Found {trna_count} tRNA")
# parsing rRNA
rrna_count = parse_rrna(rrna_input=args.rrna)
print(f"Found {rrna_count} rRNA")

decision = "Yes" if trna_count >= int(args.trna_limit) and rrna_count >= int(args.rrna_limit) else "No"
print(f"RNA presented: {decision}")

with open(args.output, 'w') as file_out:
file_out.write(f"{args.name}\t{str(decision)}")


if __name__ == "__main__":
main()
Binary file modified docs/images/nf-core-seqsubmit_logo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 2 additions & 9 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@ workflow NFCORE_SEQSUBMIT {
// WORKFLOW: Run pipeline
//
// Depending on the input type (mags/bins or metagenomic_assemblies), one or the another workflow will be triggered
if (params.mode == "mags") {
if (params.mode == "mags" || params.mode == "bins") {
GENOMESUBMIT (
samplesheet,
"mags"
)
ch_multiqc_report = GENOMESUBMIT.out.multiqc_report
} else if (params.mode == "bins") {
GENOMESUBMIT (
samplesheet,
"bins"
params.mode
)
ch_multiqc_report = GENOMESUBMIT.out.multiqc_report
} else if (params.mode == "metagenomic_assemblies") {
Expand All @@ -59,7 +53,6 @@ workflow NFCORE_SEQSUBMIT {
}



emit:
multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html
}
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
"barrnap": {
"branch": "master",
"git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46",
"installed_by": ["modules"]
},
"coverm/contig": {
"branch": "master",
"git_sha": "27e31681fdbf1e511257355a236037a8cd9c2b2e",
Expand All @@ -20,6 +25,11 @@
"branch": "master",
"git_sha": "af27af1be706e6a2bb8fe454175b0cdf77f47b49",
"installed_by": ["modules"]
},
"trnascanse": {
"branch": "master",
"git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46",
"installed_by": ["modules"]
}
}
},
Expand Down
35 changes: 35 additions & 0 deletions modules/local/count_rna/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Calculate number of tRNA and rRNA detected
*/
process COUNT_RNA {

label 'process_low'
tag "${meta.id}"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/biopython:1.75':
'quay.io/biocontainers/biopython:1.75' }"

input:
tuple val(meta), path(trnas_stats), path(rrna_gff)

output:
tuple val(meta), path("*rna_decision.tsv"), emit: rna_decision
path "versions.yml", emit: versions

script:
"""
count_rna.py \\
--trna ${trnas_stats} \\
--rrna ${rrna_gff} \\
--name ${meta.id} \\
--trna-limit ${params.trna_limit} \\
--rrna-limit ${params.rrna_limit} \\
--output ${meta.id}_rna_decision.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version 2>&1 | sed 's/Python //g')
biopython: \$(python -c "import pkg_resources; print(pkg_resources.get_distribution('biopython').version)")
END_VERSIONS
"""
}
6 changes: 3 additions & 3 deletions modules/local/genome_upload/main.nf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
process GENOME_UPLOAD {
tag "$meta.id"
tag "${mags_or_bins_flag}"
label 'process_low'

container "community.wave.seqera.io/library/pip_genome-uploader:e2815984bcdc3e83"
container "quay.io/biocontainers/genome-uploader:2.5.1--pyhdfd78af_1"

secret 'WEBIN_ACCOUNT'
secret 'WEBIN_PASSWORD'

input:
tuple val(meta), path(mags)
path(mags)
path(table_for_upload)
val(mags_or_bins_flag)

Expand Down
3 changes: 2 additions & 1 deletion modules/local/registerstudy/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ process REGISTERSTUDY {
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo "Generate study XMLs"
study_xmls \\
$args \\
--study ${study} \\
--library ${library} \\
--center ${center} \\


echo "Submit study to ENA"
submit_study \\
$args2 \\
--directory ${study}_upload \\
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/barrnap/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading