Builds the following dictionnary from NCBI taxonomy nodes.dmp and names.dmp files
{ Taxid : namedtuple('Node', ['name', 'rank', 'parent', 'children'] }
Builds the following dictionnary from NCBI taxonomy nodes.dmp and names.dmp files
{ Taxid : namedtuple('Node', ['name', 'rank', 'parent', 'children'] }
00 Remarks
The NCBI Taxonomy database Is a curated Set Of names And classifications For all Of the organisms that are represented In GenBank (http://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/). It can be accessed via http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi Or it can be downloaded from ftp://ftp.ncbi.nih.gov/pub/taxonomy/ in the form of 2 files : nodes.dmp for the structure of the tree And names.dmp for the names of the different nodes.
Here I make available my In-memory mapping Of the NCBI taxonomy : a Python 2.7 Class that maps the names.dmp And nodes.dmp files In a Python dictionnary which can be used To retrieve lineages, descendants, etc ...
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 2 | Builds the following dictionnary from NCBI taxonomy nodes.dmp and names.dmp files json { Taxid namedtuple('Node', ['name', 'rank', 'parent', 'children'] } + https://w… |
| GetParent | 1 | get parent node of current node its taxid |
| GetParents | 1 | Returns parent id |
| GetRank | 1 | 获取所给定的taxid的分类等级列表 |
| GetAscendantsWithRanksAndNames | 2 | 使用这个函数得到物种的具体分类,返回来的数据是从小到大排列的 |
| GetDescendants | 1 | Returns all the descendant taxids from a branch/clade of a list of taxids : all nodes (leaves or not) of the tree are returned including the original one. |
| GetDescendantsWithRanksAndNames | 1 | Returns the ordered list of the descendants with their respective ranks and names for a LIST of taxids. |
| GetLeaves | 1 | Returns all the descendant taxids that are leaves of the tree from a branch/clade determined by ONE taxid. |
| GetLeavesWithRanksAndNames | 1 | Returns all the descendant taxids that are leaves of the tree from a branch/clade determined by ONE taxid. |
| GetTaxidsAtRank | 1 | Returns all the taxids that are at a specified rank: + standard ranks: species, genus, family, order, class, phylum, superkingdom. |
| preorderTraversal | 1 | Prefix (Preorder) visit of the tree: https://en.wikipedia.org/wiki/Tree_traversal |
| flatten | 1 | flatten([1 , [2, 2], [2, [3, 3, 3]]]) [1, 2, 2, 2, 3, 3, 3] |
| GetChildren | 1 | |
| GetName | 1 |
03 Properties
04 Fields
05 Members
String)Builds the following dictionnary from NCBI taxonomy nodes.dmp and names.dmp files
{ Taxid namedtuple('Node', ['name', 'rank', 'parent', 'children'] }
String, String)Builds the following dictionnary from NCBI taxonomy nodes.dmp and names.dmp files
{ Taxid namedtuple('Node', ['name', 'rank', 'parent', 'children'] }
| Name | Type | Description |
|---|---|---|
nodes | String | - |
names | String | - |
Int32)get parent node of current node its taxid
| Name | Type | Description |
|---|---|---|
taxid | Int32 | - |
Int32())Returns parent id
| Name | Type | Description |
|---|---|---|
taxids | Int32() | - |
Int32())获取所给定的taxid的分类等级列表
| Name | Type | Description |
|---|---|---|
taxids | Int32() | - |
Int32, Boolean)使用这个函数得到物种的具体分类,返回来的数据是从小到大排列的
请注意:返回来的数据是从小到大排列的
| Name | Type | Description |
|---|---|---|
taxid | Int32 | ncbi taxonomy数据库中的物种id |
only_std_ranks | Boolean | 是否仅返回标准分类层级 |
目标物种在NCBI taxonomy物种分类树上的分类路径节点向量
IEnumerable(Of Int32), Boolean)使用这个函数得到物种的具体分类,返回来的数据是从小到大排列的
| Name | Type | Description |
|---|---|---|
taxids | IEnumerable(Of Int32) | - |
only_std_ranks | Boolean | - |
Int32())Returns all the descendant taxids from a branch/clade of a list of taxids : all nodes (leaves or not) of the tree are returned including the original one.
| Name | Type | Description |
|---|---|---|
taxids | Int32() | - |
Int32())Returns the ordered list of the descendants with their respective ranks and names for a LIST of taxids.
| Name | Type | Description |
|---|---|---|
taxids | Int32() | - |
Int32)Returns all the descendant taxids that are leaves of the tree from a branch/clade determined by ONE taxid.
| Name | Type | Description |
|---|---|---|
taxid | Int32 | - |
Int32)Returns all the descendant taxids that are leaves of the tree from a branch/clade determined by ONE taxid.
| Name | Type | Description |
|---|---|---|
taxid | Int32 | - |
String)Returns all the taxids that are at a specified rank:
species, genus, family, order, class, phylum, superkingdom.forma, varietas, subspecies, species group, subtribe, tribe, subclass, kingdom.| Name | Type | Description |
|---|---|---|
rank | String | - |
Int32, Boolean)Prefix (Preorder) visit of the tree: https://en.wikipedia.org/wiki/Tree_traversal
| Name | Type | Description |
|---|---|---|
taxid | Int32 | - |
only_leaves | Boolean | - |
IEnumerable) >>> flatten([1 , [2, 2], [2, [3, 3, 3]]])
[1, 2, 2, 2, 3, 3, 3]| Name | Type | Description |
|---|---|---|
seq | IEnumerable | - |
{taxid -> taxonomy_node}
Int32)当taxid不存在的时候,这个只读属性会返回空值
| Name | Type | Description |
|---|---|---|
taxid% | Int32 | - |
这个列表是从小到大进行排序的
use this index order for make comparision of the rank levels
Int32())Int32())