Exemplo n.º 1
0
def update_cellular_component_hierarchy():
    logger.info('--Updating GO cellular components----')
    g = load_latest_go()
    component_map, component_part_map = go_client.get_cellular_components(g)
    # Save the cellular component ID->name mappings
    fname = os.path.join(path, 'cellular_components.tsv')
    logger.info('Saving into %s' % fname)
    with open(fname, 'wb') as fh:
        fh.write('id\tname\n'.encode('utf-8'))
        for comp_id, comp_name in sorted(component_map.items(),
                                          key=lambda x: x[0]):
            fh.write(('%s\t%s\n' % (comp_id, comp_name)).encode('utf-8'))
    # Create the cellular component hierarchy
    gg = mcch.make_component_hierarchy(component_map, component_part_map)
    mcch.save_hierarchy(gg, mcch.rdf_file)
Exemplo n.º 2
0
def update_cellular_component_hierarchy():
    logger.info('--Updating GO cellular components----')
    g = load_latest_go()
    component_map, component_part_map = go_client.get_cellular_components(g)
    # Save the cellular component ID->name mappings
    fname = os.path.join(path, 'cellular_components.tsv')
    logger.info('Saving into %s' % fname)
    with open(fname, 'wb') as fh:
        fh.write('id\tname\n'.encode('utf-8'))
        for comp_id, comp_name in sorted(component_map.items(),
                                          key=lambda x: x[0]):
            fh.write(('%s\t%s\n' % (comp_id, comp_name)).encode('utf-8'))
    # Create the cellular component hierarchy
    gg = mcch.make_component_hierarchy(component_map, component_part_map)
    mcch.save_hierarchy(gg, mcch.rdf_file)