etetoolkit

How can I get taxonomic rank names from taxid?

痞子三分冷 提交于 2019-12-06 12:08:01
问题 This question is related to: How to get taxonomic specific ids for kingdom, phylum, class, order, family, genus and species from taxid? The solution given there works but I would like to have the names for each taxonomic ids for defined ranks. I have found this on ete3 which can do the job: names = ncbi.get_taxid_translator(lineage) print [names[taxid] for taxid in lineage] but not being python programmer, I am failing to incorporate this into the code given in the link above. Here is what I

How to get taxonomic specific ids for kingdom, phylum, class, order, family, genus and species from taxid?

情到浓时终转凉″ 提交于 2019-12-05 21:46:42
问题 I have a list of taxids that looks like this: 1204725 2162 1300163 420247 I am looking to get a file with taxonomic ids in order from the taxids above: kingdom_id phylum_id class_id order_id family_id genus_id species_id I am using the package "ete3". I use the tool ete-ncbiquery that tells you the lineage from the ids above. (I run it from my linux laptop with the command below) ete3 ncbiquery --search 1204725 2162 13000163 420247 --info The result looks like this: # Taxid Sci.Name Rank

HTML Parse tree using Python 2.7

随声附和 提交于 2019-12-05 04:36:00
问题 I was trying to get configure one parse tree for the below HTML table,but couldn't form it.I want to see how the tree structure looks like!can anyone help me here? # <html> # <head> # <title> # The Dormouse's story # </title> # </head> # <body> # <p class="title"> # <b> # The Dormouse's story # </b> # </p> # <p class="story"> # Once upon a time there were three little sisters; and their names were # <a class="sister" href="http://example.com/elsie" id="link1"> # Elsie # </a> # , # <a class=

How can I get taxonomic rank names from taxid?

喜夏-厌秋 提交于 2019-12-04 15:20:58
This question is related to: How to get taxonomic specific ids for kingdom, phylum, class, order, family, genus and species from taxid? The solution given there works but I would like to have the names for each taxonomic ids for defined ranks. I have found this on ete3 which can do the job: names = ncbi.get_taxid_translator(lineage) print [names[taxid] for taxid in lineage] but not being python programmer, I am failing to incorporate this into the code given in the link above. Here is what I have tried: import csv from ete3 import NCBITaxa ncbi = NCBITaxa() def get_desired_ranks(taxid, desired

HTML Parse tree using Python 2.7

谁说胖子不能爱 提交于 2019-12-03 20:56:52
I was trying to get configure one parse tree for the below HTML table,but couldn't form it.I want to see how the tree structure looks like!can anyone help me here? # <html> # <head> # <title> # The Dormouse's story # </title> # </head> # <body> # <p class="title"> # <b> # The Dormouse's story # </b> # </p> # <p class="story"> # Once upon a time there were three little sisters; and their names were # <a class="sister" href="http://example.com/elsie" id="link1"> # Elsie # </a> # , # <a class="sister" href="http://example.com/lacie" id="link2"> # Lacie # </a> # and # <a class="sister" href="http:

Converting ndarray generated by hcluster into a Newick string for use with ete2 package

大憨熊 提交于 2019-12-03 10:09:06
问题 I have a list of vectors created by running: import hcluster import numpy as np from ete2 import Tree vecs = [np.array(i) for i in document_list] where document_list is a collection of web documents I am analysing. I then perform hierarchical clustering: Z = hcluster.linkage(vecs, metric='cosine') This generates an ndarray such as: [[ 12. 19. 0. 1. ] [ 15. 21. 0. 3. ] [ 18. 22. 0. 4. ] [ 3. 16. 0. 7. ] [ 8. 23. 0. 6. ] [ 5. 27. 0. 6. ] [ 1. 28. 0. 7. ] [ 0. 21. 0. 2. ] [ 5. 29. 0.18350472 2.