From 0115e1992116a42762f18660ed9bb2a8478ae0ab Mon Sep 17 00:00:00 2001 From: luisas Date: Tue, 28 May 2024 09:56:33 +0200 Subject: [PATCH] Minor changes --- .vscode/settings.json | 4 ---- README.md | 14 ++++++++------ bin/fetch_oma_by_sequence.py | 8 ++++++++ main.nf | 4 ++-- modules/local/fetch_oma_group_local.nf | 12 +++++++----- subworkflows/local/get_orthologs.nf | 3 +-- 6 files changed, 26 insertions(+), 19 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 324a961..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true -} diff --git a/README.md b/README.md index 63e8fac..58b8232 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,13 @@ ## Introduction -**nf-core/reportho** is a bioinformatics pipeline that compares and assembles orthology predictions for a query protein. It fetches ortholog lists for a query (or its closest annotated homolog) from public sources, calculates pairwise and global agreement, and generates a consensus list with the desired level of confidence. Optionally, it offers common analysis on the consensus orthologs, such as MSA and phylogeny reconstruction. Additionally, it generates a clean, human-readable report of the results. +**nf-core/reportho** is a bioinformatics pipeline that compares and summarizes orthology predictions for one or a set of query proteins. For each query (or its closest annotated homolog), it fetches ortholog lists from public databases, calculates the agreement of the obtained predictions(pairwise and global) and finally generates a consensus list of orthologs with the desired level of confidence. Optionally, it offers common analysis on the consensus orthologs, such as MSA and phylogeny reconstruction. Additionally, it generates a clean, human-readable report of the results. ![nf-core-reportho tube map](docs/images/reportho_tube_map.svg?raw=true "nf-core-reportho tube map") -1. **Obtain Query Information**: (depends on provided input) identification of Uniprot ID and taxon ID for the query or its closest homolog. +1. **Obtain Query Information**: identification of Uniprot ID and taxon ID for the query (or its closest homolog if the fasta file is used as input instead of the Uniprot ID). 2. **Fetch Orthologs**: fetching of ortholog predictions from public databases, either through API or from local snapshot. 3. **Compare and Assemble**: calculation of agreement statistics, creation of ortholog lists, selection of the consensus list. @@ -47,6 +47,7 @@ First, prepare a samplesheet with your input data that looks as follows: ```csv title="samplesheet_fasta.csv" id,fasta BicD2,data/bicd2.fasta +HBB,data/hbb.fasta ``` or if you know the UniProt ID of the protein you can provide it directly: @@ -54,6 +55,7 @@ or if you know the UniProt ID of the protein you can provide it directly: ```csv title="samplesheet.csv" id,query BicD2,Q8TD16 +HBB,P68871 ``` > [!NOTE] @@ -82,13 +84,13 @@ For more details about the output files and reports, please refer to the ## Credits -nf-core/reportho was originally written by Igor Trujnara (@itrujnara). +nf-core/reportho was originally written by Igor Trujnara ([@itrujnara](https://github.com/itrujnara)). We thank the following people for their extensive assistance in the development of this pipeline: -- Luisa Santus (@lsantus) -- Alessio Vignoli (@avignoli) -- Jose Espinosa-Carrasco (@JoseEspinosa) +- Luisa Santus ([@lsantus](https://github.com/luisas)) +- Alessio Vignoli ([@alessiovignoli](https://github.com/alessiovignoli)) +- Jose Espinosa-Carrasco ([@JoseEspinosa](https://github.com/JoseEspinosa)) ## Contributions and Support diff --git a/bin/fetch_oma_by_sequence.py b/bin/fetch_oma_by_sequence.py index c30a084..3b91439 100755 --- a/bin/fetch_oma_by_sequence.py +++ b/bin/fetch_oma_by_sequence.py @@ -9,6 +9,14 @@ from Bio import SeqIO from utils import fetch_seq +# Script overview: +# Fetches the OMA entry for a given protein sequence +# The sequence is passed as a FASTA file +# If the sequence is not found, the script exits with an error +# It outputs 3 files: +# 1. The canonical ID of the sequence +# 2. The taxonomy ID of the species +# 3. A boolean indicating if the sequence was an exact match def main() -> None: if len(sys.argv) < 5: diff --git a/main.nf b/main.nf index cb1dfd0..f7466af 100644 --- a/main.nf +++ b/main.nf @@ -46,8 +46,8 @@ workflow NFCORE_REPORTHO { samplesheet_fasta, ) - // emit: - // multiqc_report = REPORTHO.out.multiqc_report // channel: /path/to/multiqc_report.html + emit: + multiqc_report = REPORTHO.out.multiqc_report // channel: /path/to/multiqc_report.html } /* diff --git a/modules/local/fetch_oma_group_local.nf b/modules/local/fetch_oma_group_local.nf index 2ba3278..9cf37ef 100644 --- a/modules/local/fetch_oma_group_local.nf +++ b/modules/local/fetch_oma_group_local.nf @@ -2,11 +2,6 @@ process FETCH_OMA_GROUP_LOCAL { tag "$meta.id" label 'process_single' - conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' : - 'biocontainers/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' }" - conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' : @@ -29,10 +24,17 @@ process FETCH_OMA_GROUP_LOCAL { script: prefix = task.ext.prefix ?: meta.id """ + # Obtain the OMA ID fort the given Uniprot ID of the query protein omaid=\$(uniprot2oma_local.py $uniprot_idmap $uniprot_id) + + # Perform the database search for the given query in OMA zcat $db | grep \$omaid | head -1 | cut -f3- | awk '{gsub(/\\t/,"\\n"); print}' > ${prefix}_oma_group_oma.txt || test -f ${prefix}_oma_group_oma.txt + + # Convert the OMA ids to Uniprot, Ensembl and RefSeq ids oma2uniprot_local.py $uniprot_idmap ${prefix}_oma_group_oma.txt > ${prefix}_oma_group_raw.txt uniprotize_oma_local.py ${prefix}_oma_group_raw.txt $ensembl_idmap $refseq_idmap > ${prefix}_oma_group.txt + + # Add the OMA column to the csv file csv_adorn.py ${prefix}_oma_group.txt OMA > ${prefix}_oma_group.csv cat <<- END_VERSIONS > versions.yml diff --git a/subworkflows/local/get_orthologs.nf b/subworkflows/local/get_orthologs.nf index f94d36e..8c524de 100644 --- a/subworkflows/local/get_orthologs.nf +++ b/subworkflows/local/get_orthologs.nf @@ -50,8 +50,6 @@ workflow GET_ORTHOLOGS { .map { it -> [it[0], file(it[1])] } .set { ch_fasta } - ch_fasta.view() - IDENTIFY_SEQ_ONLINE ( ch_fasta ) @@ -135,6 +133,7 @@ workflow GET_ORTHOLOGS { ch_versions = ch_versions.mix(FETCH_INSPECTOR_GROUP_ONLINE.out.versions) + // EggNOG FETCH_EGGNOG_GROUP_LOCAL ( ch_query, ch_eggnog,