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,471 | ete3.phylo.phylotree | _get_species | null | def _get_species(self):
if self._speciesFunction:
try:
return self._speciesFunction(self.name)
except:
return self._speciesFunction(self)
else:
return self._species
| (self) | [
0.0704822689294815,
-0.04835567995905876,
0.032416462898254395,
-0.01908334344625473,
0.02523709274828434,
-0.00853286124765873,
0.03308900445699692,
0.008642149157822132,
0.052088283002376556,
-0.028196271508932114,
-0.013576916418969631,
0.02417783997952938,
-0.030482910573482513,
-0.046... |
720,475 | ete3.evol.evoltree | _is_mark_mode | null | def _is_mark_mode(self):
return self.__gui_mark_mode
| (self) | [
0.062338996678590775,
0.0102003188803792,
0.09444491565227509,
0.046185705810785294,
0.029330095276236534,
-0.00043189359712414443,
0.0284438394010067,
0.05722211301326752,
0.03441353514790535,
-0.03605227172374725,
-0.03782478719949722,
-0.03675458952784538,
-0.006968824192881584,
-0.0116... |
720,479 | ete3.evol.evoltree | _label_as_paml |
to label tree as paml, nearly walking man over the tree algorithm
WARNING: sorted names in same order that sequence
WARNING: depends on tree topology conformation, not the same after a swap
activates the function get_descendants_by_pamlid
| def _label_as_paml(self):
'''
to label tree as paml, nearly walking man over the tree algorithm
WARNING: sorted names in same order that sequence
WARNING: depends on tree topology conformation, not the same after a swap
activates the function get_descendants_by_pamlid
'''
nid = 1
# check... | (self) | [
0.037996333092451096,
-0.015245766378939152,
0.027797501534223557,
0.011187226511538029,
-0.022881770506501198,
0.010058881714940071,
0.037611473351716995,
-0.012927849777042866,
0.06896019726991653,
-0.019348040223121643,
-0.036981698125600815,
-0.065986268222332,
0.027570083737373352,
0.... |
720,480 | ete3.evol.evoltree | _label_internal_nodes |
nid needs to be a list in order to keep count through recursivity
| def _label_internal_nodes(self, nid=None):
"""
nid needs to be a list in order to keep count through recursivity
"""
for node in self.get_children():
if node.is_leaf():
continue
nid[0] += 1
node.add_feature('node_id', nid[0])
node._label_internal_nodes(nid)
| (self, nid=None) | [
-0.021234920248389244,
-0.015917401760816574,
0.041977643966674805,
0.06918928027153015,
-0.061525020748376846,
0.060962505638599396,
-0.0028740973211824894,
0.045071471482515335,
0.05751710385084152,
-0.03009452484548092,
-0.033311404287815094,
-0.011329392902553082,
0.04654807224869728,
... |
720,484 | ete3.evol.evoltree | _set_mark_mode | null | def _set_mark_mode(self, val):
self.__gui_mark_mode = val
| (self, val) | [
0.059538837522268295,
0.021631017327308655,
0.0816476121544838,
0.035486068576574326,
0.005523075815290213,
0.007957182824611664,
0.016383888199925423,
0.030906159430742264,
0.032866623252630234,
-0.03275130316615105,
-0.043130237609148026,
-0.02219115011394024,
0.015395418740808964,
0.006... |
720,485 | ete3.phylo.phylotree | _set_species | null | def _set_species(self, value):
if self._speciesFunction:
pass
else:
self._species = value
| (self, value) | [
0.0667705163359642,
-0.008308793418109417,
0.016884401440620422,
-0.004744308535009623,
-0.0213952474296093,
0.009655376896262169,
-0.007929415442049503,
0.02621459774672985,
0.03386886045336723,
-0.008296286687254906,
-0.0452585332095623,
0.014991681091487408,
0.0006884041358716786,
-0.00... |
720,489 | ete3.evol.evoltree | _write_algn |
to write algn in paml format
| def _write_algn(self, fullpath):
"""
to write algn in paml format
"""
seq_group = SeqGroup()
for n in self:
seq_group.id2seq[n.node_id] = n.nt_sequence
seq_group.id2name[n.node_id] = n.name
seq_group.name2id[n.name] = n.node_id
seq_group.write(outfile=fullpath, format='pa... | (self, fullpath) | [
-0.043523285537958145,
0.05375007167458534,
0.01187462080270052,
0.041892439126968384,
0.02954215370118618,
-0.007478972431272268,
-0.04250400513410568,
-0.020368626341223717,
0.030289625748991966,
-0.002798774978145957,
-0.04046544432640076,
-0.007411020342260599,
0.007818732410669327,
0.... |
720,495 | ete3.phylo.phylotree | annotate_ncbi_taxa | Add NCBI taxonomy annotation to all descendant nodes. Leaf nodes are
expected to contain a feature (name, by default) encoding a valid taxid
number.
All descendant nodes (including internal nodes) are annotated with the
following new features:
`Node.spname`: scientific spcies n... | def annotate_ncbi_taxa(self, taxid_attr='species', tax2name=None, tax2track=None, tax2rank=None, dbfile=None):
"""Add NCBI taxonomy annotation to all descendant nodes. Leaf nodes are
expected to contain a feature (name, by default) encoding a valid taxid
number.
All descendant nodes (including internal ... | (self, taxid_attr='species', tax2name=None, tax2track=None, tax2rank=None, dbfile=None) | [
-0.07654175162315369,
0.055844977498054504,
0.05413839966058731,
0.004025885369628668,
-0.005959399975836277,
-0.01075687538832426,
-0.04811092093586922,
0.0015431804349645972,
0.04843771085143089,
-0.07675961405038834,
0.004320905078202486,
0.047057926654815674,
0.004929099697619677,
0.00... |
720,496 | ete3.evol.evoltree | change_dist_to_evol |
change dist/branch length of the tree to a given evolutionary
variable (dN, dS, w or bL), default is bL.
:argument evol: evolutionary variable
:argument model: Model object from which to retrieve evolutionary variables
:argument False fill: do not affects only dist parameter, e... | def change_dist_to_evol(self, evol, model, fill=False):
'''
change dist/branch length of the tree to a given evolutionary
variable (dN, dS, w or bL), default is bL.
:argument evol: evolutionary variable
:argument model: Model object from which to retrieve evolutionary variables
:argument False f... | (self, evol, model, fill=False) | [
0.08079260587692261,
0.030035031959414482,
-0.053632691502571106,
0.032440003007650375,
-0.003494442906230688,
0.014520246535539627,
0.003799585159868002,
-0.07211300730705261,
-0.03629157692193985,
0.025008097290992737,
-0.005492559168487787,
-0.04234921187162399,
0.015062721446156502,
-0... |
720,498 | ete3.phylo.phylotree | collapse_lineage_specific_expansions | Converts lineage specific expansion nodes into a single
tip node (randomly chosen from tips within the expansion).
:param None species: If supplied, only expansions matching the
species criteria will be pruned. When None, all expansions
within the tree will be processed.
... | def collapse_lineage_specific_expansions(self, species=None, return_copy=True):
""" Converts lineage specific expansion nodes into a single
tip node (randomly chosen from tips within the expansion).
:param None species: If supplied, only expansions matching the
species criteria will be pruned. When N... | (self, species=None, return_copy=True) | [
0.0353236198425293,
-0.010634399950504303,
0.06172749400138855,
-0.014117010869085789,
-0.03653187304735184,
-0.024982400238513947,
0.03987233713269234,
-0.020895663648843765,
0.004562042187899351,
0.031610019505023956,
-0.01711098849773407,
0.019971705973148346,
-0.0367450937628746,
0.054... |
720,510 | ete3.phylo.phylotree | get_age |
Implements the phylostratigrafic method described in:
Huerta-Cepas, J., & Gabaldon, T. (2011). Assigning duplication events to
relative temporal scales in genome-wide studies. Bioinformatics, 27(1),
38-45.
| def get_age(self, species2age):
"""
Implements the phylostratigrafic method described in:
Huerta-Cepas, J., & Gabaldon, T. (2011). Assigning duplication events to
relative temporal scales in genome-wide studies. Bioinformatics, 27(1),
38-45.
"""
return max([species2age[sp] for sp in self.get... | (self, species2age) | [
0.07657290250062943,
-0.003950864542275667,
0.002610032679513097,
0.013412793166935444,
-0.014003743417561054,
-0.011998091824352741,
-0.008027082309126854,
-0.038680415600538254,
0.054546549916267395,
-0.03282463178038597,
-0.007937544025480747,
0.0002376954216742888,
-0.02863425388932228,
... |
720,511 | ete3.phylo.phylotree | get_age_balanced_outgroup |
.. versionadded:: 2.2
Returns the node better balance current tree structure
according to the topological age of the different leaves and
internal node sizes.
:param species2age: A dictionary translating from leaf names
into a topological age.
.. warning: Th... | def get_age_balanced_outgroup(self, species2age):
"""
.. versionadded:: 2.2
Returns the node better balance current tree structure
according to the topological age of the different leaves and
internal node sizes.
:param species2age: A dictionary translating from leaf names
into a topologic... | (self, species2age) | [
0.053381625562906265,
-0.025496549904346466,
-0.04105987399816513,
0.004442940000444651,
-0.008696313947439194,
-0.009217618964612484,
-0.02500368095934391,
0.009336097165942192,
-0.025913594290614128,
-0.05053814500570297,
-0.045230310410261154,
0.00023044047702569515,
-0.01690923608839512,... |
720,518 | ete3.evol.evoltree | get_descendant_by_node_id |
returns node list corresponding to a given idname
| def get_descendant_by_node_id(self, idname):
'''
returns node list corresponding to a given idname
'''
try:
for n in self.iter_descendants():
if n.node_id == idname:
return n
if self.node_id == idname:
return self
except AttributeError:
... | (self, idname) | [
0.000035815912269754335,
-0.020511576905846596,
0.062166135758161545,
-0.020042534917593002,
-0.047770146280527115,
0.02303718961775303,
0.049501996487379074,
0.02316346950829029,
0.06880488991737366,
0.007946657948195934,
-0.05065656080842018,
-0.024534516036510468,
0.025815362110733986,
... |
720,519 | ete3.phylo.phylotree | get_descendant_evol_events | Returns a list of **all** duplication and speciation
events detected after this node. Nodes are assumed to be
duplications when a species overlap is found between its child
linages. Method is described more detail in:
"The Human Phylome." Huerta-Cepas J, Dopazo H, Dopazo J, Gabaldon
... | def get_descendant_evol_events(self, sos_thr=0.0):
""" Returns a list of **all** duplication and speciation
events detected after this node. Nodes are assumed to be
duplications when a species overlap is found between its child
linages. Method is described more detail in:
"The Human Phylome." Huerta... | (self, sos_thr=0.0) | [
-0.0247575044631958,
-0.013155120424926281,
-0.012654794380068779,
0.004697024822235107,
-0.045236360281705856,
0.0011861174134537578,
-0.0076860408298671246,
0.005175785161554813,
0.019253920763731003,
0.03536786511540413,
-0.036506537348032,
-0.036955103278160095,
0.02820802852511406,
-0... |
720,523 | ete3.evol.evoltree | get_evol_model |
returns one precomputed model
:argument modelname: string of the name of a model object stored
:returns: Model object
| def get_evol_model(self, modelname):
'''
returns one precomputed model
:argument modelname: string of the name of a model object stored
:returns: Model object
'''
try:
return self._models[modelname]
except KeyError:
Exception("ERROR: Model %s not found." % (modelname))
| (self, modelname) | [
0.08917568624019623,
-0.052477575838565826,
-0.05548146367073059,
0.01716378703713417,
0.024682555347681046,
-0.04339352622628212,
0.0008374923490919173,
-0.025261620059609413,
0.05899203196167946,
-0.004376901313662529,
-0.008523082360625267,
-0.016675202175974846,
-0.029731260612607002,
... |
720,526 | ete3.phylo.phylotree | get_farthest_oldest_leaf | Returns the farthest oldest leaf to the current
one. It requires an species2age dictionary with the age
estimation for all species.
:argument None is_leaf_fn: A pointer to a function that
receives a node instance as unique argument and returns True
or False. It can be used ... | def get_farthest_oldest_leaf(self, species2age, is_leaf_fn=None):
""" Returns the farthest oldest leaf to the current
one. It requires an species2age dictionary with the age
estimation for all species.
:argument None is_leaf_fn: A pointer to a function that
receives a node instance as unique argum... | (self, species2age, is_leaf_fn=None) | [
0.054815176874399185,
0.006314223166555166,
-0.00039952166844159365,
0.005546773783862591,
0.004565633833408356,
0.019154062494635582,
0.005183728877454996,
0.03878605738282204,
0.00806970614939928,
-0.02360250987112522,
-0.03301410377025604,
-0.005041268188506365,
-0.06786640733480453,
-0... |
720,527 | ete3.phylo.phylotree | get_farthest_oldest_node |
.. versionadded:: 2.1
Returns the farthest oldest node (leaf or internal). The
difference with get_farthest_oldest_leaf() is that in this
function internal nodes grouping seqs from the same species
are collapsed.
| def get_farthest_oldest_node(self, species2age):
"""
.. versionadded:: 2.1
Returns the farthest oldest node (leaf or internal). The
difference with get_farthest_oldest_leaf() is that in this
function internal nodes grouping seqs from the same species
are collapsed.
"""
# I use a custom i... | (self, species2age) | [
0.04094357416033745,
0.021271195262670517,
0.020610814914107323,
0.006495187524706125,
0.0025415951386094093,
0.016831006854772568,
0.005152703728526831,
0.050605982542037964,
0.03267144411802292,
-0.04389790818095207,
-0.007768156938254833,
0.008923822082579136,
-0.08028833568096161,
-0.0... |
720,533 | ete3.evol.evoltree | get_most_likely |
Returns pvalue of LRT between alternative model and null model.
usual comparison are:
============ ======= ===========================================
Alternative Null Test
============ ======= ===========================================
M2 M1 PS o... | def get_most_likely(self, altn, null):
'''
Returns pvalue of LRT between alternative model and null model.
usual comparison are:
============ ======= ===========================================
Alternative Null Test
============ ======= ===========================================
M2 ... | (self, altn, null) | [
0.008093650452792645,
0.0010533545864745975,
-0.00673776725307107,
0.05245833098888397,
0.043166134506464005,
-0.07722517848014832,
-0.0193618256598711,
-0.060306716710329056,
0.003628028556704521,
-0.021342432126402855,
-0.027506379410624504,
0.014660196378827095,
-0.0076123811304569244,
... |
720,534 | ete3.phylo.phylotree | get_my_evol_events | Returns a list of duplication and speciation events in
which the current node has been involved. Scanned nodes are
also labeled internally as dup=True|False. You can access this
labels using the 'node.dup' sintaxis.
Method: the algorithm scans all nodes from the given leafName to
... | def get_my_evol_events(self, sos_thr=0.0):
""" Returns a list of duplication and speciation events in
which the current node has been involved. Scanned nodes are
also labeled internally as dup=True|False. You can access this
labels using the 'node.dup' sintaxis.
Method: the algorithm scans all nodes... | (self, sos_thr=0.0) | [
0.03402665629982948,
-0.020548002794384956,
-0.02381344884634018,
0.011854616925120354,
-0.04015805572271347,
0.006743669975548983,
-0.022059140726923943,
-0.012332274578511715,
0.015806155279278755,
0.03527725487947464,
-0.030170651152729988,
-0.0522124208509922,
0.037656862288713455,
-0.... |
720,536 | ete3.phylo.phylotree | get_speciation_trees |
.. versionadded: 2.2
Calculates all possible species trees contained within a
duplicated gene family tree as described in `Treeko
<http://treeko.cgenomics.org>`_ (see `Marcet and Gabaldon,
2011 <http://www.ncbi.nlm.nih.gov/pubmed/21335609>`_ ).
:argument True autodete... | def get_speciation_trees(self, map_features=None, autodetect_duplications=True,
newick_only=False, target_attr='species'):
"""
.. versionadded: 2.2
Calculates all possible species trees contained within a
duplicated gene family tree as described in `Treeko
<http://treeko.cge... | (self, map_features=None, autodetect_duplications=True, newick_only=False, target_attr='species') | [
0.08896008878946304,
-0.049233920872211456,
0.0532507598400116,
-0.03666747733950615,
-0.023529833182692528,
0.0464700385928154,
-0.021263452246785164,
0.013487735763192177,
0.014648565091192722,
0.0396893210709095,
-0.0017642768798395991,
-0.0038487031124532223,
-0.030439533293247223,
-0.... |
720,537 | ete3.phylo.phylotree | get_species | Returns the set of species covered by its partition. | def get_species(self):
""" Returns the set of species covered by its partition. """
return set([l.species for l in self.iter_leaves()])
| (self) | [
0.05267976224422455,
0.009294433519244194,
-0.02471165917813778,
0.003502373117953539,
0.01992875710129738,
0.006186394952237606,
0.021879231557250023,
-0.016256777569651604,
0.06302575767040253,
-0.020844632759690285,
-0.022625500336289406,
-0.02822251245379448,
-0.014187579043209553,
-0.... |
720,549 | ete3.phylo.phylotree | iter_species | Returns an iterator over the species grouped by this node. | def iter_species(self):
""" Returns an iterator over the species grouped by this node. """
spcs = set([])
for l in self.iter_leaves():
if l.species not in spcs:
spcs.add(l.species)
yield l.species
| (self) | [
0.04533182829618454,
-0.016407955437898636,
-0.013418943621218204,
-0.012506889179348946,
-0.007025530561804771,
0.006944258231669664,
-0.010935626924037933,
-0.0013827562797814608,
0.10576222836971283,
-0.006971349008381367,
-0.03682534024119377,
-0.0240565724670887,
-0.01609189622104168,
... |
720,551 | ete3.evol.evoltree | link_to_alignment |
same function as for phyloTree, but translate sequences if nucleotides
nucleotidic sequence is kept under node.nt_sequence
:argument alignment: path to alignment or string
:argument alg_format: one of fasta phylip or paml
:argument True alignment: set to False in case we want t... | def link_to_alignment(self, alignment, alg_format="paml",
nucleotides=True, **kwargs):
'''
same function as for phyloTree, but translate sequences if nucleotides
nucleotidic sequence is kept under node.nt_sequence
:argument alignment: path to alignment or string
:argument alg_f... | (self, alignment, alg_format='paml', nucleotides=True, **kwargs) | [
0.03910881280899048,
0.049592696130275726,
0.0184988621622324,
0.020126905292272568,
-0.023687131702899933,
0.02241690084338188,
-0.04322364926338196,
-0.043044742196798325,
0.07195592671632767,
-0.00635562976822257,
-0.012773876078426838,
-0.018239449709653854,
0.034027889370918274,
0.022... |
720,552 | ete3.evol.evoltree | link_to_evol_model |
link EvolTree to evolutionary model
* free-branch model ("fb") will append evol values to tree
* Site models (M0, M1, M2, M7, M8) will give evol values by site
and likelihood
:argument path: path to outfile containing model computation result
:argument model: ei... | def link_to_evol_model(self, path, model):
'''
link EvolTree to evolutionary model
* free-branch model ("fb") will append evol values to tree
* Site models (M0, M1, M2, M7, M8) will give evol values by site
and likelihood
:argument path: path to outfile containing model computation resul... | (self, path, model) | [
0.10085578262805939,
-0.009244807995855808,
-0.07373889535665512,
0.04212082922458649,
0.007607182487845421,
-0.006930175237357616,
-0.024225879460573196,
-0.062723807990551,
0.0021202219650149345,
0.016696462407708168,
0.03035554103553295,
-0.05251380428671837,
-0.018956203013658524,
0.01... |
720,553 | ete3.evol.evoltree | mark_tree |
function to mark branches on tree in order that paml could interpret it.
takes a "marks" argument that should be a list of #1,#1,#2
e.g.:
::
t=Tree.mark_tree([2,3], marks=["#1","#2"])
:argument node_ids: list of node ids (have a look to node.node_id)
:argumen... | def mark_tree(self, node_ids, verbose=False, **kargs):
'''
function to mark branches on tree in order that paml could interpret it.
takes a "marks" argument that should be a list of #1,#1,#2
e.g.:
::
t=Tree.mark_tree([2,3], marks=["#1","#2"])
:argument node_ids: list of node ids (have a lo... | (self, node_ids, verbose=False, **kargs) | [
-0.0004258378758095205,
-0.02047589048743248,
0.04972716420888901,
0.033710308372974396,
-0.025898078456521034,
0.02470305562019348,
-0.026486670598387718,
0.04665934666991234,
0.06103527545928955,
-0.019637592136859894,
0.003986377734690905,
-0.024471186101436615,
0.014803997240960598,
0.... |
720,554 | ete3.phylo.phylotree | ncbi_compare | null | def ncbi_compare(self, autodetect_duplications=True, cached_content=None):
if not cached_content:
cached_content = self.get_cached_content()
cached_species = set([n.species for n in cached_content[self]])
if len(cached_species) != len(cached_content[self]):
print(cached_species)
ntre... | (self, autodetect_duplications=True, cached_content=None) | [
0.04888647049665451,
-0.060018669813871384,
0.01123290229588747,
0.009658281691372395,
-0.013896940276026726,
-0.00011722396448021755,
-0.03855988755822182,
-0.02325311489403248,
0.06748896092176437,
-0.04789775237441063,
-0.011745569296181202,
0.04361332207918167,
-0.0599820502102375,
-0.... |
720,558 | ete3.phylo.phylotree | reconcile | Returns the reconcilied topology with the provided species
tree, and a list of evolutionary events inferred from such
reconciliation. | def reconcile(self, species_tree):
""" Returns the reconcilied topology with the provided species
tree, and a list of evolutionary events inferred from such
reconciliation. """
return get_reconciled_tree(self, species_tree, [])
| (self, species_tree) | [
0.02299800142645836,
-0.012888427823781967,
-0.011780296452343464,
0.010305628180503845,
-0.0242766160517931,
-0.02898191474378109,
-0.02318553254008293,
-0.005353130400180817,
0.06099840626120567,
-0.00451350724324584,
-0.004799064248800278,
-0.03208468481898308,
-0.04207492247223854,
0.0... |
720,561 | ete3.evol.evoltree | render |
call super show adding up and down faces
:argument layout: a layout function
:argument None tree_style: tree_style object
:argument Nonehistface: an histogram face function. This is only to plot selective pressure among sites
| def render(self, file_name, layout=None, w=None, h=None,
tree_style=None, header=None, histfaces=None):
'''
call super show adding up and down faces
:argument layout: a layout function
:argument None tree_style: tree_style object
:argument Nonehistface: an histogram face function. This is... | (self, file_name, layout=None, w=None, h=None, tree_style=None, header=None, histfaces=None) | [
0.022485684603452682,
-0.07727064937353134,
-0.010387112386524677,
0.02745620533823967,
-0.014456383883953094,
0.029222287237644196,
-0.03936360403895378,
0.01339127216488123,
-0.06904106587171555,
0.003919063601642847,
0.041839759796857834,
-0.017660820856690407,
-0.017506061121821404,
-0... |
720,564 | ete3.evol.evoltree | run_model |
To compute evolutionnary models. e.g.: b_free_lala.vs.lele, will launch one free branch model, and store
it in "WORK_DIR/b_free_lala.vs.lele" directory
WARNING: this functionality needs to create a working directory in "rep"
WARNING: you need to have codeml and/or SLR in your path... | def run_model(self, model_name, ctrl_string='', keep=True, **kwargs):
'''
To compute evolutionnary models. e.g.: b_free_lala.vs.lele, will launch one free branch model, and store
it in "WORK_DIR/b_free_lala.vs.lele" directory
WARNING: this functionality needs to create a working directory in "rep"
... | (self, model_name, ctrl_string='', keep=True, **kwargs) | [
0.07920334488153458,
-0.01604684628546238,
-0.049015823751688004,
0.039912886917591095,
0.005188480485230684,
-0.019888365641236305,
-0.06866105645895004,
-0.0038293611723929644,
0.029059382155537605,
-0.02557770162820816,
0.00575255136936903,
-0.022387782111763954,
-0.030887749046087265,
... |
720,567 | ete3.phylo.phylotree | set_species_naming_function |
Sets the parsing function used to extract species name from a
node's name.
:argument fn: Pointer to a parsing python function that
receives nodename as first argument and returns the species
name.
::
# Example of a parsing function to extract species nam... | def set_species_naming_function(self, fn):
"""
Sets the parsing function used to extract species name from a
node's name.
:argument fn: Pointer to a parsing python function that
receives nodename as first argument and returns the species
name.
::
# Example of a parsing function to ... | (self, fn) | [
0.0024477627594023943,
0.016278766095638275,
0.03253922984004021,
-0.007302111014723778,
-0.02589595690369606,
0.04696044325828552,
0.008564881980419159,
0.04176294803619385,
0.06222350150346756,
-0.02942805550992489,
-0.0681530311703682,
0.030617622658610344,
-0.00263077300041914,
0.02018... |
720,569 | ete3.evol.evoltree | show |
call super show of PhyloTree
histface should be a list of models to be displayes as histfaces
:argument layout: a layout function
:argument None tree_style: tree_style object
:argument Nonehistface: an histogram face function. This is only to plot selective pressure among sites... | def show(self, layout=None, tree_style=None, histfaces=None):
'''
call super show of PhyloTree
histface should be a list of models to be displayes as histfaces
:argument layout: a layout function
:argument None tree_style: tree_style object
:argument Nonehistface: an histogram face function. Thi... | (self, layout=None, tree_style=None, histfaces=None) | [
0.04199722781777382,
-0.05333390086889267,
0.013324273750185966,
-0.01325065828859806,
-0.019507914781570435,
0.03529828041791916,
-0.014676944352686405,
-0.018707353621721268,
-0.051824796944856644,
0.016370084136724472,
0.017869984731078148,
-0.021789971739053726,
-0.013066621497273445,
... |
720,571 | ete3.phylo.phylotree | split_by_dups |
.. versionadded: 2.2
Returns the list of all subtrees resulting from splitting
current tree by its duplication nodes.
:argument True autodetect_duplications: If True, duplication
nodes will be automatically detected using the Species Overlap
algorithm (:func:`PhyloNode... | def split_by_dups(self, autodetect_duplications=True):
"""
.. versionadded: 2.2
Returns the list of all subtrees resulting from splitting
current tree by its duplication nodes.
:argument True autodetect_duplications: If True, duplication
nodes will be automatically detected using the Species Ove... | (self, autodetect_duplications=True) | [
0.03825437277555466,
-0.03653712943196297,
-0.005740896333009005,
0.0019684378057718277,
-0.01753782108426094,
0.02981429733335972,
-0.0003125637012999505,
0.010632304474711418,
0.010148187167942524,
0.020040614530444145,
-0.004455246031284332,
-0.016743138432502747,
-0.0324997752904892,
-... |
720,576 | ete3.evol.evoltree | write |
Inherits from Tree but adds the tenth format, that allows to display marks for CodeML.
TODO: internal writting format need to be something like 0
Returns the newick representation of current node. Several
arguments control the way in which extra data is shown for
every ... | def write(self, features=None, outfile=None, format=10):
"""
Inherits from Tree but adds the tenth format, that allows to display marks for CodeML.
TODO: internal writting format need to be something like 0
"""
from re import sub
if int(format) == 11:
nwk = ' %s 1\n' % (len(self))
... | (self, features=None, outfile=None, format=10) | [
0.013786896131932735,
-0.02394110895693302,
0.07722045481204987,
0.021709604188799858,
0.02330106496810913,
-0.016788184642791748,
-0.07479866594076157,
0.043038640171289444,
0.050753768533468246,
-0.01685737818479538,
0.02530769072473049,
-0.020983068272471428,
0.010586675256490707,
0.026... |
720,701 | ete3.ncbi_taxonomy.ncbiquery | NCBITaxa |
versionadded: 2.3
Provides a local transparent connector to the NCBI taxonomy database.
| class NCBITaxa(object):
"""
versionadded: 2.3
Provides a local transparent connector to the NCBI taxonomy database.
"""
def __init__(self, dbfile=None, taxdump_file=None, update=True):
if not dbfile:
self.dbfile = DEFAULT_TAXADB
else:
self.dbfile = dbfile
... | (dbfile=None, taxdump_file=None, update=True) | [
0.009027685038745403,
-0.01672404818236828,
-0.0017480481183156371,
0.03144561126828194,
-0.02341366745531559,
-0.0433724969625473,
-0.08115564286708832,
0.0007261757855303586,
0.05809406191110611,
-0.11750844120979309,
-0.0697568878531456,
0.03600071370601654,
-0.029883233830332756,
0.018... |
720,702 | ete3.ncbi_taxonomy.ncbiquery | __init__ | null | def __init__(self, dbfile=None, taxdump_file=None, update=True):
if not dbfile:
self.dbfile = DEFAULT_TAXADB
else:
self.dbfile = dbfile
if taxdump_file:
self.update_taxonomy_database(taxdump_file)
if dbfile != DEFAULT_TAXADB and not os.path.exists(self.dbfile):
print('NCB... | (self, dbfile=None, taxdump_file=None, update=True) | [
-0.03582584857940674,
0.016160979866981506,
0.022559789940714836,
0.023852668702602386,
-0.013593960553407669,
-0.055312708020210266,
-0.02055489271879196,
0.035563524812459946,
-0.002780156908556819,
-0.07914663851261139,
-0.036706503480672836,
0.09218785166740417,
-0.06621785461902618,
0... |
720,703 | ete3.ncbi_taxonomy.ncbiquery | _common_lineage | null | def _common_lineage(self, vectors):
occurrence = defaultdict(int)
pos = defaultdict(set)
for v in vectors:
for i, taxid in enumerate(v):
occurrence[taxid] += 1
pos[taxid].add(i)
common = [taxid for taxid, ocu in six.iteritems(occurrence) if ocu == len(vectors)]
if not... | (self, vectors) | [
0.005687731318175793,
0.009609532542526722,
-0.05342613160610199,
0.015238996595144272,
-0.001743520493619144,
-0.004571699071675539,
0.01893221214413643,
-0.037649285048246384,
0.04543013870716095,
0.02483060024678707,
-0.07009938359260559,
0.0006039573345333338,
-0.01991826482117176,
-0.... |
720,704 | ete3.ncbi_taxonomy.ncbiquery | _connect | null | def _connect(self):
self.db = sqlite3.connect(self.dbfile)
| (self) | [
-0.020404156297445297,
-0.06042906269431114,
0.016522737219929695,
0.05245256796479225,
0.02711651846766472,
-0.020742444321513176,
-0.018997587263584137,
0.06548558920621872,
-0.005194513592869043,
-0.02252291329205036,
-0.040167342871427536,
0.029644781723618507,
-0.0017660011071711779,
... |
720,705 | ete3.ncbi_taxonomy.ncbiquery | _translate_merged | null | def _translate_merged(self, all_taxids):
conv_all_taxids = set((list(map(int, all_taxids))))
cmd = 'select taxid_old, taxid_new FROM merged WHERE taxid_old IN (%s)' %','.join(map(str, all_taxids))
result = self.db.execute(cmd)
conversion = {}
for old, new in result.fetchall():
conv_all_taxid... | (self, all_taxids) | [
-0.0314459353685379,
-0.04628579318523407,
-0.0016376193379983306,
0.019264504313468933,
-0.06598729640245438,
-0.02436286024749279,
-0.030043885111808777,
-0.03619832918047905,
0.03794633969664574,
-0.06190861389040947,
-0.05007314309477806,
-0.024981945753097534,
-0.008375870995223522,
-... |
720,706 | ete3.ncbi_taxonomy.ncbiquery | annotate_tree | Annotate a tree containing taxids as leaf names by adding the 'taxid',
'sci_name', 'lineage', 'named_lineage' and 'rank' additional attributes.
:param t: a Tree (or Tree derived) instance.
:param name taxid_attr: Allows to set a custom node attribute
containing the taxid number as... | def annotate_tree(self, t, taxid_attr="name", tax2name=None, tax2track=None, tax2rank=None):
"""Annotate a tree containing taxids as leaf names by adding the 'taxid',
'sci_name', 'lineage', 'named_lineage' and 'rank' additional attributes.
:param t: a Tree (or Tree derived) instance.
:param name taxid_... | (self, t, taxid_attr='name', tax2name=None, tax2track=None, tax2rank=None) | [
-0.0069374204613268375,
0.014498536475002766,
0.07710803300142288,
0.04237295687198639,
-0.03467750549316406,
-0.027500202879309654,
-0.035848136991262436,
0.01203253772109747,
0.03634709119796753,
-0.052121806889772415,
0.015880264341831207,
0.005742802284657955,
0.026348764076828957,
0.0... |
720,707 | ete3.ncbi_taxonomy.ncbiquery | get_broken_branches | Returns a list of NCBI lineage names that are not monophyletic in the
provided tree, as well as the list of affected branches and their size.
CURRENTLY EXPERIMENTAL
| def get_broken_branches(self, t, taxa_lineages, n2content=None):
"""Returns a list of NCBI lineage names that are not monophyletic in the
provided tree, as well as the list of affected branches and their size.
CURRENTLY EXPERIMENTAL
"""
if not n2content:
n2content = t.get_cached_content()
... | (self, t, taxa_lineages, n2content=None) | [
-0.011681976728141308,
0.01675429381430149,
-0.008193033747375011,
0.020694313570857048,
-0.062414344400167465,
-0.06278257071971893,
-0.036325518041849136,
-0.0292923953384161,
0.014876339584589005,
-0.0929403007030487,
0.007553240284323692,
0.0528404638171196,
-0.04779576510190964,
-0.06... |
720,708 | ete3.ncbi_taxonomy.ncbiquery | get_common_names | null | def get_common_names(self, taxids):
query = ','.join(['"%s"' %v for v in taxids])
cmd = "select taxid, common FROM species WHERE taxid IN (%s);" %query
result = self.db.execute(cmd)
id2name = {}
for tax, common_name in result.fetchall():
if common_name:
id2name[tax] = common_name... | (self, taxids) | [
0.0008285449584946036,
-0.040152039378881454,
-0.020712487399578094,
-0.026131557300686836,
-0.03876999393105507,
0.027349939569830894,
-0.010710847564041615,
-0.03435108810663223,
0.11390958726406097,
-0.060846343636512756,
0.0006438556010834873,
0.030659573152661324,
-0.014202329330146313,... |
720,709 | ete3.ncbi_taxonomy.ncbiquery | get_descendant_taxa |
given a parent taxid or scientific species name, returns a list of all its descendants taxids.
If intermediate_nodes is set to True, internal nodes will also be dumped.
| def get_descendant_taxa(self, parent, intermediate_nodes=False, rank_limit=None, collapse_subspecies=False, return_tree=False):
"""
given a parent taxid or scientific species name, returns a list of all its descendants taxids.
If intermediate_nodes is set to True, internal nodes will also be dumped.
"""... | (self, parent, intermediate_nodes=False, rank_limit=None, collapse_subspecies=False, return_tree=False) | [
-0.029872780665755272,
0.007458789274096489,
0.025282755494117737,
0.006551130674779415,
-0.02505701780319214,
0.007044934667646885,
-0.05914359167218208,
0.014108681119978428,
0.08465208113193512,
-0.0927034392952919,
-0.0225362665951252,
0.03284500911831856,
-0.022084787487983704,
-0.031... |
720,710 | ete3.ncbi_taxonomy.ncbiquery | get_fuzzy_name_translation |
Given an inexact species name, returns the best match in the NCBI database of taxa names.
:argument 0.9 sim: Min word similarity to report a match (from 0 to 1).
:return: taxid, species-name-match, match-score
| def get_fuzzy_name_translation(self, name, sim=0.9):
'''
Given an inexact species name, returns the best match in the NCBI database of taxa names.
:argument 0.9 sim: Min word similarity to report a match (from 0 to 1).
:return: taxid, species-name-match, match-score
'''
import sqlite3.dbapi2 as ... | (self, name, sim=0.9) | [
0.04214497283101082,
-0.020552637055516243,
0.014657909981906414,
0.06004266068339348,
-0.008944203145802021,
-0.04916294664144516,
-0.05933715030550957,
0.006748765241354704,
0.045672524720430374,
-0.06668931245803833,
-0.04314754158258438,
0.056032389402389526,
-0.06383013725280762,
-0.0... |
720,711 | ete3.ncbi_taxonomy.ncbiquery | get_lineage | Given a valid taxid number, return its corresponding lineage track as a
hierarchically sorted list of parent taxids.
| def get_lineage(self, taxid):
"""Given a valid taxid number, return its corresponding lineage track as a
hierarchically sorted list of parent taxids.
"""
if not taxid:
return None
taxid = int(taxid)
result = self.db.execute('SELECT track FROM species WHERE taxid=%s' %taxid)
raw_track... | (self, taxid) | [
-0.031830087304115295,
0.030362676829099655,
-0.014828073792159557,
0.037645373493433,
-0.03007281944155693,
0.013315374962985516,
-0.022047361359000206,
0.029565567150712013,
0.04058019071817398,
-0.09405907988548279,
-0.024782901629805565,
0.007808063179254532,
-0.03826132044196129,
-0.0... |
720,712 | ete3.ncbi_taxonomy.ncbiquery | get_lineage_translator | Given a valid taxid number, return its corresponding lineage track as a
hierarchically sorted list of parent taxids.
| def get_lineage_translator(self, taxids):
"""Given a valid taxid number, return its corresponding lineage track as a
hierarchically sorted list of parent taxids.
"""
all_ids = set(taxids)
all_ids.discard(None)
all_ids.discard("")
query = ','.join(['"%s"' %v for v in all_ids])
result = se... | (self, taxids) | [
-0.035315435379743576,
0.002204934600740671,
-0.011765731498599052,
0.014091514982283115,
-0.0662529245018959,
0.03637344017624855,
-0.019573068246245384,
0.016262246295809746,
0.045530643314123154,
-0.07281984388828278,
-0.03133879974484444,
0.012458905577659607,
-0.023038942366838455,
-0... |
720,713 | ete3.ncbi_taxonomy.ncbiquery | get_name_translator |
Given a list of taxid scientific names, returns a dictionary translating them into their corresponding taxids.
Exact name match is required for translation.
| def get_name_translator(self, names):
"""
Given a list of taxid scientific names, returns a dictionary translating them into their corresponding taxids.
Exact name match is required for translation.
"""
name2id = {}
#name2realname = {}
name2origname = {}
for n in names:
name2orig... | (self, names) | [
0.03473987430334091,
-0.03203410282731056,
0.004749296698719263,
0.020586593076586723,
-0.05880802497267723,
-0.01852414943277836,
-0.03852417692542076,
-0.026111671701073647,
0.11807016283273697,
-0.07470208406448364,
-0.0658089816570282,
0.048855315893888474,
-0.02421952225267887,
-0.015... |
720,714 | ete3.ncbi_taxonomy.ncbiquery | get_rank | return a dictionary converting a list of taxids into their corresponding NCBI taxonomy rank | def get_rank(self, taxids):
'return a dictionary converting a list of taxids into their corresponding NCBI taxonomy rank'
all_ids = set(taxids)
all_ids.discard(None)
all_ids.discard("")
query = ','.join(['"%s"' %v for v in all_ids])
cmd = "select taxid, rank FROM species WHERE taxid IN (%s);" %q... | (self, taxids) | [
-0.0036096004769206047,
-0.01337192952632904,
-0.026871470734477043,
-0.025212513282895088,
-0.015459299087524414,
0.05177406966686249,
-0.014292559586465359,
0.015085577964782715,
0.09042231738567352,
-0.04473717138171196,
-0.03633299842476845,
0.029514865949749947,
-0.03192126378417015,
... |
720,715 | ete3.ncbi_taxonomy.ncbiquery | get_taxid_translator | Given a list of taxids, returns a dictionary with their corresponding
scientific names.
| def get_taxid_translator(self, taxids, try_synonyms=True):
"""Given a list of taxids, returns a dictionary with their corresponding
scientific names.
"""
all_ids = set(map(int, taxids))
all_ids.discard(None)
all_ids.discard("")
query = ','.join(['"%s"' %v for v in all_ids])
cmd = "select... | (self, taxids, try_synonyms=True) | [
0.01671576127409935,
-0.031733471900224686,
0.031076161190867424,
-0.001805320498533547,
-0.0552140511572361,
-0.0002504853764548898,
-0.058573637157678604,
-0.02800871431827545,
0.08333231508731842,
-0.050722431391477585,
-0.053789880126714706,
0.0193906482309103,
-0.025671612471342087,
-... |
720,716 | ete3.ncbi_taxonomy.ncbiquery | get_topology | Given a list of taxid numbers, return the minimal pruned NCBI taxonomy tree
containing all of them.
:param False intermediate_nodes: If True, single child nodes
representing the complete lineage of leaf nodes are kept.
Otherwise, the tree is pruned to contain the first common
... | def get_topology(self, taxids, intermediate_nodes=False, rank_limit=None, collapse_subspecies=False, annotate=True):
"""Given a list of taxid numbers, return the minimal pruned NCBI taxonomy tree
containing all of them.
:param False intermediate_nodes: If True, single child nodes
representing the co... | (self, taxids, intermediate_nodes=False, rank_limit=None, collapse_subspecies=False, annotate=True) | [
-0.012665332295000553,
0.03513012081384659,
0.002421615645289421,
-0.004709695931524038,
-0.04038936644792557,
0.010662299580872059,
-0.05735865235328674,
-0.007020887918770313,
0.021632757037878036,
-0.06602819263935089,
-0.01635296829044819,
0.056043840944767,
-0.035540997982025146,
-0.0... |
720,717 | ete3.ncbi_taxonomy.ncbiquery | translate_to_names |
Given a list of taxid numbers, returns another list with their corresponding scientific names.
| def translate_to_names(self, taxids):
"""
Given a list of taxid numbers, returns another list with their corresponding scientific names.
"""
id2name = self.get_taxid_translator(taxids)
names = []
for sp in taxids:
names.append(id2name.get(sp, sp))
return names
| (self, taxids) | [
0.01799280196428299,
-0.0317092090845108,
0.02285476215183735,
-0.039889365434646606,
-0.05827254429459572,
-0.001526016741991043,
-0.025392208248376846,
-0.057811189442873,
0.11689997464418411,
-0.04900997877120972,
-0.03415793180465698,
0.0008190140360966325,
0.026190705597400665,
-0.043... |
720,718 | ete3.ncbi_taxonomy.ncbiquery | update_taxonomy_database | Updates the ncbi taxonomy database by downloading and parsing the latest
taxdump.tar.gz file from the NCBI FTP site (via HTTP).
:param None taxdump_file: an alternative location of the taxdump.tax.gz file.
| def update_taxonomy_database(self, taxdump_file=None):
"""Updates the ncbi taxonomy database by downloading and parsing the latest
taxdump.tar.gz file from the NCBI FTP site (via HTTP).
:param None taxdump_file: an alternative location of the taxdump.tax.gz file.
"""
if not taxdump_file:
upd... | (self, taxdump_file=None) | [
-0.042992159724235535,
0.04306316003203392,
-0.010739164426922798,
0.0019559036009013653,
-0.006669819820672274,
-0.03148971498012543,
-0.04079107195138931,
0.023785917088389397,
-0.005187637638300657,
-0.0646124929189682,
-0.06379596143960953,
0.024992963299155235,
-0.0535360649228096,
-0... |
720,719 | ete3.nexml | Nexml | Creates a new nexml project. | class Nexml(_nexml.Nexml):
""" Creates a new nexml project. """
def __repr__(self):
return "NeXML project <%s>" %hex(hash(self))
def __init__(self, *args, **kargs):
_nexml.Nexml.__init__(self, *args, **kargs)
def build_from_file(self, fname, index_otus=True):
""" Populate Nexml... | (*args, **kargs) | [
-0.013987379148602486,
-0.026689430698752403,
0.011237158440053463,
-0.012513034045696259,
-0.012342916801571846,
-0.005391756538301706,
-0.06679918617010117,
0.03723667189478874,
0.06736624240875244,
-0.014781257137656212,
0.0182592011988163,
-0.009753361344337463,
0.01325965765863657,
0.... |
720,720 | ete3.nexml | __init__ | null | def __init__(self, *args, **kargs):
_nexml.Nexml.__init__(self, *args, **kargs)
| (self, *args, **kargs) | [
-0.018396900966763496,
-0.04351206123828888,
0.06822691112756729,
-0.011722149327397346,
-0.02506294846534729,
0.019615238532423973,
-0.06582504510879517,
0.06366685032844543,
0.09990369528532028,
0.01697840727865696,
0.019754476845264435,
0.044417113065719604,
0.005521680694073439,
0.0651... |
720,721 | ete3.nexml | __repr__ | null | def __repr__(self):
return "NeXML project <%s>" %hex(hash(self))
| (self) | [
0.020103398710489273,
-0.05640645697712898,
0.022992510348558426,
0.0370769277215004,
0.027515344321727753,
-0.07436022162437439,
-0.028770731762051582,
0.0107911741361022,
0.06672471016645432,
-0.011754211038351059,
0.004423951730132103,
-0.01478949747979641,
0.007631208747625351,
0.08000... |
720,722 | ete3.nexml._nexml | add_characters | null | def add_characters(self, value): self.characters.append(value)
| (self, value) | [
0.002841328736394644,
0.006429283879697323,
0.011041776277124882,
0.03328295052051544,
0.0018510115332901478,
0.05455351248383522,
-0.035141222178936005,
0.008432731963694096,
0.050770603120326996,
-0.015604494139552116,
-0.0028351068031042814,
-0.010270262137055397,
0.01519799791276455,
0... |
720,723 | ete3.nexml._nexml | add_meta | null | def add_meta(self, value): self.meta.append(value)
| (self, value) | [
-0.006402600556612015,
0.018307501450181007,
-0.05889219790697098,
0.029060855507850647,
0.0706840381026268,
0.03457152843475342,
0.016942394897341728,
0.024789663031697273,
0.021071214228868484,
-0.007780269253998995,
-0.01199283730238676,
0.038055483251810074,
0.009455245919525623,
0.000... |
720,724 | ete3.nexml._nexml | add_otus | null | def add_otus(self, value): self.otus.append(value)
| (self, value) | [
-0.019882407039403915,
-0.013106226921081543,
0.002790439408272505,
0.025286516174674034,
0.0020265409257262945,
0.013560778461396694,
-0.06114555895328522,
-0.02191947028040886,
0.00830397754907608,
-0.0317007377743721,
-0.00207599438726902,
-0.03713851794600487,
-0.0068771918304264545,
-... |
720,725 | ete3.nexml._nexml | add_trees | null | def add_trees(self, value): self.trees.append(value)
| (self, value) | [
-0.011722378432750702,
0.007979238405823708,
-0.02411317452788353,
0.02306041680276394,
-0.008664366789162159,
0.07379332929849625,
-0.041609011590480804,
0.0042820521630346775,
-0.00030679337214678526,
0.008973510004580021,
0.027171187102794647,
-0.0032606259919703007,
-0.004332183394581079... |
720,726 | ete3.nexml._nexml | build | null | def build(self, node):
self.buildAttributes(node, node.attrib, [])
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
| (self, node) | [
-0.01812286488711834,
-0.003077298402786255,
-0.0032948623411357403,
-0.013340940698981285,
-0.019109753891825676,
0.046006955206394196,
-0.006782616954296827,
0.008617332205176353,
0.07102009654045105,
0.011474823579192162,
0.02190892957150936,
0.0981864482164383,
0.03622778505086899,
0.0... |
720,727 | ete3.nexml._nexml | buildAttributes | null | def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('version', node)
if value is not None and 'version' not in already_processed:
already_processed.append('version')
try:
self.version = float(value)
except ValueError as exp:
raise V... | (self, node, attrs, already_processed) | [
0.056057825684547424,
0.02897842600941658,
0.02519863098859787,
0.022916147485375404,
0.014352263882756233,
-0.006285963114351034,
-0.02483343333005905,
0.0004099913057871163,
0.06087843328714371,
0.0361180379986763,
0.029526222497224808,
0.043933264911174774,
0.053501442074775696,
0.06518... |
720,728 | ete3.nexml._nexml | buildChildren | null | def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'otus':
obj_ = Taxa.factory()
obj_.build(child_)
self.otus.append(obj_)
elif nodeName_ == 'characters':
type_name_ = child_.attrib.get('{http://www.w3.org/2001/XMLSchema-instance}type')
... | (self, child_, node, nodeName_, fromsubclass_=False) | [
-0.010731488466262817,
-0.010667935013771057,
0.026964906603097916,
-0.04735654965043068,
-0.048446040600538254,
0.06024886295199394,
-0.026510952040553093,
0.023260638117790222,
0.047647081315517426,
0.011485053226351738,
0.03631637245416641,
0.07270538061857224,
0.023587483912706375,
0.0... |
720,729 | ete3.nexml | build_from_file | Populate Nexml project with data in a nexml file. | def build_from_file(self, fname, index_otus=True):
""" Populate Nexml project with data in a nexml file. """
doc = _nexml.parsexml_(fname)
rootNode = doc.getroot()
rootTag, rootClass = _nexml.get_root_tag(rootNode)
if rootClass is None:
rootTag = 'Nexml'
rootClass = self.__class__
... | (self, fname, index_otus=True) | [
-0.02461238205432892,
-0.01732284389436245,
0.0038643614389002323,
-0.0007555539486929774,
-0.027872299775481224,
0.0022287426982074976,
-0.0561068132519722,
0.02026582509279251,
0.06027226522564888,
-0.030661342665553093,
0.002845637034624815,
0.012242804281413555,
-0.013637324795126915,
... |
720,730 | ete3.nexml | export | null | def export(self, outfile=stdout, level=0):
namespace='xmlns:nex="http://www.nexml.org/2009"'
return super(Nexml, self).export(outfile=outfile, level=level, namespacedef_=namespace)
| (self, outfile=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, level=0) | [
-0.0432136096060276,
-0.011127418838441372,
0.05429839715361595,
-0.05736802890896797,
0.056822314858436584,
-0.014282319694757462,
-0.06838460266590118,
0.03368069604039192,
0.04686306416988373,
0.000043200019717914984,
-0.017974406480789185,
-0.030423473566770554,
-0.003161295549944043,
... |
720,731 | ete3.nexml._nexml | exportAttributes | null | def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Nexml'):
super(Nexml, self).exportAttributes(outfile, level, already_processed, namespace_, name_='Nexml')
if self.version is not None and 'version' not in already_processed:
already_processed.append('version')
o... | (self, outfile, level, already_processed, namespace_='', name_='Nexml') | [
0.007369430735707283,
0.004874891601502895,
0.021800866350531578,
-0.00969708152115345,
0.04079098254442215,
-0.02926691621541977,
-0.05333394929766655,
-0.014721293933689594,
0.032024964690208435,
0.010786246508359909,
-0.021027909591794014,
-0.0115504190325737,
0.022064372897148132,
0.05... |
720,732 | ete3.nexml._nexml | exportChildren | null | def exportChildren(self, outfile, level, namespace_='', name_='Nexml', fromsubclass_=False):
super(Nexml, self).exportChildren(outfile, level, namespace_, name_, True)
for otus_ in self.otus:
otus_.export(outfile, level, namespace_, name_='otus')
for characters_ in self.get_characters():
cha... | (self, outfile, level, namespace_='', name_='Nexml', fromsubclass_=False) | [
-0.02941896952688694,
-0.025467704981565475,
-0.013003257103264332,
-0.02455172874033451,
-0.0026424089446663857,
0.009114852175116539,
-0.061352383345365524,
-0.030999476090073586,
0.027658861130475998,
0.017430471256375313,
0.00672164186835289,
-0.01831052452325821,
0.03354983776807785,
... |
720,733 | ete3.nexml._nexml | exportLiteral | null | def exportLiteral(self, outfile, level, name_='Nexml'):
level += 1
self.exportLiteralAttributes(outfile, level, [], name_)
if self.hasContent_():
self.exportLiteralChildren(outfile, level, name_)
| (self, outfile, level, name_='Nexml') | [
0.001678286585956812,
-0.062157806009054184,
0.07033555954694748,
-0.0033436878584325314,
0.049822453409433365,
0.019465116783976555,
-0.017137205228209496,
-0.002426697174087167,
-0.008890731260180473,
-0.031852010637521744,
0.010067571885883808,
0.012541513890028,
-0.007155535276979208,
... |
720,734 | ete3.nexml._nexml | exportLiteralAttributes | null | def exportLiteralAttributes(self, outfile, level, already_processed, name_):
if self.version is not None and 'version' not in already_processed:
already_processed.append('version')
showIndent(outfile, level)
outfile.write('version = %f,\n' % (self.version,))
if self.generator is not None... | (self, outfile, level, already_processed, name_) | [
0.0218190960586071,
-0.016377465799450874,
0.043357785791158676,
0.004352865740656853,
0.04756387695670128,
-0.015536247752606869,
-0.017131056636571884,
-0.004011121112853289,
0.009577618911862373,
0.010856972075998783,
-0.010313685052096844,
-0.004617937374860048,
0.014800181612372398,
0... |
720,735 | ete3.nexml._nexml | exportLiteralChildren | null | def exportLiteralChildren(self, outfile, level, name_):
super(Nexml, self).exportLiteralChildren(outfile, level, name_)
showIndent(outfile, level)
outfile.write('otus=[\n')
level += 1
for otus_ in self.otus:
showIndent(outfile, level)
outfile.write('model_.Taxa(\n')
otus_.exp... | (self, outfile, level, name_) | [
-0.016979023814201355,
-0.03490852564573288,
0.051360465586185455,
-0.01843930594623089,
-0.013488170690834522,
0.01968356966972351,
-0.06760502606630325,
-0.04268517717719078,
0.007551993243396282,
-0.008722811006009579,
0.011535366997122765,
0.0028341575525701046,
-0.006921220105141401,
... |
720,736 | ete3.nexml._nexml | factory | null | def factory(*args_, **kwargs_):
if Nexml.subclass:
return Nexml.subclass(*args_, **kwargs_)
else:
return Nexml(*args_, **kwargs_)
| (*args_, **kwargs_) | [
0.022304056212306023,
-0.06939801573753357,
0.06812937557697296,
-0.06603784114122391,
-0.04587675258517265,
0.02892155572772026,
-0.042756587266922,
0.04834545776247978,
0.03631052374839783,
0.0011775633320212364,
0.02962445095181465,
0.08455312252044678,
-0.024824192747473717,
0.04690537... |
720,737 | ete3.nexml._nexml | gds_format_boolean | null | def gds_format_boolean(self, input_data, input_name=''):
return '%s' % input_data
| (self, input_data, input_name='') | [
0.010317908599972725,
-0.03580430895090103,
0.05343976616859436,
-0.010567938908934593,
0.013334938324987888,
-0.02933686412870884,
-0.0453721284866333,
0.004129663575440645,
0.060607295483350754,
-0.09581153094768524,
0.012543176300823689,
-0.009992869570851326,
0.002796169836074114,
-0.0... |
720,738 | ete3.nexml._nexml | gds_format_boolean_list | null | def gds_format_boolean_list(self, input_data, input_name=''):
return '%s' % input_data
| (self, input_data, input_name='') | [
0.012866763398051262,
-0.040789660066366196,
0.009195356629788876,
-0.03433943912386894,
0.000991006032563746,
-0.0070817722007632256,
-0.028360771015286446,
-0.01933382824063301,
0.07470806688070297,
-0.07464069873094559,
-0.01739707589149475,
-0.028057627379894257,
-0.006858624517917633,
... |
720,739 | ete3.nexml._nexml | gds_format_double | null | def gds_format_double(self, input_data, input_name=''):
return '%e' % input_data
| (self, input_data, input_name='') | [
0.02753930725157261,
0.014110363088548183,
0.061892807483673096,
0.037361714988946915,
0.006028898060321808,
-0.05730569362640381,
-0.02238711342215538,
-0.02843678556382656,
0.05351633578538895,
-0.01625434122979641,
0.034702517092227936,
-0.05797049030661583,
0.005044164136052132,
-0.020... |
720,740 | ete3.nexml._nexml | gds_format_double_list | null | def gds_format_double_list(self, input_data, input_name=''):
return '%s' % input_data
| (self, input_data, input_name='') | [
0.026335345581173897,
0.011507110670208931,
0.018574930727481842,
-0.00725557142868638,
-0.01742338389158249,
-0.03030734322965145,
-0.010113573633134365,
-0.027570335194468498,
0.09552820771932602,
-0.02086133137345314,
-0.011974404565989971,
-0.058311592787504196,
-0.009662969037890434,
... |
720,741 | ete3.nexml._nexml | gds_format_float | null | def gds_format_float(self, input_data, input_name=''):
return '%f' % input_data
| (self, input_data, input_name='') | [
0.01676173135638237,
-0.01957961916923523,
0.036863815039396286,
0.03888515755534172,
0.001968882279470563,
-0.009601379744708538,
-0.015536933206021786,
-0.01094608660787344,
0.030063195154070854,
-0.014260746538639069,
0.022525984793901443,
-0.08434824645519257,
-0.003967742435634136,
-0... |
720,742 | ete3.nexml._nexml | gds_format_float_list | null | def gds_format_float_list(self, input_data, input_name=''):
return '%s' % input_data
| (self, input_data, input_name='') | [
0.020324910059571266,
-0.023110302165150642,
0.003967071417719126,
0.0063852970488369465,
-0.006549888290464878,
0.00036742890370078385,
-0.008166259154677391,
-0.02604762278497219,
0.06887511163949966,
-0.005494816228747368,
-0.0070056794211268425,
-0.09433189779520035,
0.000464231765363365... |
720,743 | ete3.nexml._nexml | gds_format_integer | null | def gds_format_integer(self, input_data, input_name=''):
return '%d' % input_data
| (self, input_data, input_name='') | [
-0.010890264064073563,
-0.005905283614993095,
0.0313585065305233,
0.020809095352888107,
0.052252814173698425,
0.018593547865748405,
-0.007102530915290117,
0.026978541165590286,
0.024967506527900696,
-0.08630406111478806,
0.0012068337528035045,
-0.03773246333003044,
0.0326196625828743,
-0.0... |
720,744 | ete3.nexml._nexml | gds_format_integer_list | null | def gds_format_integer_list(self, input_data, input_name=''):
return '%s' % input_data
| (self, input_data, input_name='') | [
0.008219837211072445,
-0.0213075689971447,
-0.0032466670963913202,
-0.016768131405115128,
0.023547811433672905,
0.02100437879562378,
0.003219295758754015,
-0.026461811736226082,
0.06912747770547867,
-0.06508494168519974,
-0.02374993823468685,
-0.05979594588279724,
0.022722458466887474,
-0.... |
720,745 | ete3.nexml._nexml | gds_format_string | null | def gds_format_string(self, input_data, input_name=''):
return input_data
| (self, input_data, input_name='') | [
0.028543490916490555,
-0.010409093461930752,
0.00994089338928461,
-0.03758978843688965,
-0.01359452772885561,
-0.02675429731607437,
-0.011713366024196148,
0.009021214209496975,
0.11116410791873932,
-0.065280482172966,
-0.0016366104828193784,
-0.020082443952560425,
-0.04063308984041214,
-0.... |
720,746 | ete3.nexml._nexml | gds_str_lower | null | def gds_str_lower(self, instring):
return instring.lower()
| (self, instring) | [
-0.01580912247300148,
-0.001987659838050604,
0.024731598794460297,
0.054389409720897675,
-0.00726783974096179,
-0.04081719368696213,
0.034114859998226166,
0.012265264987945557,
0.07506609708070755,
-0.07406075298786163,
-0.05006640776991844,
-0.005106337834149599,
-0.09121871739625931,
0.0... |
720,747 | ete3.nexml._nexml | gds_validate_boolean | null | def gds_validate_boolean(self, input_data, node, input_name=''):
return input_data
| (self, input_data, node, input_name='') | [
0.029352793470025063,
-0.025244420394301414,
0.046006981283426285,
-0.0015470059588551521,
-0.024531397968530655,
0.020100466907024384,
-0.03982744365930557,
0.031373023986816406,
0.037688374519348145,
-0.08522326499223709,
0.04760279506444931,
0.010338838212192059,
0.035243723541498184,
0... |
720,748 | ete3.nexml._nexml | gds_validate_boolean_list | null | def gds_validate_boolean_list(self, input_data, node, input_name=''):
values = input_data.split()
for value in values:
if value not in ('true', '1', 'false', '0', ):
raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")')
return input_data
| (self, input_data, node, input_name='') | [
0.018016038462519646,
-0.014686190523207188,
-0.02638193778693676,
-0.04839746281504631,
-0.023685036227107048,
0.042123038321733475,
-0.043040353804826736,
0.012117711827158928,
0.016713453456759453,
-0.061313237994909286,
0.009888640604913235,
0.05206671729683876,
0.02487754449248314,
-0... |
720,749 | ete3.nexml._nexml | gds_validate_double | null | def gds_validate_double(self, input_data, node, input_name=''):
return input_data
| (self, input_data, node, input_name='') | [
0.04996052756905556,
0.024879738688468933,
0.05498673766851425,
0.04389556497335434,
-0.03695939853787422,
-0.02194778248667717,
-0.03917092829942703,
0.010328860953450203,
0.08691992610692978,
-0.02853211760520935,
0.03354157507419586,
-0.022567681968212128,
0.007518372498452663,
-0.02035... |
720,750 | ete3.nexml._nexml | gds_validate_double_list | null | def gds_validate_double_list(self, input_data, node, input_name=''):
values = input_data.split()
for value in values:
try:
fvalue = float(value)
except (TypeError, ValueError) as exp:
raise_parse_error(node, 'Requires sequence of doubles')
return input_data
| (self, input_data, node, input_name='') | [
0.06439833343029022,
0.03836051747202873,
-0.016665242612361908,
0.006679151207208633,
-0.037977609783411026,
0.022347960621118546,
-0.015882020816206932,
-0.005486911628395319,
0.06492047756910324,
0.04048392176628113,
0.01132192276418209,
-0.009790286421775818,
-0.0027695633471012115,
-0... |
720,751 | ete3.nexml._nexml | gds_validate_float | null | def gds_validate_float(self, input_data, node, input_name=''):
return input_data
| (self, input_data, node, input_name='') | [
0.03511102497577667,
-0.008861512877047062,
0.03889685124158859,
0.04298420250415802,
-0.021927637979388237,
0.015260564163327217,
-0.032732319086790085,
0.0105199059471488,
0.043955784291028976,
-0.021793626248836517,
0.041476570069789886,
-0.058462534099817276,
0.01025188248604536,
-0.03... |
720,752 | ete3.nexml._nexml | gds_validate_float_list | null | def gds_validate_float_list(self, input_data, node, input_name=''):
values = input_data.split()
for value in values:
try:
fvalue = float(value)
except (TypeError, ValueError) as exp:
raise_parse_error(node, 'Requires sequence of floats')
return input_data
| (self, input_data, node, input_name='') | [
0.04154522716999054,
0.002585730515420437,
-0.04331532493233681,
0.003876426722854376,
-0.03321535885334015,
0.04866032674908638,
-0.022560065612196922,
0.003928488586097956,
0.04876444861292839,
0.033926866948604584,
0.019679319113492966,
-0.03880331292748451,
0.005830909125506878,
-0.054... |
720,753 | ete3.nexml._nexml | gds_validate_integer | null | def gds_validate_integer(self, input_data, node, input_name=''):
return input_data
| (self, input_data, node, input_name='') | [
0.012147409841418266,
-0.010437337681651115,
0.014581946656107903,
0.02668723650276661,
0.013250954449176788,
0.0372677817940712,
-0.008929441682994366,
0.029703030362725258,
0.03293784707784653,
-0.10749026387929916,
0.0261649489402771,
-0.0077711413614451885,
0.03207859769463539,
-0.0380... |
720,754 | ete3.nexml._nexml | gds_validate_integer_list | null | def gds_validate_integer_list(self, input_data, node, input_name=''):
values = input_data.split()
for value in values:
try:
fvalue = float(value)
except (TypeError, ValueError) as exp:
raise_parse_error(node, 'Requires sequence of integers')
return input_data
| (self, input_data, node, input_name='') | [
0.030170291662216187,
0.0023515596985816956,
-0.03924247622489929,
-0.004764655604958534,
-0.007274451199918985,
0.0668458342552185,
-0.016280705109238625,
-0.0009439204586669803,
0.031084543094038963,
-0.022487064823508263,
0.009124930948019028,
-0.015208217315375805,
0.03370422497391701,
... |
720,755 | ete3.nexml._nexml | gds_validate_string | null | def gds_validate_string(self, input_data, node, input_name=''):
return input_data
| (self, input_data, node, input_name='') | [
0.02296273224055767,
0.021776465699076653,
0.036808159202337265,
-0.011345792561769485,
-0.03167331963777542,
-0.00832504965364933,
0.008172529749572277,
0.05131450667977333,
0.134895458817482,
-0.08751258254051208,
0.02926689200103283,
0.034520357847213745,
-0.00760481646284461,
0.0035185... |
720,756 | ete3.nexml._nexml | get_about | null | def get_about(self): return self.about
| (self) | [
-0.0329880528151989,
-0.00878794677555561,
0.050936393439769745,
-0.0038508232682943344,
0.04302635416388512,
-0.011457141488790512,
0.05068809539079666,
0.016396481543779373,
0.03222542628645897,
-0.02211618423461914,
-0.0006922392640262842,
-0.03206580877304077,
0.011226579546928406,
0.0... |
720,757 | ete3.nexml._nexml | get_anyAttributes_ | null | def get_anyAttributes_(self): return self.anyAttributes_
| (self) | [
0.017050594091415405,
-0.03516949713230133,
0.07094945758581161,
0.015710964798927307,
0.012234712019562721,
-0.009360444732010365,
0.029217476025223732,
-0.05941847711801529,
0.10642419010400772,
0.007321326527744532,
-0.0035398423206061125,
-0.008707587607204914,
0.015049628913402557,
0.... |
720,758 | ete3.nexml._nexml | get_characters | null | def get_characters(self): return self.characters
| (self) | [
0.013700347393751144,
-0.004790507256984711,
0.05154619365930557,
0.01961507275700569,
0.019178809598088264,
0.027736281976103783,
-0.017870018258690834,
-0.014942020177841187,
0.13007360696792603,
-0.031108934432268143,
-0.004530427511781454,
-0.013113070279359818,
-0.0064390795305371284,
... |
720,759 | ete3.nexml._nexml | get_generator | null | def get_generator(self): return self.generator
| (self) | [
0.04028467833995819,
-0.0569966621696949,
-0.013431157916784286,
0.031823135912418365,
-0.0010604413691908121,
0.04084760695695877,
-0.011830326169729233,
0.02677435800433159,
0.05178955942392349,
0.016219420358538628,
0.02526148408651352,
0.002495802938938141,
-0.018629465252161026,
0.075... |
720,760 | ete3.nexml._nexml | get_meta | null | def get_meta(self): return self.meta
| (self) | [
0.017402058467268944,
-0.002145877107977867,
0.004872576333582401,
0.011806279420852661,
0.0676194280385971,
0.012637961655855179,
0.06367797404527664,
0.016507094725966454,
0.04896080121397972,
0.007042183540761471,
-0.016904857009649277,
0.0038646128959953785,
-0.01369564514607191,
0.001... |
720,761 | ete3.nexml._nexml | get_otus | null | def get_otus(self): return self.otus
| (self) | [
-0.009685794822871685,
-0.031506966799497604,
0.04490608349442482,
0.030745258554816246,
0.024720849469304085,
-0.020479528233408928,
-0.04539080336689949,
-0.01402233075350523,
0.04168614000082016,
-0.03974724933505058,
-0.005111226346343756,
-0.061802126467227936,
-0.020618019625544548,
... |
720,762 | ete3.nexml._nexml | get_path_ | null | def get_path_(self, node):
path_list = []
self.get_path_list_(node, path_list)
path_list.reverse()
path = '/'.join(path_list)
return path
| (self, node) | [
-0.003804542124271393,
0.03015822172164917,
0.014479422941803932,
0.06264566630125046,
0.009073539637029171,
-0.006774736102670431,
-0.010976897552609444,
0.06799940019845963,
0.08489495515823364,
-0.03168785944581032,
0.059864502400159836,
-0.0311142448335886,
0.0015209477860480547,
0.026... |
720,763 | ete3.nexml._nexml | get_path_list_ | null | def get_path_list_(self, node, path_list):
if node is None:
return
tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
if tag:
path_list.append(tag)
self.get_path_list_(node.getparent(), path_list)
| (self, node, path_list) | [
0.005266177002340555,
-0.024223526939749718,
-0.009405472315847874,
0.012333590537309647,
-0.0330788679420948,
0.009627299383282661,
0.038331735879182816,
0.047808192670345306,
0.07701839506626129,
0.0049334364011883736,
0.050505608320236206,
-0.018988406285643578,
0.001245559542439878,
-0... |
720,764 | ete3.nexml._nexml | get_trees | null | def get_trees(self): return self.trees
| (self) | [
-0.007454166188836098,
-0.008185215294361115,
0.01567741297185421,
-0.0016839485615491867,
-0.00009118306479649618,
0.047361843287944794,
-0.0187790896743536,
-0.011265764012932777,
0.05943049490451813,
0.009313481859862804,
0.03140553459525108,
-0.04915354773402214,
-0.043305154889822006,
... |
720,765 | ete3.nexml._nexml | get_version | null | def get_version(self): return self.version
| (self) | [
0.060586944222450256,
-0.03424106165766716,
-0.005419356282800436,
0.05828704312443733,
0.08114874362945557,
-0.04483090341091156,
0.011113326996564865,
0.015429932624101639,
0.02706674486398697,
-0.005895641632378101,
-0.024612372741103172,
-0.04730243980884552,
-0.049842629581689835,
0.0... |
720,766 | ete3.nexml._nexml | hasContent_ | null | def hasContent_(self):
if (
self.otus or
self.characters or
self.trees or
super(Nexml, self).hasContent_()
):
return True
else:
return False
| (self) | [
0.03827691823244095,
-0.04057490453124046,
0.059404678642749786,
0.021127760410308838,
0.03673349320888519,
0.0406092032790184,
-0.016591809689998627,
0.020904822275042534,
0.04527377337217331,
-0.012295945547521114,
0.04105507954955101,
0.022516842931509018,
0.02452329359948635,
-0.000181... |
720,767 | ete3.nexml._nexml | insert_characters | null | def insert_characters(self, index, value): self.characters[index] = value
| (self, index, value) | [
0.015418356284499168,
0.01040507759898901,
0.0010861404007300735,
-0.010548073798418045,
0.010304138995707035,
0.04882058873772621,
-0.03435273841023445,
0.03475649282336235,
0.026563649997115135,
-0.021079324185848236,
-0.011944389902055264,
-0.00659464905038476,
0.006089956499636173,
0.0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.