Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = tfd.JointDistributionNamed(dict( | |
frequencies=tfd.Dirichlet(concentration=[4,4,4,4]), | |
kappa=tfd.LogNormal(loc=0, scale=1), | |
pop_size=tfd.LogNormal(loc=0, scale=1), | |
tree=lambda pop_size: treeflow.coalescent.ConstantCoalescent(pop_size=pop_size, sampling_times=sampling_times), | |
sequences=lambda tree, kappa, frequencies: treeflow.sequences.PhyloCTMC(tree=tree, q=HKY(frequencies=frequencies, kappa=kappa)) | |
)) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.etree import ElementTree | |
data_xml_filename = '311spp_5genes.xml' | |
xml_root = ElementTree.parse(data_xml_filename) | |
flat_dict = [{ 'alignment': alignment.attrib['id'], 'taxon': sequence.find('taxon').attrib['idref'], 'sequence': sequence.find('taxon').tail.strip() } for alignment in xml_root.findall('alignment') for sequence in alignment.findall('sequence') ] | |
taxa_dict = { taxon: { value['alignment']: value['sequence'] for value in values } for taxon, values in groupby(sorted(flat_dict, key=key_func), key=key_func) } | |
print(taxa_dict) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder