nuget server logo nuget api documents
↑

API Docs / SMRUCC.genomics.Core / NcbiTaxonomyTree

NcbiTaxonomyTree

Full name SMRUCC.genomics.Assembly.NCBI.Taxonomy.NcbiTaxonomyTree Assembly SMRUCC.genomics.Core Members 27

Builds the following dictionnary from NCBI taxonomy nodes.dmp and names.dmp files

 { Taxid   : namedtuple('Node', ['name', 'rank', 'parent', 'children'] }

00 Remarks

NCBI_taxonomy_tree

https://github.com/frallain/NCBI_taxonomy_tree

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

SMRUCC.genomics.Assembly.NCBI.Taxonomy.NcbiTaxonomyTree

02 Methods

NameOverloadsSummary
.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

NameOverloadsSummary
Taxonomy 1 {taxid -> taxonomy_node}
GetNode 1 当taxid不存在的时候,这个只读属性会返回空值

04 Fields

NameOverloadsSummary
stdranks 2 这个列表是从小到大进行排序的 + species + genus + family + order + class + phylum + superkingdom
species 1
genus 1
family 1
order 1
class 1
phylum 1
superkingdom 1

05 Members

method .ctor overload 2 #
#ctor(String)

Builds the following dictionnary from NCBI taxonomy nodes.dmp and names.dmp files

 { Taxid    namedtuple('Node', ['name', 'rank', 'parent', 'children'] }
method .ctor #
#ctor(String, String)

Builds the following dictionnary from NCBI taxonomy nodes.dmp and names.dmp files

 { Taxid    namedtuple('Node', ['name', 'rank', 'parent', 'children'] }
Parameters
NameTypeDescription
nodesString

-

namesString

-

method GetParent #
GetParent(Int32)

get parent node of current node its taxid

Parameters
NameTypeDescription
taxidInt32

-

method GetParents #
GetParents(Int32())

Returns parent id

Parameters
NameTypeDescription
taxidsInt32()

-

method GetRank #
GetRank(Int32())

获取所给定的taxid的分类等级列表

Parameters
NameTypeDescription
taxidsInt32()

-

method GetAscendantsWithRanksAndNames overload 2 #
GetAscendantsWithRanksAndNames(Int32, Boolean)

使用这个函数得到物种的具体分类,返回来的数据是从小到大排列的

Remarks

请注意:返回来的数据是从小到大排列的

Parameters
NameTypeDescription
taxidInt32

ncbi taxonomy数据库中的物种id

only_std_ranksBoolean

是否仅返回标准分类层级

Returns

目标物种在NCBI taxonomy物种分类树上的分类路径节点向量

method GetAscendantsWithRanksAndNames #
GetAscendantsWithRanksAndNames(IEnumerable(Of Int32), Boolean)

使用这个函数得到物种的具体分类,返回来的数据是从小到大排列的

Parameters
NameTypeDescription
taxidsIEnumerable(Of Int32)

-

only_std_ranksBoolean

-

method GetDescendants #
GetDescendants(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.

Parameters
NameTypeDescription
taxidsInt32()

-

method GetDescendantsWithRanksAndNames #
GetDescendantsWithRanksAndNames(Int32())

Returns the ordered list of the descendants with their respective ranks and names for a LIST of taxids.

Parameters
NameTypeDescription
taxidsInt32()

-

method GetLeaves #
GetLeaves(Int32)

Returns all the descendant taxids that are leaves of the tree from a branch/clade determined by ONE taxid.

Parameters
NameTypeDescription
taxidInt32

-

method GetLeavesWithRanksAndNames #
GetLeavesWithRanksAndNames(Int32)

Returns all the descendant taxids that are leaves of the tree from a branch/clade determined by ONE taxid.

Parameters
NameTypeDescription
taxidInt32

-

method GetTaxidsAtRank #
GetTaxidsAtRank(String)

Returns all the taxids that are at a specified rank:

  • standard ranks: species, genus, family, order, class, phylum, superkingdom.
  • non-standard ranks: forma, varietas, subspecies, species group, subtribe, tribe, subclass, kingdom.
Parameters
NameTypeDescription
rankString

-

method preorderTraversal #
preorderTraversal(Int32, Boolean)

Prefix (Preorder) visit of the tree: https://en.wikipedia.org/wiki/Tree_traversal

Parameters
NameTypeDescription
taxidInt32

-

only_leavesBoolean

-

method flatten #
flatten(IEnumerable)
 >>> flatten([1 , [2, 2], [2, [3, 3, 3]]]) 
 [1, 2, 2, 2, 3, 3, 3]
Parameters
NameTypeDescription
seqIEnumerable

-

property Taxonomy #
Taxonomy

{taxid -> taxonomy_node}

property GetNode #
GetNode(Int32)

当taxid不存在的时候,这个只读属性会返回空值

Parameters
NameTypeDescription
taxid%Int32

-

field stdranks #
stdranks

这个列表是从小到大进行排序的

  • species
  • genus
  • family
  • order
  • class
  • phylum
  • superkingdom
Remarks

use this index order for make comparision of the rank levels

field stdranks overload 2 #
stdranks
field species #
species
field genus #
genus
field family #
family
field order #
order
field class #
class
field phylum #
phylum
field superkingdom #
superkingdom
method GetChildren #
GetChildren(Int32())
method GetName #
GetName(Int32())