From 18dc82c4e409b9dc7c5672e77d459fe3ab79e315 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Tue, 30 Apr 2024 12:49:13 +1200 Subject: [PATCH] Now using PFAMs from eggnog if description is '-' --- CHANGELOG.md | 3 ++- subworkflows/local/gff_store.nf | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9477ab8..3eb74a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 0.3.0 - [29-April-2024] +## 0.3.0 - [30-April-2024] ### `Added` @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 39. Now using local tests/stub files for GitHub CI 40. Now removing iso-forms left by TSEBRA using `AGAT_SPFILTERFEATUREFROMKILLLIST` 41. Added `pyproject.toml` +42. Now using PFAMs from eggnog if description is '-' ### `Fixed` diff --git a/subworkflows/local/gff_store.nf b/subworkflows/local/gff_store.nf index 7485300..3326e2a 100644 --- a/subworkflows/local/gff_store.nf +++ b/subworkflows/local/gff_store.nf @@ -20,12 +20,17 @@ workflow GFF_STORE { def cols = line.split('\t') def id = cols[0] def txt = cols[7] + def pfams = cols[20] - [ id, txt ] + [ id, txt, pfams ] + } + .collect { id, txt, pfams -> + if ( txt != '-' ) { return [ id, txt ] } + if ( pfams != '-' ) { return [ id, "PFAMs: $pfams" ] } + + [ id, 'No eggnog description and PFAMs' ] } - .findAll { id, txt -> - txt != '-' - }.collectEntries { id, txt -> + .collectEntries { id, txt -> [ id, txt ] } @@ -57,7 +62,7 @@ workflow GFF_STORE { def anno = tx_annotations.containsKey(tx_id) ? URLEncoder.encode(tx_annotations[tx_id], "UTF-8").replace('+', '%20') - : URLEncoder.encode('hypothetical protein | no eggnog hit', "UTF-8").replace('+', '%20') + : URLEncoder.encode('Hypothetical protein | no eggnog hit', "UTF-8").replace('+', '%20') gene_tx_annotations[gene_id] += [ ( tx_id ): anno ] } @@ -67,7 +72,7 @@ workflow GFF_STORE { def default_anno = tx_annos.values().first() if ( tx_annos.values().findAll { it != default_anno }.size() > 0 ) { - return [ gene_id, ( tx_annos + [ 'default': 'differing%20isoform%20descriptions' ] ) ] + return [ gene_id, ( tx_annos + [ 'default': 'Differing%20isoform%20descriptions' ] ) ] } [ gene_id, ( tx_annos + [ 'default': default_anno ] ) ]