Repository navigation
Leave the pseudogenes AMAP called out of the clean proteome - #66
Merged
Merged
Conversation
export_clean_proteome.py read Mycobrowser's Is_Pseudogene, which every master table has, and looked up whole FASTA IDs (L4_CDC1551_Rv0001;+;0-1524) among the master table's simple_ids, so it only dropped proteins with an internal stop: 42 of CDC1551's 123 pseudogenes and 27 of Sakai's 129 stayed in *-AMAP.clean.faa. It now drops the genes whose pseudogene column is yes, matched on the ID before the ';', and stops on a master table without that column. A test chains GET_OUTPUTS with Mycobrowser on and off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
*-AMAP.clean.faais meant to hold no pseudogenes (the outputs page: "drops pseudogenes and any sequence with an internal stop codon"), butexport_clean_proteome.pynever left a gene out for being one:Is_Pseudogene,pseudogeneandis_pseudogenethat the master table has. Every master table has Mycobrowser'sIs_Pseudogene(generate_tsv_gff_gbk.pymerges an empty Mycobrowser frame when Mycobrowser is off), so it read the reference's Mycobrowser flags or nothing, never AMAP's ownpseudogenecolumn. This is the column order Count the pseudogenes AMAP called in the QC table聽#58 fixed inannotation_qc.py.L4_CDC1551_Rv0001;+;0-1524, among the master table'ssimple_ids (L4_CDC1551_Rv0001). Nothing ever matched, and its log said "0 pseudogenes".Only the proteins with an internal stop codon were left out, so the pseudogenes without one stayed in.
Fix
load_pseudogene_idsreadssimple_idandpseudogeneand returns the genes whosepseudogeneisyes, the same test the GFF3 writer uses forpseudo=true, and each record is matched on its ID before the;. The internal-stop, trailing-stop and empty checks are unchanged. A master table without those columns now stops the export (pandas' "Usecols do not match columns" error) instead of a warning that let every pseudogene through; the master table GET_OUTPUTS writes always has them.Measured
GET_OUTPUTS' own rendered script (through
tests/test_sample_ids.py'srun_task) inpaururo/amap:latest, on benchmark FIX_CDS outputs with their Bakta tables and an empty emapper table:clean.faaon mainclean.faanowClean proteome: 3891/4014 proteins exported (123 pseudogenes, 0 internal stops, 0 empty).pseudo=true, and its proteins are the GenBank's/translations (3891/3891, 5194/5194, 5204/5204).-AMAP.tsv, QC table, panaroo GFF) is byte-identical to main's.Is_Pseudogene=Yes. AMAP calls 7 of them pseudogenes and finds the other 6 intact, and those 6 stay in the clean proteome.Tests
tests/test_clean_proteome.py(4 tests, each with Mycobrowser on and off) runs the steps after the correction astests/test_sample_ids.pychains them, built liketests/test_qc_pseudogenes.py. FIX_CDS calls Rv0002 a pseudogene for a frameshift, Rv0003 (which Bakta missed) for an internal stop, with the*in its protein that FIX_CDS writes, and every copy of the novel gene but the first for having no stop within reach; Mycobrowser marks Rv0001, which AMAP finds intact. The tests check that the master table has both columns, that no pseudogene AMAP called is in*-AMAP.clean.faa, that every other protein is there as FIX_CDS wrote it and in its order, and that the clean proteome is the GFF3's CDS withoutpseudo=true, with the GenBank's translations.tests/test_classify.py::TestCleanProteomewrote master tables no run writes (simple_idandIs_Pseudogeneonly, asTrue/False) and FASTA IDs without;strand;start-end. They now have the real shape,test_strips_pseudogeneswith Mycobrowser saying the opposite of AMAP, and a new test checks that a master table withoutpseudogenestops the export and writes nothing.export_clean_proteome.pymounted over the branch's: 8 failed, 4 passed (the two master-table tests and the two stop-codon unit tests).test_strips_pseudogenes).test_clean_proteome.pyandtest_classify.py, 190 passed.tools/build_docs.py --checkandtools/check_site.pypass on Python 3.11.Docs
The outputs page now says which pseudogenes the clean proteome drops, those with
pseudo=truein the GFF3, as it says for the QC count since #58. CHANGELOG bullets under Unreleased (Correctness and Testing, 691 tests), withchangelog.html,outputs.htmland the search index rebuilt.