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

Possibility to include NAs in taxonomy csv format for easier parsing? #39

Closed
LanderDC opened this issue Oct 2, 2023 · 10 comments
Closed

Comments

@LanderDC
Copy link
Contributor

LanderDC commented Oct 2, 2023

Hi,

I'm trying to parse the taxonomy column of the _virus_summary.tsv file, but unclassified taxonomic levels are omitted which causes inconsistencies. In the table below for example, for the first entry, Straboviridae would end up in the Order column while it is a viral family.

seq_name length topology coordinates n_genes genetic_code virus_score fdr n_hallmarks marker_enrichment taxonomy
NODE_A75_length_5000_cov_17.505180_BlackFly28 5000 No_terminal_repeats NA 4 11 0.9997 0.0003 1 6.8731 Viruses;Duplodnaviria;Heunggongvirae;Uroviricota;Caudoviricetes;Straboviridae
NODE_A20_length_7615_cov_6.791589_BlackFly6 7615 No_terminal_repeats NA 11 11 0.9997 0.0003 6 15.3910 Viruses;Duplodnaviria;Heunggongvirae;Uroviricota;Caudoviricetes
NODE_A8_length_6639_cov_9.592350_BlackFly34 6639 No_terminal_repeats NA 8 11 0.9997 0.0003 1 13.4767 Viruses;Duplodnaviria;Heunggongvirae;Uroviricota;Caudoviricetes
NODE_A4_length_12404_cov_730.807901_BlackFly44 12404 No_terminal_repeats NA 6 11 0.9996 0.0004 2 3.4366 Viruses;Riboviria;Orthornavirae;Negarnaviricota;Monjiviricetes;Mononegavirales;Rhabdoviridae

Would it be possible to output the taxonomy column as:
Viruses;Duplodnaviria;Heunggongvirae;Uroviricota;Caudoviricetes;;Straboviridae;; or
Viruses;Duplodnaviria;Heunggongvirae;Uroviricota;Caudoviricetes;unclassified;Straboviridae?

Thanks in advance!

@apcamargo
Copy link
Owner

Hi @LanderDC,

You make a good point. I'm not sure about adding an "unclassified" taxon to the lineage (your second option) because it might confuse users. They could think that geNomad couldn't assign the sequence to an order but could assign it to a family, when in reality, the family isn't part of any order at all

I like your first option, though.

Another possibility would be adding prefixes to the taxa names, like GTDB does? For instance:

Viruses;r__Duplodnaviria;k__Heunggongvirae;p__Uroviricota;c__Caudoviricetes;f__Straboviridae;

This could make parsing easier. The problem is that "Viruses" is not a taxon at all and doesn't have a named rank.

@LanderDC
Copy link
Contributor Author

LanderDC commented Oct 3, 2023

Thanks for your swift reply!

You are right that my second option might cause some confusion. I like your suggestion to add prefixes, because you immediately see which taxonomic rank you're dealing with and don't have to remember which suffix belongs to which rank. However, if possible I would still like empty places for ranks that are not yet classified by ICTV, because then you can just split the taxonomy column based on the semicolon:

Viruses;r__Duplodnaviria;k__Heunggongvirae;p__Uroviricota;c__Caudoviricetes;;f__Straboviridae;;

About the "Viruses" problem, I don't feel that it is really an issue but I understand that you would like to have everything consistent.

@apcamargo
Copy link
Owner

I like your suggestion. The "Viruses" thing does bother me, though. If I add the additional semicolons, the ranks would be could be inferred by the number of the column, so the prefixes are not strictly required.

@LanderDC
Copy link
Contributor Author

LanderDC commented Oct 4, 2023

True, whatever is easier to implement should be fine 🙂

@apcamargo
Copy link
Owner

I'll will work on that for the next release :)

@LanderDC
Copy link
Contributor Author

LanderDC commented Oct 6, 2023

Nice, thanks!

@LanderDC
Copy link
Contributor Author

Are you ok with a pull request on this issue? I forked your repo and slightly modified taxonomy.py to get these empty fields for unclassified ranks (LanderDC@14eb85d). Incidentally, the "Viruses" rank is also removed by these modifications.

@apcamargo
Copy link
Owner

Thanks, @LanderDC

If it's easy enough, I'd appreciate that. I'd need to evaluate what could break with this change (the removal of the "Viruses" taxon), but I don't forsee any issues.

@LanderDC
Copy link
Contributor Author

Great!

@apcamargo
Copy link
Owner

Fixed in version 1.8.0. Thanks @LanderDC!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants