index
int64
0
731k
package
stringlengths
2
98
name
stringlengths
1
76
docstring
stringlengths
0
281k
code
stringlengths
4
8.19k
signature
stringlengths
2
42.8k
embed_func_code
listlengths
768
768
720,250
ete3.coretype.tree
_asciiArt
Returns the ASCII representation of the tree. Code based on the PyCogent GPL project.
def _asciiArt(self, char1='-', show_internal=True, compact=False, attributes=None): """ Returns the ASCII representation of the tree. Code based on the PyCogent GPL project. """ if not attributes: attributes = ["name"] node_name = ', '.join(map(str, [getattr(self, v) for v in attributes ...
(self, char1='-', show_internal=True, compact=False, attributes=None)
[ -0.023450439795851707, -0.003974194638431072, 0.07173287123441696, 0.009608041495084763, 0.037427403032779694, -0.04417366534471512, -0.021943295374512672, 0.013510467484593391, 0.0627976581454277, -0.051637616008520126, 0.006221453659236431, 0.038216859102249146, 0.014057704247534275, 0.0...
720,251
ete3.clustering.clustertree
_calculate_avg_profile
This internal function updates the mean profile associated to an internal node.
def _calculate_avg_profile(self): """ This internal function updates the mean profile associated to an internal node. """ # Updates internal values self._profile, self._std_profile = clustvalidation.get_avg_profile(self)
(self)
[ -0.009615057148039341, -0.001449671108275652, 0.026498589664697647, 0.09467654675245285, 0.019568972289562225, -0.014613193459808826, -0.020077256485819817, -0.028226759284734726, 0.033597636967897415, -0.014672492630779743, -0.02095828391611576, -0.00870861578732729, 0.01137711200863123, ...
720,252
ete3.coretype.tree
_diff
.. versionadded:: 2.3 Show or return the difference between two tree topologies. :param [raw|table|topology|diffs|diffs_tab] output: Output type
def _diff(self, t2, output='topology', attr_t1='name', attr_t2='name', color=True): """ .. versionadded:: 2.3 Show or return the difference between two tree topologies. :param [raw|table|topology|diffs|diffs_tab] output: Output type """ from ..tools import ete_diff difftable = ete_diff.treed...
(self, t2, output='topology', attr_t1='name', attr_t2='name', color=True)
[ 0.03824453800916672, -0.029241718351840973, 0.06340358406305313, -0.021076370030641556, -0.007197021972388029, -0.06773051619529724, -0.0359065942466259, 0.03095155581831932, -0.05269092321395874, 0.013268690556287766, 0.016138775274157524, -0.017185615375638008, 0.004237519111484289, -0.0...
720,253
ete3.coretype.tree
_get_children
null
def _get_children(self): return self._children
(self)
[ 0.009597789496183395, -0.029865507036447525, -0.025233864784240723, -0.0018912532832473516, -0.02159716933965683, 0.08330091834068298, 0.025628412142395973, 0.03818530589342117, 0.0843987911939621, 0.007830903865396976, 0.044154975563287735, -0.014375240541994572, 0.03657280653715134, -0.0...
720,254
ete3.coretype.tree
_get_dist
null
def _get_dist(self): return self._dist
(self)
[ 0.062437862157821655, 0.016481226310133934, -0.019672201946377754, 0.034311216324567795, 0.06398400664329529, 0.005966631695628166, 0.022994766011834145, -0.009317979216575623, 0.0011236266000196338, 0.04918050765991211, -0.01604534685611725, 0.005773363634943962, -0.015946656465530396, 0....
720,255
ete3.coretype.tree
_get_face_areas
null
def _get_face_areas(self): if not hasattr(self, "_faces"): self._faces = _FaceAreas() return self._faces
(self)
[ 0.01088626030832529, -0.06497251242399216, -0.04106069728732109, -0.015371882356703281, -0.06697379052639008, 0.03031245432794094, 0.03681660816073418, -0.007448720745742321, -0.014457505196332932, 0.01113642007112503, 0.017769964411854744, -0.027241529896855354, -0.06341979652643204, 0.00...
720,256
ete3.coretype.tree
_get_farthest_and_closest_leaves
null
def _get_farthest_and_closest_leaves(self, topology_only=False, is_leaf_fn=None): # if called from a leaf node, no necessary to compute if (is_leaf_fn and is_leaf_fn(self)) or self.is_leaf(): return self, 0.0, self, 0.0 min_dist = None min_node = None max_dist = None max_node = None ...
(self, topology_only=False, is_leaf_fn=None)
[ 0.05170992761850357, -0.00040599796921014786, 0.0332210510969162, -0.0033124370966106653, -0.008802473545074463, 0.00557060306891799, 0.0013569713337346911, -0.01695120707154274, 0.0018196535529568791, 0.017724646255373955, -0.014594059437513351, 0.053735602647066116, -0.029298609122633934, ...
720,257
ete3.clustering.clustertree
_get_inter
null
def _get_inter(self): if self._silhouette is None: self.get_silhouette() return self._intercluster_dist
(self)
[ 0.02257179468870163, -0.038448136299848557, -0.005389333236962557, 0.04578608274459839, 0.04510977491736412, 0.0030729766003787518, 0.042066387832164764, -0.03457627072930336, -0.04446728155016899, 0.02465144358575344, -0.01831105165183544, -0.009333056397736073, -0.06671783328056335, -0.0...
720,258
ete3.clustering.clustertree
_get_intra
null
def _get_intra(self): if self._silhouette is None: self.get_silhouette() return self._intracluster_dist
(self)
[ -0.0018221380887553096, -0.014895821921527386, -0.015768099576234818, 0.024725722149014473, 0.04287581145763397, -0.004914950113743544, 0.040594469755887985, -0.02962389774620533, -0.0281812846660614, 0.015768099576234818, -0.010853149928152561, -0.017378458753228188, -0.06317304819822311, ...
720,259
ete3.clustering.clustertree
_get_prof
null
def _get_prof(self): if self._profile is None: self._calculate_avg_profile() return self._profile
(self)
[ 0.016389591619372368, -0.010727128945291042, 0.018083348870277405, 0.0798390582203865, 0.04141402244567871, -0.04194539785385132, 0.05459875985980034, -0.035402845591306686, -0.0023642026353627443, -0.03312789648771286, -0.023247646167874336, 0.01901325397193432, -0.013591570779681206, -0....
720,260
ete3.clustering.clustertree
_get_silh
null
def _get_silh(self): if self._silhouette is None: self.get_silhouette() return self._silhouette
(self)
[ 0.018121352419257164, -0.04399442672729492, 0.033811792731285095, 0.008363700471818447, 0.022932179272174835, -0.04623834788799286, 0.02855897881090641, 0.007335237693041563, -0.01756037212908268, 0.03272382915019989, -0.000048076406528707594, 0.020552264526486397, -0.02767501026391983, -0...
720,261
ete3.clustering.clustertree
_get_std
null
def _get_std(self): if self._std_profile is None: self._calculate_avg_profile() return self._std_profile
(self)
[ -0.014770382083952427, 0.02071436122059822, 0.033742260187864304, -0.0010534279281273484, 0.07849309593439102, -0.01696884073317051, 0.012286938726902008, -0.012979045510292053, 0.03265117481350899, -0.0003414734674151987, -0.030566710978746414, 0.013386167585849762, -0.017603950574994087, ...
720,262
ete3.coretype.tree
_get_style
null
def _get_style(self): if self._img_style is None: self._set_style(None) return self._img_style
(self)
[ 0.03753442317247391, -0.06201036274433136, -0.0033300891518592834, -0.0178943183273077, 0.00945343729108572, -0.025174250826239586, 0.047066424041986465, 0.029399055987596512, 0.11124155670404434, 0.01477808877825737, -0.02971329726278782, 0.008309947326779366, -0.013014843687415123, -0.06...
720,263
ete3.coretype.tree
_get_support
null
def _get_support(self): return self._support
(self)
[ 0.05252402648329735, -0.04302815720438957, -0.023657243698835373, 0.045006465166807175, 0.03442252799868584, 0.0219756830483675, 0.01693100295960903, 0.022701062262058258, 0.02674010396003723, 0.02530583180487156, 0.034851159900426865, -0.02423425018787384, 0.0018958767177537084, -0.001547...
720,264
ete3.coretype.tree
_get_up
null
def _get_up(self): return self._up
(self)
[ -0.004318624269217253, 0.007637759670615196, -0.023704541847109795, 0.05886988714337349, -0.00703390222042799, -0.036448024213314056, 0.07016410678625107, 0.021555639803409576, 0.05380580946803093, -0.026386503130197525, -0.03043443150818348, -0.045743267983198166, 0.006775700952857733, 0....
720,265
ete3.coretype.tree
_iter_descendants_levelorder
Iterate over all desdecendant nodes.
def _iter_descendants_levelorder(self, is_leaf_fn=None): """ Iterate over all desdecendant nodes. """ tovisit = deque([self]) while len(tovisit)>0: node = tovisit.popleft() yield node if not is_leaf_fn or not is_leaf_fn(node): tovisit.extend(node.children)
(self, is_leaf_fn=None)
[ -0.029425835236907005, -0.013291732408106327, -0.0026282828766852617, -0.020169908180832863, 0.0045186420902609825, 0.020097026601433754, -0.006509213708341122, 0.025107616558670998, 0.0009884530445560813, 0.023285584524273872, -0.004527752287685871, -0.009483682923018932, -0.010795546695590...
720,266
ete3.coretype.tree
_iter_descendants_postorder
null
def _iter_descendants_postorder(self, is_leaf_fn=None): to_visit = [self] if is_leaf_fn is not None: _leaf = is_leaf_fn else: _leaf = self.__class__.is_leaf while to_visit: node = to_visit.pop(-1) try: node = node[1] except TypeError: # PRE...
(self, is_leaf_fn=None)
[ -0.02770453505218029, 0.013201671652495861, -0.03845743462443352, -0.02396360971033573, -0.03283701092004776, 0.011801083572208881, 0.005123441107571125, 0.02933102287352085, 0.02060219831764698, -0.009514962323009968, 0.011042054742574692, 0.012885409407317638, -0.027523813769221306, 0.01...
720,267
ete3.coretype.tree
_iter_descendants_preorder
Iterator over all descendant nodes.
def _iter_descendants_preorder(self, is_leaf_fn=None): """ Iterator over all descendant nodes. """ to_visit = deque() node = self while node is not None: yield node if not is_leaf_fn or not is_leaf_fn(node): to_visit.extendleft(reversed(node.children)) try: ...
(self, is_leaf_fn=None)
[ -0.05038297176361084, 0.002041836269199848, -0.019339989870786667, -0.06321737170219421, -0.012295212596654892, 0.03599288687109947, 0.014036519452929497, 0.010606941767036915, 0.04903942719101906, -0.01302002090960741, 0.0035268079955130816, -0.0007579543744213879, -0.02351205423474312, 0...
720,268
ete3.coretype.tree
_set_children
null
def _set_children(self, value): if type(value) == list: for n in value: if type(n) != type(self): raise TreeError("Incorrect child node type") self._children = value else: raise TreeError("Incorrect children type")
(self, value)
[ 0.03139089047908783, 0.013415214605629444, -0.013211146928369999, -0.006707607302814722, -0.07928463071584702, 0.07083801180124283, 0.00029029700090177357, 0.06356256455183029, 0.03687409311532974, 0.0017744993092492223, 0.03531253710389137, 0.0246123056858778, 0.05270262807607651, -0.0096...
720,269
ete3.coretype.tree
_set_dist
null
def _set_dist(self, value): try: self._dist = float(value) except ValueError: raise TreeError('node dist must be a float number')
(self, value)
[ 0.04811275005340576, 0.07338545471429825, 0.021522346884012222, 0.013776666484773159, -0.012399844825267792, 0.0296650230884552, -0.0029521428514271975, 0.024664541706442833, -0.03919297084212303, 0.04811275005340576, -0.005595978815108538, 0.02792499028146267, 0.020069504156708717, 0.0027...
720,270
ete3.coretype.tree
_set_face_areas
null
def _set_face_areas(self, value): if isinstance(value, _FaceAreas): self._faces = value else: raise ValueError("[%s] is not a valid FaceAreas instance" %type(value))
(self, value)
[ 0.03104528598487377, -0.01924503780901432, -0.027263805270195007, -0.030015507712960243, -0.11243154108524323, 0.01826590485870838, 0.02493414282798767, 0.015986887738108635, -0.035518914461135864, 0.007343501318246126, 0.005212198011577129, 0.023397915065288544, -0.048787862062454224, 0.0...
720,271
ete3.clustering.clustertree
_set_forbidden
null
def _set_forbidden(self, value): raise ValueError("This attribute can not be manually set.")
(self, value)
[ 0.03043145127594471, 0.026423485949635506, 0.029154719784855843, 0.06270527094602585, -0.03075467422604561, -0.01769646257162094, 0.0355222150683403, -0.030140550807118416, 0.028443628922104836, -0.007325042504817247, 0.018052008002996445, 0.023546800017356873, 0.01682375930249691, 0.00109...
720,272
ete3.clustering.clustertree
_set_profile
null
def _set_profile(self, value): self._profile = value
(self, value)
[ -0.006027014926075935, 0.038012709468603134, -0.049316488206386566, 0.04451488330960274, -0.010303444229066372, -0.0010784855112433434, 0.030977021902799606, 0.018239431083202362, 0.024408159777522087, -0.028459513559937477, -0.033727943897247314, 0.043514546006917953, -0.004985000006854534,...
720,273
ete3.coretype.tree
_set_style
null
def _set_style(self, value): self.set_style(value)
(self, value)
[ 0.042293500155210495, 0.015864288434386253, -0.011942588724195957, 0.008409678936004639, -0.005468403920531273, -0.007746201474219561, 0.004266115836799145, 0.04611377418041229, 0.05987353250384331, 0.02723214589059353, -0.0384732224047184, 0.022228598594665527, 0.05098209157586098, -0.034...
720,274
ete3.coretype.tree
_set_support
null
def _set_support(self, value): try: self._support = float(value) except ValueError: raise TreeError('node support must be a float number')
(self, value)
[ 0.05195929482579231, 0.01606394164264202, 0.027199270203709602, 0.063587486743927, -0.0259295254945755, 0.03403250128030777, -0.0351518839597702, 0.03889428824186325, -0.03852672874927521, 0.025628795847296715, 0.05486634001135826, -0.006586801260709763, 0.0384599007666111, -0.006173298694...
720,275
ete3.coretype.tree
_set_up
null
def _set_up(self, value): if type(value) == type(self) or value is None: self._up = value else: raise TreeError("bad node_up type")
(self, value)
[ -0.011800277978181839, 0.010443245992064476, 0.017818419262766838, 0.05451728403568268, -0.07140854001045227, 0.0067430161871016026, 0.031624745577573776, 0.009330647997558117, 0.03342850133776665, -0.02149336412549019, 0.005356483161449432, 0.005862209480255842, 0.058832813054323196, 0.03...
720,276
ete3.coretype.tree
add_child
Adds a new child to this node. If child node is not suplied as an argument, a new node instance will be created. :argument None child: the node instance to be added as a child. :argument None name: the name that will be given to the child. :argument None dist: the distance from...
def add_child(self, child=None, name=None, dist=None, support=None): """ Adds a new child to this node. If child node is not suplied as an argument, a new node instance will be created. :argument None child: the node instance to be added as a child. :argument None name: the name that will be given t...
(self, child=None, name=None, dist=None, support=None)
[ 0.025713928043842316, 0.021045003086328506, -0.022247077897191048, 0.026445625349879265, -0.039128378033638, 0.04557428136467934, 0.013414448127150536, 0.08369221538305283, -0.02484286017715931, 0.0029746973887085915, 0.03205530345439911, 0.04930245131254196, 0.029407257214188576, -0.02254...
720,277
ete3.coretype.tree
add_face
.. versionadded: 2.1 Add a fixed face to the node. This type of faces will be always attached to nodes, independently of the layout function. :argument face: a Face or inherited instance :argument column: An integer number starting from 0 :argument "branch-rig...
def add_face(self, face, column, position="branch-right"): """ .. versionadded: 2.1 Add a fixed face to the node. This type of faces will be always attached to nodes, independently of the layout function. :argument face: a Face or inherited instance :argument column: An integer number start...
(self, face, column, position='branch-right')
[ 0.026084112003445625, -0.015186198055744171, -0.0003721238754224032, 0.03191405162215233, -0.030957162380218506, 0.02057313360273838, -0.002057756530120969, 0.06960488855838776, -0.02510950155556202, -0.026279034093022346, 0.047879938036203384, 0.0010814850684255362, -0.04327269271016121, ...
720,278
ete3.coretype.tree
add_feature
Add or update a node's feature.
def add_feature(self, pr_name, pr_value): """ Add or update a node's feature. """ setattr(self, pr_name, pr_value) self.features.add(pr_name)
(self, pr_name, pr_value)
[ 0.024364948272705078, -0.027040770277380943, 0.012780794873833656, 0.050790779292583466, -0.02203814499080181, 0.014658857136964798, -0.02837037295103073, 0.04786565527319908, 0.023899586871266365, 0.0017741870833560824, -0.010138211771845818, 0.0021855325903743505, 0.02559482865035534, 0....
720,279
ete3.coretype.tree
add_features
Add or update several features.
def add_features(self, **features): """ Add or update several features. """ for fname, fvalue in six.iteritems(features): setattr(self, fname, fvalue) self.features.add(fname)
(self, **features)
[ -0.004212043713778257, -0.045463599264621735, -0.012279612943530083, 0.030588019639253616, -0.032552074640989304, -0.024439673870801926, -0.024456752464175224, 0.07275542616844177, -0.012416242621839046, 0.042184483259916306, -0.04095481336116791, 0.023141689598560333, 0.0035118155647069216,...
720,280
ete3.coretype.tree
add_sister
Adds a sister to this node. If sister node is not supplied as an argument, a new TreeNode instance will be created and returned.
def add_sister(self, sister=None, name=None, dist=None): """ Adds a sister to this node. If sister node is not supplied as an argument, a new TreeNode instance will be created and returned. """ if self.up is None: raise TreeError("A parent node is required to add a sister") else: ...
(self, sister=None, name=None, dist=None)
[ -0.05893831327557564, 0.022023025900125504, 0.04253930598497391, 0.004031860735267401, -0.02072652243077755, 0.05483856052160263, 0.020288515836000443, 0.042889710515737534, -0.0023083004634827375, 0.053261734545230865, 0.03137886896729469, 0.03759858012199402, 0.0010369832161813974, 0.014...
720,281
ete3.coretype.tree
check_monophyly
.. versionadded: 2.2 Returns True if a given target attribute is monophyletic under this node for the provided set of values. If not all values are represented in the current tree structure, a ValueError exception will be raised to warn that strict monophyly could neve...
def check_monophyly(self, values, target_attr, ignore_missing=False, unrooted=False): """ .. versionadded: 2.2 Returns True if a given target attribute is monophyletic under this node for the provided set of values. If not all values are represented in the current tree struct...
(self, values, target_attr, ignore_missing=False, unrooted=False)
[ 0.05694890767335892, 0.015432323329150677, 0.059609297662973404, 0.037037573754787445, 0.0028292592614889145, -0.01652349717915058, -0.021989760920405388, -0.013665659353137016, -0.016970358788967133, -0.002699357457458973, -0.0032839151099324226, 0.03998894244432449, 0.09527511149644852, ...
720,282
ete3.coretype.tree
compare
compare this tree with another using robinson foulds symmetric difference and number of shared edges. Trees of different sizes and with duplicated items allowed. returns: a Python dictionary with results
def compare(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0, has_duplications=False, expand_polytomies=False, unrooted=False, max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name'): """compare this tree with another using robin...
(self, ref_tree, use_collateral=False, min_support_source=0.0, min_support_ref=0.0, has_duplications=False, expand_polytomies=False, unrooted=False, max_treeko_splits_to_be_artifact=1000, ref_tree_attr='name', source_tree_attr='name')
[ 0.007620314136147499, -0.06655829399824142, -0.02011723630130291, 0.004019506275653839, -0.02683611586689949, -0.013201320543885231, -0.030914733186364174, -0.02281660959124565, 0.011723560281097889, -0.027171075344085693, -0.018580365926027298, 0.0076400176621973515, 0.0014038716908544302, ...
720,283
ete3.coretype.tree
convert_to_ultrametric
.. versionadded: 2.1 Converts a tree into ultrametric topology (all leaves must have the same distance to root). Note that, for visual inspection of ultrametric trees, node.img_style["size"] should be set to 0.
def convert_to_ultrametric(self, tree_length=None, strategy='balanced'): """ .. versionadded: 2.1 Converts a tree into ultrametric topology (all leaves must have the same distance to root). Note that, for visual inspection of ultrametric trees, node.img_style["size"] should be set to 0. """ ...
(self, tree_length=None, strategy='balanced')
[ -0.028269140049815178, 0.02097269520163536, -0.019982725381851196, 0.009899699129164219, 0.015757020562887192, -0.004743605852127075, -0.039378803223371506, -0.025280898436903954, -0.059618186205625534, 0.034245625138282776, 0.004415907431393862, 0.027352500706911087, -0.030725732445716858, ...
720,284
ete3.coretype.tree
cophenetic_matrix
.. versionadded: 3.1.1 Generate a cophenetic distance matrix of the treee to standard output The `cophenetic matrix <https://en.wikipedia.org/wiki/Cophenetic>` is a matrix representation of the distance between each node. if we have a tree like ...
def cophenetic_matrix(self): """ .. versionadded: 3.1.1 Generate a cophenetic distance matrix of the treee to standard output The `cophenetic matrix <https://en.wikipedia.org/wiki/Cophenetic>` is a matrix representation of the distance between each node. if we have a tree like ...
(self)
[ -0.010900254361331463, 0.07027162611484528, 0.03020300529897213, 0.012582843191921711, 0.004958936478942633, -0.045440368354320526, -0.060949455946683884, -0.012279768474400043, -0.01447445061057806, -0.019166888669133186, -0.020556854084134102, 0.040068622678518295, -0.013408461585640907, ...
720,285
ete3.coretype.tree
copy
.. versionadded: 2.1 Returns a copy of the current node. :var cpickle method: Protocol used to copy the node structure. The following values are accepted: - "newick": Tree topology, node names, branch lengths and branch support values will be copied by as represented i...
def copy(self, method="cpickle"): """.. versionadded: 2.1 Returns a copy of the current node. :var cpickle method: Protocol used to copy the node structure. The following values are accepted: - "newick": Tree topology, node names, branch lengths and branch support values will be copied b...
(self, method='cpickle')
[ 0.004833829123526812, -0.0265397597104311, 0.07197034358978271, -0.0023798737674951553, -0.06367319822311401, 0.006468256004154682, -0.025798942893743515, 0.03678154945373535, 0.06282126158475876, 0.009917683899402618, -0.009852862916886806, 0.010991868562996387, 0.0009665343095548451, 0.0...
720,286
ete3.coretype.tree
del_feature
Permanently deletes a node's feature.
def del_feature(self, pr_name): """ Permanently deletes a node's feature. """ if hasattr(self, pr_name): delattr(self, pr_name) self.features.remove(pr_name)
(self, pr_name)
[ 0.05065092071890831, 0.0007081404328346252, 0.027427639812231064, 0.01939963363111019, -0.03120162896811962, -0.0027166935615241528, -0.03393280506134033, 0.0840209424495697, 0.03936205431818962, 0.025772379711270332, -0.022114258259534836, 0.017049165442585945, 0.014375923201441765, 0.013...
720,287
ete3.coretype.tree
delete
Deletes node from the tree structure. Notice that this method makes 'disappear' the node from the tree structure. This means that children from the deleted node are transferred to the next available parent. :param True prevent_nondicotomic: When True (default), delete ...
def delete(self, prevent_nondicotomic=True, preserve_branch_length=False): """ Deletes node from the tree structure. Notice that this method makes 'disappear' the node from the tree structure. This means that children from the deleted node are transferred to the next available parent. :param Tru...
(self, prevent_nondicotomic=True, preserve_branch_length=False)
[ 0.035140905529260635, 0.06051039695739746, 0.01032331958413124, 0.006161420606076717, 0.006668086629360914, -0.0023433302994817495, -0.060618966817855835, 0.033150434494018555, 0.0015052956296131015, 0.0038610664196312428, -0.016566168516874313, 0.01124617550522089, 0.00033758883364498615, ...
720,288
ete3.coretype.tree
describe
Prints general information about this node and its connections.
def describe(self): """ Prints general information about this node and its connections. """ if len(self.get_tree_root().children)==2: rooting = "Yes" elif len(self.get_tree_root().children)>2: rooting = "No" else: rooting = "No children" max_node, max_dist = self....
(self)
[ 0.027054719626903534, -0.020509224385023117, 0.04720030352473259, -0.013872817158699036, 0.05065487325191498, 0.023418333381414413, -0.008486418053507805, -0.020309222862124443, 0.003604568773880601, -0.06040038913488388, -0.03376385569572449, 0.03534568473696709, -0.010281885042786598, -0...
720,289
ete3.coretype.tree
detach
Detachs this node (and all its descendants) from its parent and returns the referent to itself. Detached node conserves all its structure of descendants, and can be attached to another node through the 'add_child' function. This mechanism can be seen as a cut and paste. ...
def detach(self): """ Detachs this node (and all its descendants) from its parent and returns the referent to itself. Detached node conserves all its structure of descendants, and can be attached to another node through the 'add_child' function. This mechanism can be seen as a cut and paste. ...
(self)
[ 0.017368488013744354, 0.014204942621290684, 0.015188565477728844, 0.012432647868990898, -0.08507014811038971, 0.009712175466120243, -0.013478301465511322, 0.03624342754483223, 0.06415706872940063, 0.043952908366918564, -0.03803344443440437, -0.04973059147596359, 0.02550332061946392, 0.0517...
720,290
ete3.coretype.tree
expand_polytomies
.. versionadded:: 2.3 Given a tree with one or more polytomies, this functions returns the list of all trees (in newick format) resulting from the combination of all possible solutions of the multifurcated nodes. .. warning: Please note that the number of of possib...
def expand_polytomies(self, map_attr="name", polytomy_size_limit=5, skip_large_polytomies=False): ''' .. versionadded:: 2.3 Given a tree with one or more polytomies, this functions returns the list of all trees (in newick format) resulting from the combination of all possible s...
(self, map_attr='name', polytomy_size_limit=5, skip_large_polytomies=False)
[ 0.03550601005554199, 0.006431780755519867, 0.03327767550945282, 0.052706532180309296, -0.03999950736761093, -0.006708020810037851, -0.04412468895316124, -0.05141741409897804, -0.009010017849504948, -0.009926212951540947, 0.023240966722369194, 0.026058610528707504, -0.0333697535097599, 0.05...
720,291
ete3.coretype.tree
from_parent_child_table
Converts a parent-child table into an ETE Tree instance. :argument parent_child_table: a list of tuples containing parent-child relationships. For example: [("A", "B", 0.1), ("A", "C", 0.2), ("C", "D", 1), ("C", "E", 1.5)]. Where each tuple represents: [parent, child, child-par...
@staticmethod def from_parent_child_table(parent_child_table): """Converts a parent-child table into an ETE Tree instance. :argument parent_child_table: a list of tuples containing parent-child relationships. For example: [("A", "B", 0.1), ("A", "C", 0.2), ("C", "D", 1), ("C", "E", 1.5)]. Where ea...
(parent_child_table)
[ 0.03668390214443207, -0.02621343359351158, -0.005025638733059168, -0.04083855450153351, -0.06554289907217026, 0.01819290593266487, 0.008425746113061905, 0.06118330731987953, 0.027368538081645966, -0.04046593979001045, -0.00952495913952589, 0.0434468574821949, -0.03496987372636795, 0.047098...
720,292
ete3.coretype.tree
from_skbio
Converts a scikit-bio TreeNode object into ETE Tree object. :argument skbio_tree: a scikit bio TreeNode instance :argument None map_attributes: A list of attribute nanes in the scikit-bio tree that should be mapped into the ETE tree instance. (name, id and branch length are alway...
@staticmethod def from_skbio(skbio_tree, map_attributes=None): """Converts a scikit-bio TreeNode object into ETE Tree object. :argument skbio_tree: a scikit bio TreeNode instance :argument None map_attributes: A list of attribute nanes in the scikit-bio tree that should be mapped into the ETE tree ...
(skbio_tree, map_attributes=None)
[ 0.03633960708975792, -0.03918357565999031, 0.013048799708485603, -0.05070815607905388, -0.04687902331352234, -0.024722084403038025, -0.007830209098756313, 0.011952105909585953, 0.013541382737457752, -0.029554974287748337, 0.020484013482928276, 0.018058275803923607, -0.040187329053878784, 0...
720,293
ete3.coretype.tree
get_ancestors
versionadded: 2.2 Returns the list of all ancestor nodes from current node to the current tree root.
def get_ancestors(self): '''versionadded: 2.2 Returns the list of all ancestor nodes from current node to the current tree root. ''' return [n for n in self.iter_ancestors()]
(self)
[ -0.0442793183028698, -0.056114986538887024, 0.036272838711738586, 0.013915611431002617, -0.04480148106813431, 0.028318574652075768, -0.001088924938812852, -0.01864117570221424, 0.05096299201250076, 0.04215586185455322, -0.007266751490533352, -0.07331151515245438, -0.0011705126380547881, 0....
720,294
ete3.coretype.tree
get_ascii
Returns a string containing an ascii drawing of the tree. :argument show_internal: includes internal edge names. :argument compact: use exactly one line per tip. :param attributes: A list of node attributes to shown in the ASCII representation.
def get_ascii(self, show_internal=True, compact=False, attributes=None): """ Returns a string containing an ascii drawing of the tree. :argument show_internal: includes internal edge names. :argument compact: use exactly one line per tip. :param attributes: A list of node attributes to shown in the ...
(self, show_internal=True, compact=False, attributes=None)
[ -0.03327168896794319, -0.0051216441206634045, 0.08410812169313431, 0.018206538632512093, 0.03445393219590187, -0.07181280106306076, -0.0365481898188591, -0.011957540176808834, 0.03114365041255951, -0.036142848432064056, 0.004374298267066479, 0.013258007355034351, 0.02095947414636612, 0.057...
720,295
ete3.coretype.tree
get_cached_content
.. versionadded: 2.2 Returns a dictionary pointing to the preloaded content of each internal node under this tree. Such a dictionary is intended to work as a cache for operations that require many traversal operations. :param None store_attr: Specifies the node attribu...
def get_cached_content(self, store_attr=None, container_type=set, leaves_only=True, _store=None): """ .. versionadded: 2.2 Returns a dictionary pointing to the preloaded content of each internal node under this tree. Such a dictionary is intended to work as a cache for operations that require many t...
(self, store_attr=None, container_type=<class 'set'>, leaves_only=True, _store=None)
[ 0.007845788262784481, -0.0211263969540596, 0.006372168194502592, 0.032969437539577484, 0.04600219056010246, 0.08962495625019073, 0.005763792898505926, 0.009652888402342796, 0.04250515624880791, -0.029400302097201347, 0.049895789474248886, 0.04257725924253464, -0.0023478781804442406, 0.0196...
720,296
ete3.coretype.tree
get_children
Returns an independent list of node's children.
def get_children(self): """ Returns an independent list of node's children. """ return [ch for ch in self.children]
(self)
[ -0.005657023284584284, -0.02186495065689087, -0.009281955659389496, -0.02417212910950184, -0.03363155946135521, 0.0893765315413475, 0.015608947724103928, 0.04532717913389206, 0.09001544117927551, 0.0032389231491833925, 0.027615148574113846, -0.006886039394885302, 0.04184866324067116, 0.019...
720,297
ete3.coretype.tree
get_closest_leaf
Returns node's closest descendant leaf and the distance to it. :argument False topology_only: If set to True, distance between nodes will be referred to the number of nodes between them. In other words, topological distance will be used instead of branch length distances. ...
def get_closest_leaf(self, topology_only=False, is_leaf_fn=None): """Returns node's closest descendant leaf and the distance to it. :argument False topology_only: If set to True, distance between nodes will be referred to the number of nodes between them. In other words, topological distance wil...
(self, topology_only=False, is_leaf_fn=None)
[ 0.044416651129722595, 0.009437632746994495, 0.05416222661733627, -0.005669825244694948, -0.008319064974784851, 0.016139982268214226, 0.004845617339015007, 0.020867854356765747, -0.0000385639832529705, -0.011928370222449303, -0.005964185111224651, 0.02639276534318924, -0.01943681389093399, ...
720,298
ete3.coretype.tree
get_common_ancestor
Returns the first common ancestor between this node and a given list of 'target_nodes'. **Examples:** :: t = tree.Tree("(((A:0.1, B:0.01):0.001, C:0.0001):1.0[&&NHX:name=common], (D:0.00001):0.000001):2.0[&&NHX:name=root];") A = t.get_descendants_by_name("A")[0] ...
def get_common_ancestor(self, *target_nodes, **kargs): """ Returns the first common ancestor between this node and a given list of 'target_nodes'. **Examples:** :: t = tree.Tree("(((A:0.1, B:0.01):0.001, C:0.0001):1.0[&&NHX:name=common], (D:0.00001):0.000001):2.0[&&NHX:name=root];") A = ...
(self, *target_nodes, **kargs)
[ -0.03490477427840233, -0.0535372830927372, -0.01070745661854744, 0.03252533823251724, -0.0493924617767334, 0.006509865168482065, 0.009498550556600094, 0.042561180889606476, 0.10584647208452225, -0.027152422815561295, 0.008160118013620377, -0.01227135956287384, 0.015600649639964104, 0.00246...
720,299
ete3.coretype.tree
get_descendants
Returns a list of all (leaves and internal) descendant nodes. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation.
def get_descendants(self, strategy="levelorder", is_leaf_fn=None): """ Returns a list of all (leaves and internal) descendant nodes. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation. """ return [n for n in self.iter_descendants(strategy=strategy, \ ...
(self, strategy='levelorder', is_leaf_fn=None)
[ -0.0028378204442560673, 0.0033746433909982443, 0.016591040417551994, -0.0433863066136837, 0.00853869691491127, 0.04713030159473419, -0.021197624504566193, 0.007529286202043295, 0.028245145455002785, -0.0012732339091598988, 0.027143970131874084, -0.01051622349768877, -0.029181145131587982, ...
720,300
ete3.coretype.tree
get_distance
Returns the distance between two nodes. If only one target is specified, it returns the distance between the target and the current node. :argument target: a node within the same tree structure. :argument target2: a node within the same tree structure. If not specifi...
def get_distance(self, target, target2=None, topology_only=False): """ Returns the distance between two nodes. If only one target is specified, it returns the distance between the target and the current node. :argument target: a node within the same tree structure. :argument target2: a node with...
(self, target, target2=None, topology_only=False)
[ 0.015446830540895462, 0.004956752061843872, 0.03872434422373772, 0.026584995910525322, -0.02202603593468666, -0.0022884192876517773, -0.01946944184601307, 0.024689899757504463, -0.02098909579217434, 0.03582806512713432, -0.02156120166182518, -0.015571978874504566, 0.04512476921081543, -0.0...
720,301
ete3.clustering.clustertree
get_dunn
Calculates the Dunn index for the given set of descendant nodes.
def get_dunn(self, clusters, fdist=None): """ Calculates the Dunn index for the given set of descendant nodes. """ if fdist is None: fdist = self._fdist nodes = _translate_nodes(self, *clusters) return clustvalidation.get_dunn_index(fdist, *nodes)
(self, clusters, fdist=None)
[ -0.0005691074184142053, 0.03256037086248398, 0.040862128138542175, -0.005413620267063379, -0.0031262675765901804, 0.022912854328751564, 0.002868476090952754, 0.024485819041728973, -0.038415294140577316, 0.018753236159682274, -0.03542666137218475, 0.0592832937836647, -0.04914641007781029, -...
720,302
ete3.coretype.tree
get_edges
.. versionadded:: 2.3 Returns the list of edges of a tree. Each edge is represented as a tuple of two elements, each containing the list of nodes separated by the edge.
def get_edges(self, cached_content = None): ''' .. versionadded:: 2.3 Returns the list of edges of a tree. Each edge is represented as a tuple of two elements, each containing the list of nodes separated by the edge. ''' return [edge for edge in self.iter_edges(cached_content)]
(self, cached_content=None)
[ 0.006419183220714331, -0.04113095998764038, 0.009929942898452282, -0.029273539781570435, -0.018741261214017868, 0.03300802409648895, 0.004414264112710953, 0.030323326587677002, 0.07730554789304733, -0.03130427375435829, 0.04784270375967026, 0.027827933430671692, -0.05090601369738579, -0.00...
720,303
ete3.coretype.tree
get_farthest_leaf
Returns node's farthest descendant node (which is always a leaf), and the distance to it. :argument False topology_only: If set to True, distance between nodes will be referred to the number of nodes between them. In other words, topological distance will be used ...
def get_farthest_leaf(self, topology_only=False, is_leaf_fn=None): """ Returns node's farthest descendant node (which is always a leaf), and the distance to it. :argument False topology_only: If set to True, distance between nodes will be referred to the number of nodes between them. In othe...
(self, topology_only=False, is_leaf_fn=None)
[ 0.03745819255709648, 0.016881544142961502, 0.050861991941928864, -0.001412833109498024, 0.0025313259102404118, 0.021717781201004982, -0.01016153022646904, 0.011556250043213367, 0.0027441566344350576, -0.0166279599070549, 0.015704182907938957, 0.046297453343868256, -0.04263857752084732, -0....
720,304
ete3.coretype.tree
get_farthest_node
Returns the node's farthest descendant or ancestor node, and the distance to it. :argument False topology_only: If set to True, distance between nodes will be referred to the number of nodes between them. In other words, topological distance will be used instead o...
def get_farthest_node(self, topology_only=False): """ Returns the node's farthest descendant or ancestor node, and the distance to it. :argument False topology_only: If set to True, distance between nodes will be referred to the number of nodes between them. In other words, topological dista...
(self, topology_only=False)
[ 0.030602537095546722, 0.0022903394419699907, 0.024873800575733185, 0.025261877104640007, 0.00757209537550807, 0.009997568093240261, -0.00993288867175579, 0.00993288867175579, -0.007599814794957638, -0.006357048638164997, -0.003428001655265689, 0.04198608919978142, -0.039768513292074203, -0...
720,305
ete3.coretype.tree
get_leaf_names
Returns the list of terminal node names under the current node. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation.
def get_leaf_names(self, is_leaf_fn=None): """ Returns the list of terminal node names under the current node. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation. """ return [name for name in self.iter_leaf_names(is_leaf_fn=is_leaf_fn)]
(self, is_leaf_fn=None)
[ -0.009339557960629463, 0.009913891553878784, 0.057292044162750244, -0.011619222350418568, 0.010877006687223911, 0.06160397082567215, -0.004634435288608074, 0.019668737426400185, 0.07097003608942032, -0.04315458983182907, 0.041846875101327896, -0.03483115881681442, 0.004634435288608074, -0....
720,306
ete3.clustering.clustertree
get_leaf_profiles
Returns the list of all the profiles associated to the leaves under this node.
def get_leaf_profiles(self): """ Returns the list of all the profiles associated to the leaves under this node.""" return [l.get_profile()[0] for l in self.iter_leaves()]
(self)
[ -0.00994486641138792, 0.0010871930280700326, 0.026514023542404175, 0.030727950856089592, 0.010619094595313072, 0.03020542301237583, 0.02184499427676201, -0.016636580228805542, 0.0598040409386158, -0.003211011877283454, 0.021794427186250687, -0.008832389488816261, -0.004378269426524639, 0.0...
720,307
ete3.coretype.tree
get_leaves
Returns the list of terminal nodes (leaves) under this node. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation.
def get_leaves(self, is_leaf_fn=None): """ Returns the list of terminal nodes (leaves) under this node. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation. """ return [n for n in self.iter_leaves(is_leaf_fn=is_leaf_fn)]
(self, is_leaf_fn=None)
[ 0.014533646404743195, 0.021065322682261467, 0.07160783559083939, -0.015986120328307152, 0.019586116075515747, 0.05599597468972206, -0.02079799585044384, 0.011913848109543324, 0.032596003264188766, -0.003550986060872674, 0.020815817639231682, -0.02227720245718956, -0.014551468193531036, -0....
720,308
ete3.coretype.tree
get_leaves_by_name
Returns a list of leaf nodes matching a given name.
def get_leaves_by_name(self, name): """ Returns a list of leaf nodes matching a given name. """ return self.search_nodes(name=name, children=[])
(self, name)
[ 0.03666790947318077, -0.017067518085241318, 0.028431886807084084, 0.007917315699160099, -0.03680209815502167, 0.03670145571231842, -0.05280447006225586, 0.004352846182882786, 0.097557432949543, -0.03349762782454491, 0.030780242756009102, -0.001098695327527821, -0.008898593485355377, -0.017...
720,309
ete3.coretype.tree
get_midpoint_outgroup
Returns the node that divides the current tree into two distance-balanced partitions.
def get_midpoint_outgroup(self): """ Returns the node that divides the current tree into two distance-balanced partitions. """ # Gets the farthest node to the current root root = self.get_tree_root() nA, r2A_dist = root.get_farthest_leaf() nB, A2B_dist = nA.get_farthest_node() outgro...
(self)
[ 0.01758366823196411, 0.008939709514379501, -0.034683384001255035, 0.04212193563580513, 0.0152714429423213, 0.02193925529718399, 0.03566921502351761, 0.005641650874167681, -0.02731652371585369, -0.014393155463039875, -0.006103199906647205, -0.010145113803446293, -0.008903861045837402, -0.02...
720,310
ete3.coretype.tree
get_monophyletic
.. versionadded:: 2.2 Returns a list of nodes matching the provided monophyly criteria. For a node to be considered a match, all `target_attr` values within and node, and exclusively them, should be grouped. :param values: a set of values for which monophyly is ...
def get_monophyletic(self, values, target_attr): """ .. versionadded:: 2.2 Returns a list of nodes matching the provided monophyly criteria. For a node to be considered a match, all `target_attr` values within and node, and exclusively them, should be grouped. :param values: a set of values ...
(self, values, target_attr)
[ 0.07555539160966873, 0.007794384378939867, 0.03396710753440857, -0.02539784274995327, 0.026345930993556976, -0.0026254768017679453, -0.03378478065133095, -0.004220818635076284, 0.039965592324733734, 0.031177537515759468, -0.00849633477628231, 0.04652928560972214, 0.09451716393232346, -0.02...
720,311
ete3.clustering.clustertree
get_silhouette
Calculates the node's silhouette value by using a given distance function. By default, euclidean distance is used. It also calculates the deviation profile, mean profile, and inter/intra-cluster distances. It sets the following features into the analyzed node: - node.intracl...
def get_silhouette(self, fdist=None): """ Calculates the node's silhouette value by using a given distance function. By default, euclidean distance is used. It also calculates the deviation profile, mean profile, and inter/intra-cluster distances. It sets the following features into the analyzed nod...
(self, fdist=None)
[ 0.01990000158548355, 0.0014382648514583707, 0.027296138927340508, -0.008833257481455803, 0.008883602917194366, -0.010004922747612, -0.002984084887430072, -0.01129558589309454, -0.04071536660194397, 0.022627785801887512, -0.03128712251782417, 0.02260947786271572, -0.04020276293158531, -0.00...
720,312
ete3.coretype.tree
get_sisters
Returns an independent list of sister nodes.
def get_sisters(self): """ Returns an independent list of sister nodes. """ if self.up is not None: return [ch for ch in self.up.children if ch!=self] else: return []
(self)
[ -0.04766794294118881, -0.00909383688122034, 0.0266348198056221, 0.005967412609606981, -0.04966599866747856, 0.04021090641617775, 0.00702442042529583, 0.031308844685554504, 0.04641915485262871, 0.0433507114648819, -0.000629967893473804, 0.010935796424746513, 0.00957105215638876, 0.016921048...
720,313
ete3.coretype.tree
get_topology_id
.. versionadded:: 2.3 Returns the unique ID representing the topology of the current tree. Two trees with the same topology will produce the same id. If trees are unrooted, make sure that the root node is not binary or use the tree.unroot() function before generating the topolo...
def get_topology_id(self, attr="name"): ''' .. versionadded:: 2.3 Returns the unique ID representing the topology of the current tree. Two trees with the same topology will produce the same id. If trees are unrooted, make sure that the root node is not binary or use the tree.unroot() function be...
(self, attr='name')
[ 0.028617139905691147, 0.052193865180015564, 0.06150767579674721, 0.03334709256887436, 0.030406851321458817, -0.01975988782942295, 0.010199535638093948, -0.0039035824593156576, -0.03941020369529724, -0.005054112058132887, -0.023777609691023827, -0.01800670102238655, -0.004816701170057058, 0...
720,314
ete3.coretype.tree
get_tree_root
Returns the absolute root node of current tree structure.
def get_tree_root(self): """ Returns the absolute root node of current tree structure. """ root = self while root.up is not None: root = root.up return root
(self)
[ -0.001486435765400529, 0.009174181148409843, 0.01161189191043377, 0.0453641414642334, 0.005788471549749374, 0.025862453505396843, 0.013883594423532486, 0.029584549367427826, 0.06388724595308304, -0.011297348886728287, -0.001851218636147678, -0.049068763852119446, -0.013569050468504429, 0.0...
720,315
ete3.coretype.tree
is_leaf
Return True if current node is a leaf.
def is_leaf(self): """ Return True if current node is a leaf. """ return len(self.children) == 0
(self)
[ 0.03929542005062103, 0.004659681115299463, 0.048688165843486786, 0.033920276910066605, -0.029572464525699615, 0.02252790704369545, -0.017739810049533844, 0.06901464611291885, 0.0014607366174459457, -0.0036782128736376762, 0.01490547601133585, -0.014712851494550705, 0.04645004868507385, -0....
720,316
ete3.coretype.tree
is_root
Returns True if current node has no parent
def is_root(self): """ Returns True if current node has no parent """ if self.up is None: return True else: return False
(self)
[ 0.0040189353749156, 0.002814776264131069, 0.04778381437063217, 0.036272574216127396, -0.019631706178188324, 0.045001640915870667, 0.003923298325389624, 0.055504344403743744, 0.05039210245013237, 0.028552046045660973, 0.008281311020255089, -0.04437565430998802, 0.038150541484355927, 0.00863...
720,317
ete3.coretype.tree
iter_ancestors
versionadded: 2.2 Iterates over the list of all ancestor nodes from current node to the current tree root.
def iter_ancestors(self): '''versionadded: 2.2 Iterates over the list of all ancestor nodes from current node to the current tree root. ''' node = self while node.up is not None: yield node.up node = node.up
(self)
[ -0.04212396964430809, -0.06580594182014465, -0.0015545547939836979, 0.022269900888204575, -0.058898698538541794, 0.008787169121205807, -0.0049677700735628605, -0.0007980118971318007, 0.0412052720785141, 0.04123929888010025, -0.020891854539513588, -0.035556986927986145, 0.007919509895145893, ...
720,318
ete3.coretype.tree
iter_descendants
Returns an iterator over all descendant nodes. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation.
def iter_descendants(self, strategy="levelorder", is_leaf_fn=None): """ Returns an iterator over all descendant nodes. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation. """ for n in self.traverse(strategy=strategy, is_leaf_fn=is_leaf_fn): if n is not self: ...
(self, strategy='levelorder', is_leaf_fn=None)
[ -0.0032401718199253082, -0.023980358615517616, -0.01863374374806881, -0.053289685398340225, -0.013154788874089718, 0.03354426845908165, -0.03156796470284462, 0.021809950470924377, 0.027156565338373184, 0.01710740104317665, 0.007856699638068676, 0.01721327379345894, -0.028797606006264687, 0...
720,319
ete3.coretype.tree
iter_edges
.. versionadded:: 2.3 Iterate over the list of edges of a tree. Each edge is represented as a tuple of two elements, each containing the list of nodes separated by the edge.
def iter_edges(self, cached_content = None): ''' .. versionadded:: 2.3 Iterate over the list of edges of a tree. Each edge is represented as a tuple of two elements, each containing the list of nodes separated by the edge. ''' if not cached_content: cached_content = self.get_cached_c...
(self, cached_content=None)
[ 0.012513015419244766, -0.0370769165456295, -0.0020295879803597927, -0.012841837480664253, -0.02278648503124714, 0.0012186415260657668, 0.006140975747257471, 0.04852348193526268, 0.06615546345710754, -0.024475032463669777, 0.019089458510279655, 0.05499328300356865, -0.04866567626595497, 0.0...
720,320
ete3.coretype.tree
iter_leaf_names
Returns an iterator over the leaf names under this node. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation.
def iter_leaf_names(self, is_leaf_fn=None): """ Returns an iterator over the leaf names under this node. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation. """ for n in self.iter_leaves(is_leaf_fn=is_leaf_fn): yield n.name
(self, is_leaf_fn=None)
[ 0.00341580412350595, -0.007112419698387384, 0.023623237386345863, -0.013707093894481659, -0.0022750089410692453, 0.03801480680704117, -0.02723868004977703, 0.042191874235868454, 0.07862711697816849, -0.04847502335906029, 0.025132596492767334, -0.0063489642925560474, 0.004765014164149761, -...
720,321
ete3.clustering.clustertree
iter_leaf_profiles
Returns an iterator over all the profiles associated to the leaves under this node.
def iter_leaf_profiles(self): """ Returns an iterator over all the profiles associated to the leaves under this node.""" for l in self.iter_leaves(): yield l.get_profile()[0]
(self)
[ -0.0016452367417514324, -0.0052942875772714615, -0.008799906820058823, 0.03108231909573078, -0.007125140633434057, 0.010951370932161808, -0.002674564253538847, -0.0002723605139181018, 0.06165841221809387, -0.007572307717055082, 0.008399144746363163, 0.005783639848232269, -0.00031164579559117...
720,322
ete3.coretype.tree
iter_leaves
Returns an iterator over the leaves under this node. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation.
def iter_leaves(self, is_leaf_fn=None): """ Returns an iterator over the leaves under this node. :argument None is_leaf_fn: See :func:`TreeNode.traverse` for documentation. """ for n in self.traverse(strategy="preorder", is_leaf_fn=is_leaf_fn): if not is_leaf_fn: if n.is_le...
(self, is_leaf_fn=None)
[ 0.010257338173687458, 0.01471744105219841, 0.012886734679341316, -0.022488968446850777, 0.0018250973662361503, 0.037798695266246796, -0.02898618020117283, 0.025701677426695824, 0.03198351338505745, -0.007129882462322712, -0.0012687062844634056, -0.0024813245981931686, -0.01370337326079607, ...
720,323
ete3.coretype.tree
iter_prepostorder
Iterate over all nodes in a tree yielding every node in both pre and post order. Each iteration returns a postorder flag (True if node is being visited in postorder) and a node instance.
def iter_prepostorder(self, is_leaf_fn=None): """ Iterate over all nodes in a tree yielding every node in both pre and post order. Each iteration returns a postorder flag (True if node is being visited in postorder) and a node instance. """ to_visit = [self] if is_leaf_fn is not None: ...
(self, is_leaf_fn=None)
[ -0.026659606024622917, 0.02055239863693714, -0.03869117051362991, -0.032181691378355026, -0.022344334051012993, 0.022344334051012993, 0.017187949270009995, 0.01144644245505333, 0.0313405804336071, -0.036332398653030396, -0.004660402424633503, -0.010669328272342682, -0.04201905056834221, 0....
720,324
ete3.coretype.tree
iter_search_nodes
Search nodes in an iterative way. Matches are yielded as they are being found. This avoids needing to scan the full tree topology before returning the first matches. Useful when dealing with huge trees.
def iter_search_nodes(self, **conditions): """ Search nodes in an iterative way. Matches are yielded as they are being found. This avoids needing to scan the full tree topology before returning the first matches. Useful when dealing with huge trees. """ for n in self.traverse(): cond...
(self, **conditions)
[ 0.01544166449457407, -0.04171989485621452, -0.034648727625608444, -0.009046676568686962, -0.0026980929542332888, 0.047376830130815506, -0.015715673565864563, -0.007853416725993156, 0.07003992795944214, -0.0243778545409441, -0.01552121527493, 0.044689785689115524, 0.027595236897468567, 0.01...
720,325
ete3.coretype.tree
ladderize
.. versionadded: 2.1 Sort the branches of a given tree (swapping children nodes) according to the size of each partition. :: t = Tree("(f,((d, ((a,b),c)),e));") print t # # /-f # | # | /-d ...
def ladderize(self, direction=0): """ .. versionadded: 2.1 Sort the branches of a given tree (swapping children nodes) according to the size of each partition. :: t = Tree("(f,((d, ((a,b),c)),e));") print t # # /-f # | # | /-d #...
(self, direction=0)
[ -0.03803946450352669, 0.04088791459798813, -0.02473466470837593, 0.007612399756908417, 0.011952684260904789, 0.019903112202882767, 0.02421184815466404, 0.02103888802230358, -0.024824805557727814, -0.03571382910013199, -0.0245183277875185, 0.007576343137770891, 0.005561694037169218, 0.01601...
720,326
ete3.clustering.clustertree
link_to_arraytable
Allows to link a given arraytable object to the tree structure under this node. Row names in the arraytable object are expected to match leaf names. Returns a list of nodes for with profiles could not been found in arraytable.
def link_to_arraytable(self, arraytbl): """ Allows to link a given arraytable object to the tree structure under this node. Row names in the arraytable object are expected to match leaf names. Returns a list of nodes for with profiles could not been found in arraytable. """ # Initialize tree...
(self, arraytbl)
[ -0.013567280024290085, 0.0032456209883093834, 0.0029644686728715897, 0.03237073868513107, -0.032208796590566635, 0.008394080214202404, -0.0525057353079319, -0.026990611106157303, -0.02200634405016899, -0.04491237550973892, -0.011354049667716026, -0.026864653453230858, -0.01211878377944231, ...
720,327
ete3.coretype.tree
phonehome
null
def phonehome(self): from .. import _ph _ph.call()
(self)
[ 0.003682973561808467, -0.03465143218636513, 0.012070919387042522, 0.04042666777968407, -0.0347185842692852, -0.03730401024222374, 0.0008782475488260388, 0.0277009978890419, -0.03164629265666008, -0.030857233330607414, 0.01759433187544346, 0.010853754356503487, 0.03955366834998131, 0.003733...
720,328
ete3.coretype.tree
populate
Generates a random topology by populating current node. :argument None names_library: If provided, names library (list, set, dict, etc.) will be used to name nodes. :argument False reuse_names: If True, node names will not be necessarily unique, which makes the process a b...
def populate(self, size, names_library=None, reuse_names=False, random_branches=False, branch_range=(0,1), support_range=(0,1)): """ Generates a random topology by populating current node. :argument None names_library: If provided, names library (list, set, dict, etc.) will b...
(self, size, names_library=None, reuse_names=False, random_branches=False, branch_range=(0, 1), support_range=(0, 1))
[ 0.012737775221467018, 0.0010001250775530934, -0.07221416383981705, -0.0656857118010521, -0.01077741663902998, 0.05109699070453644, -0.062366776168346405, -0.013430739752948284, -0.02848447486758232, -0.017415283247828484, -0.011379200965166092, 0.06681633740663528, 0.015372863039374352, 0....
720,329
ete3.coretype.tree
prune
Prunes the topology of a node to conserve only the selected list of leaf internal nodes. The minimum number of nodes that conserve the topological relationships among the requested nodes will be retained. Root node is always conserved. :var nodes: a list of node names or node objects th...
def prune(self, nodes, preserve_branch_length=False): """Prunes the topology of a node to conserve only the selected list of leaf internal nodes. The minimum number of nodes that conserve the topological relationships among the requested nodes will be retained. Root node is always conserved. :var no...
(self, nodes, preserve_branch_length=False)
[ 0.002856008242815733, 0.03858212009072304, -0.03023950569331646, -0.006405583117157221, -0.025443987920880318, -0.025959208607673645, -0.031012335792183876, 0.007634187117218971, 0.04407120496034622, -0.016120469197630882, -0.023323655128479004, 0.014307288452982903, -0.013138133101165295, ...
720,330
ete3.coretype.tree
remove_child
Removes a child from this node (parent and child nodes still exit but are no longer connected).
def remove_child(self, child): """ Removes a child from this node (parent and child nodes still exit but are no longer connected). """ try: self.children.remove(child) except ValueError as e: raise TreeError("child not found") else: child.up = None return chil...
(self, child)
[ 0.0038867222610861063, 0.014148395508527756, 0.022303247824311256, 0.01670927368104458, -0.06414908170700073, -0.007382956333458424, -0.001878658076748252, 0.1259007453918457, 0.06905288994312286, -0.0339997373521328, -0.012186871841549873, 0.050418417900800705, 0.028097007423639297, -0.01...
720,331
ete3.coretype.tree
remove_sister
Removes a sister node. It has the same effect as **`TreeNode.up.remove_child(sister)`** If a sister node is not supplied, the first sister will be deleted and returned. :argument sister: A node instance :return: The node removed
def remove_sister(self, sister=None): """ Removes a sister node. It has the same effect as **`TreeNode.up.remove_child(sister)`** If a sister node is not supplied, the first sister will be deleted and returned. :argument sister: A node instance :return: The node removed """ sisters =...
(self, sister=None)
[ -0.035967983305454254, 0.023512765765190125, 0.061886873096227646, -0.010208326391875744, -0.0449378676712513, 0.025388125330209732, -0.015569024719297886, 0.08577117323875427, 0.04108099266886711, 0.05803000181913376, 0.007762397173792124, 0.03469415381550789, -0.005179354455322027, 0.006...
720,332
ete3.coretype.tree
render
Renders the node structure as an image. :var file_name: path to the output image file. valid extensions are .SVG, .PDF, .PNG :var layout: a layout function or a valid layout function name :var tree_style: a `TreeStyle` instance containing the image properties ...
def render(self, file_name, layout=None, w=None, h=None, \ tree_style=None, units="px", dpi=90): """ Renders the node structure as an image. :var file_name: path to the output image file. valid extensions are .SVG, .PDF, .PNG :var layout: a layout function or a valid layout func...
(self, file_name, layout=None, w=None, h=None, tree_style=None, units='px', dpi=90)
[ 0.045577842742204666, -0.07243876904249191, 0.020824359729886055, 0.011537338607013226, 0.0017223407048732042, -0.018324008211493492, -0.0630803108215332, -0.022038817405700684, -0.014260935597121716, -0.010403250344097614, 0.06286599487066269, -0.023664046078920364, 0.042255949229002, 0.0...
720,333
ete3.coretype.tree
resolve_polytomy
.. versionadded: 2.2 Resolve all polytomies under current node by creating an arbitrary dicotomic structure among the affected nodes. This function randomly modifies current tree topology and should only be used for compatibility reasons (i.e. programs rejecting multifu...
def resolve_polytomy(self, default_dist=0.0, default_support=0.0, recursive=True): """ .. versionadded: 2.2 Resolve all polytomies under current node by creating an arbitrary dicotomic structure among the affected nodes. This function randomly modifies current tree topology and ...
(self, default_dist=0.0, default_support=0.0, recursive=True)
[ 0.07311123609542847, 0.012325230985879898, 0.030674541369080544, 0.05312630534172058, -0.059311263263225555, -0.010841555893421173, -0.03496468812227249, -0.0007139070658013225, 0.015596467070281506, 0.055521637201309204, 0.0489434115588665, 0.0235600508749485, -0.02279139868915081, 0.0208...
720,334
ete3.coretype.tree
robinson_foulds
.. versionadded: 2.2 Returns the Robinson-Foulds symmetric distance between current tree and a different tree instance. :param t2: reference tree :param name attr_t1: Compare trees using a custom node attribute as a node name. :param nam...
def robinson_foulds(self, t2, attr_t1="name", attr_t2="name", unrooted_trees=False, expand_polytomies=False, polytomy_size_limit=5, skip_large_polytomies=False, correct_by_polytomy_size=False, min_support_t1=0.0, min_support_t2=0.0): ""...
(self, t2, attr_t1='name', attr_t2='name', unrooted_trees=False, expand_polytomies=False, polytomy_size_limit=5, skip_large_polytomies=False, correct_by_polytomy_size=False, min_support_t1=0.0, min_support_t2=0.0)
[ 0.01937996782362461, -0.006647653877735138, 0.01713882014155388, 0.01614275574684143, -0.04365364834666252, -0.03966938704252243, -0.026374079287052155, -0.013858300633728504, -0.04053553193807602, -0.01050199382007122, -0.0009263678803108633, 0.0451694019138813, -0.002403549151495099, 0.0...
720,335
ete3.coretype.tree
search_nodes
Returns the list of nodes matching a given set of conditions. **Example:** :: tree.search_nodes(dist=0.0, name="human")
def search_nodes(self, **conditions): """ Returns the list of nodes matching a given set of conditions. **Example:** :: tree.search_nodes(dist=0.0, name="human") """ matching_nodes = [] for n in self.iter_search_nodes(**conditions): matching_nodes.append(n) return matching_...
(self, **conditions)
[ 0.00025698854005895555, -0.025502104312181473, -0.008864723145961761, -0.0495186522603035, -0.005358625203371048, 0.08191799372434616, -0.034114811569452286, 0.0011672253021970391, 0.06564757972955704, 0.0019940100610256195, 0.01058461144566536, 0.039155103266239166, 0.007078514434397221, ...
720,336
ete3.clustering.clustertree
set_distance_function
Sets the distance function used to calculate cluster distances and silouette index. ARGUMENTS: fn: a pointer to python function acepting two arrays (numpy) as arguments. EXAMPLE: # A simple euclidean distance my_dist_fn = lambda x,y: abs(x-y) ...
def set_distance_function(self, fn): """ Sets the distance function used to calculate cluster distances and silouette index. ARGUMENTS: fn: a pointer to python function acepting two arrays (numpy) as arguments. EXAMPLE: # A simple euclidean distance my_dist_fn = lambda x,y: abs(x...
(self, fn)
[ 0.032194752246141434, 0.046056125313043594, 0.014121157117187977, -0.00964914821088314, -0.04316138103604317, 0.05770932510495186, -0.03867081552743912, -0.0030107197817415, -0.0002783407981041819, 0.03863370418548584, -0.08134973794221878, 0.005701347254216671, -0.008187858387827873, 0.01...
720,337
ete3.coretype.tree
set_outgroup
Sets a descendant node as the outgroup of a tree. This function can be used to root a tree or even an internal node. :argument outgroup: a node instance within the same tree structure that will be used as a basal node.
def set_outgroup(self, outgroup): """ Sets a descendant node as the outgroup of a tree. This function can be used to root a tree or even an internal node. :argument outgroup: a node instance within the same tree structure that will be used as a basal node. """ outgroup = _translate_nodes(...
(self, outgroup)
[ -0.0017693230183795094, 0.004913990385830402, -0.041451346129179, 0.04714374244213104, -0.05944543331861496, -0.016685599461197853, -0.04103110358119011, 0.06070616468787193, -0.039350125938653946, -0.028996840119361877, 0.001088217250071466, -0.007421127986162901, 0.02658998779952526, 0.0...
720,338
ete3.coretype.tree
set_style
.. versionadded: 2.1 Set 'node_style' as the fixed style for the current node.
def set_style(self, node_style): """ .. versionadded: 2.1 Set 'node_style' as the fixed style for the current node. """ if TREEVIEW: if node_style is None: node_style = NodeStyle() if type(node_style) is NodeStyle: self._img_style = node_style else: ...
(self, node_style)
[ 0.016833381727337837, 0.003706452902406454, 0.031996749341487885, -0.009149542078375816, 0.0017188703641295433, -0.0003109067620243877, -0.007226361893117428, 0.05965856835246086, 0.06552138179540634, 0.030913015827536583, -0.008576585911214352, 0.010615245439112186, 0.04736442491412163, -...
720,339
ete3.coretype.tree
show
Starts an interactive session to visualize current node structure using provided layout and TreeStyle.
def show(self, layout=None, tree_style=None, name="ETE"): """ Starts an interactive session to visualize current node structure using provided layout and TreeStyle. """ from ..treeview import drawer drawer.show_tree(self, layout=layout, tree_style=tree_style, win_name=name)
(self, layout=None, tree_style=None, name='ETE')
[ 0.037929076701402664, -0.03361024707555771, 0.04722849279642105, -0.02812463603913784, 0.046671222895383835, 0.039914343506097794, -0.039740197360515594, -0.020392538979649544, -0.015533855184912682, 0.03293107450008392, -0.011215025559067726, -0.02455463632941246, 0.02309180609881878, 0.0...
720,340
ete3.coretype.tree
sort_descendants
.. versionadded: 2.1 Sort the branches of a given tree by node names. After the tree is sorted. Note that if duplicated names are present, extra criteria should be added to sort nodes.
def sort_descendants(self, attr="name"): """ .. versionadded: 2.1 Sort the branches of a given tree by node names. After the tree is sorted. Note that if duplicated names are present, extra criteria should be added to sort nodes. """ node2content = self.get_cached_content(store_attr=attr, co...
(self, attr='name')
[ -0.03301738202571869, 0.03462841734290123, 0.016694579273462296, -0.0007894739392213523, -0.00546601414680481, 0.003567293519154191, 0.010418621823191643, 0.03717774897813797, 0.0502430722117424, -0.02827279269695282, -0.00524471839889884, 0.0335661955177784, 0.03046805039048195, 0.0091528...
720,341
ete3.coretype.tree
standardize
.. versionadded:: 2.3 process current tree structure to produce a standardized topology: nodes with only one child are removed and multifurcations are automatically resolved.
def standardize(self, delete_orphan=True, preserve_branch_length=True): """ .. versionadded:: 2.3 process current tree structure to produce a standardized topology: nodes with only one child are removed and multifurcations are automatically resolved. """ self.resolve_polytomy() for n in self...
(self, delete_orphan=True, preserve_branch_length=True)
[ 0.013158255256712437, 0.031059186905622482, -0.0029686307534575462, -0.035980161279439926, -0.04193525016307831, -0.040473222732543945, -0.028509551659226418, -0.004805081058293581, 0.026298679411411285, 0.027760708704590797, -0.029775455594062805, 0.01916683465242386, -0.027404116466641426,...
720,342
ete3.coretype.tree
swap_children
Swaps current children order.
def swap_children(self): """ Swaps current children order. """ if len(self.children)>1: self.children.reverse()
(self)
[ 0.010862967930734158, 0.0496542751789093, -0.010416184552013874, -0.01615428552031517, -0.07723219692707062, 0.01769612543284893, -0.026561709120869637, 0.07470918446779251, 0.05340375378727913, -0.052492666989564896, -0.0020192856900393963, -0.011073218658566475, 0.03173037990927696, 0.00...
720,343
ete3.coretype.tree
traverse
Returns an iterator to traverse the tree structure under this node. :argument "levelorder" strategy: set the way in which tree will be traversed. Possible values are: "preorder" (first parent and then children) 'postorder' (first children and the parent) and "l...
def traverse(self, strategy="levelorder", is_leaf_fn=None): """ Returns an iterator to traverse the tree structure under this node. :argument "levelorder" strategy: set the way in which tree will be traversed. Possible values are: "preorder" (first parent and then children) 'postorder' (fi...
(self, strategy='levelorder', is_leaf_fn=None)
[ -0.01869192160665989, -0.017036451026797295, -0.060998380184173584, -0.00884231273084879, 0.021827679127454758, 0.0345458947122097, -0.033845167607069016, 0.028151750564575195, 0.03447582200169563, 0.017255429178476334, 0.013883175328373909, -0.02107439748942852, -0.01117661315947771, 0.01...
720,344
ete3.coretype.tree
unroot
Unroots current node. This function is expected to be used on the absolute tree root node, but it can be also be applied to any other internal node. It will convert a split into a multifurcation. :argument "legacy" mode: The value can be "legacy" or "keep". If value is ...
def unroot(self, mode='legacy'): """ Unroots current node. This function is expected to be used on the absolute tree root node, but it can be also be applied to any other internal node. It will convert a split into a multifurcation. :argument "legacy" mode: The value can be "legacy" or "keep". ...
(self, mode='legacy')
[ 0.04072696343064308, 0.037659961730241776, 0.06569095700979233, 0.0032988127786666155, 0.0005477589438669384, 0.008358478546142578, -0.02528495527803898, 0.006967627443373203, 0.04272408410906792, 0.00039507742621935904, -0.008567997254431248, -0.0341828316450119, -0.011421024799346924, -0...
720,345
ete3.coretype.tree
write
Returns the newick representation of current node. Several arguments control the way in which extra data is shown for every node: :argument features: a list of feature names to be exported using the Extended Newick Format (i.e. features=["name", "dist"]). Use an emp...
def write(self, features=None, outfile=None, format=0, is_leaf_fn=None, format_root_node=False, dist_formatter=None, support_formatter=None, name_formatter=None, quoted_node_names=False): """ Returns the newick representation of current node. Several arguments control the way in which ex...
(self, features=None, outfile=None, format=0, is_leaf_fn=None, format_root_node=False, dist_formatter=None, support_formatter=None, name_formatter=None, quoted_node_names=False)
[ 0.006565377116203308, -0.019691679626703262, 0.039205316454172134, -0.0363922193646431, 0.028647299855947495, 0.012587719596922398, -0.057721905410289764, 0.035377368330955505, -0.0001251177309313789, -0.013931953348219395, 0.004700365010648966, -0.0062983110547065735, 0.002281190361827612, ...
720,453
ete3.evol.evoltree
EvolNode
Re-implementation of the standart TreeNode instance. It adds attributes and methods to work with phylogentic trees. :argument newick: path to tree in newick format, can also be a string :argument alignment: path to alignment, can also be a string. :argument fasta alg_format: alignment format. :arg...
class EvolNode(PhyloNode): """ Re-implementation of the standart TreeNode instance. It adds attributes and methods to work with phylogentic trees. :argument newick: path to tree in newick format, can also be a string :argument alignment: path to alignment, can also be a string. :argument fasta alg_...
(newick=None, alignment=None, alg_format='fasta', sp_naming_function=<function _parse_species at 0x7ff39bbe70a0>, format=0, binpath='', **kwargs)
[ 0.06472112238407135, -0.009642630815505981, -0.005678139626979828, 0.04559702053666115, 0.008724029175937176, -0.01734061911702156, -0.07086662203073502, -0.020961306989192963, 0.021799329668283463, -0.0536334402859211, -0.005882273428142071, -0.013891834765672684, 0.017609216272830963, 0....
720,454
ete3.phylo.phylotree
__get_speciation_trees_recursive
experimental and testing
def __get_speciation_trees_recursive(self): """ experimental and testing """ t = self.copy() if autodetect_duplications: dups = 0 #n2content, n2species = t.get_node2species() n2content = t.get_cached_content() n2species = t.get_cached_content(store_attr="species") #pr...
(self)
[ 0.04174911230802536, -0.04758225008845329, 0.03567751497030258, 0.011024259962141514, 0.0010438424069434404, 0.04853609576821327, -0.04149230942130089, -0.001963868271559477, 0.02756982296705246, -0.000006090514034440275, 0.013803254812955856, 0.011592899449169636, -0.06555858254432678, -0...
720,459
ete3.evol.evoltree
__init__
freebranch: path to find codeml output of freebranch model.
def __init__(self, newick=None, alignment=None, alg_format="fasta", sp_naming_function=_parse_species, format=0, binpath='', **kwargs): ''' freebranch: path to find codeml output of freebranch model. ''' # _update names? self.workdir = '/tmp/ete3-tmp/' if not binpath: ...
(self, newick=None, alignment=None, alg_format='fasta', sp_naming_function=<function _parse_species at 0x7ff39bbe70a0>, format=0, binpath='', **kwargs)
[ 0.05600471422076225, 0.017317013815045357, 0.026366664096713066, 0.00008577110565965995, -0.048857446759939194, -0.03040255978703499, -0.06492991000413895, -0.0005722703645005822, -0.01242771279066801, -0.027824563905596733, 0.019592760130763054, 0.0295669324696064, -0.005200437735766172, ...
720,463
ete3.phylo.phylotree
__repr__
null
def __repr__(self): return "PhyloTree node '%s' (%s)" %(self.name, hex(self.__hash__()))
(self)
[ 0.03287293761968613, -0.005672160070389509, 0.08898040652275085, 0.0234904196113348, 0.00994547177106142, -0.04445608705282211, -0.0365065336227417, 0.01105431467294693, 0.012060803361237049, -0.03198586404323578, 0.00262923794798553, -0.00043100951006636024, 0.031388793140649796, 0.059229...