microbetag.build_mtg_cx2

Aim:

Gets an edgelist as input along with a df mentioning the NCBI Tax ids and the GTDB ids of the corresponding taxa and based on the annotation types asked, it build a cx-format graph that is going to be the final return object of microbetag

Author:

Haris Zafeiropoulos

Based on:

https://github.com/msysbio/microbetagApp/blob/develop/services/web/microbetag/scripts/buid_cx_annotated_graph.py

Module Contents

microbetag.build_mtg_cx2.build_pseudo_cx(conf)[source]

Builds a .cx (version 2) file, the user can then load on Cytoscape and parse it through the MGG app.

Important! In every case, we need a way to map sequence id to a taxonomy. Either an abundance table or a sequence id to taxonomy map (sequence_id_taxonomy_map) is required.

microbetag.build_mtg_cx2.build_mtg_nodes(conf, edgelist, seq_id_to_taxonomy, phen_traits, faprotax_traits, manta_annotations=None, cartesian_layout=None)[source]

Builds the nodes and attributes for the pseudo-CX Microbetag network.

microbetag.build_mtg_cx2.build_mtg_edges(conf, edgelist, seq_to_nodeID, node_counter, complements_dict_ext, seed_scores, seed_complements_dict, non_seed_sets, kmap)[source]
microbetag.build_mtg_cx2.seqId_faprotax_functions_assignment(path_to_subtables)[source]

Parse the sub tables of the faprotax analysis to assign the biological processes related to each sequence id

microbetag.build_mtg_cx2.add_edge_pathway_complements(id_x, id_y, complements_dict_ext, edges, edgeAttributes, pot_edge, edge_counter)[source]

id_x beneficiary id_y donor

microbetag.build_mtg_cx2.add_edge_seed_complements(id_x, id_y, complements_dict, edges, edgeAttributes, pot_edge, edge_counter, kmap, non_seed_sets, shortener)[source]

Appends the seed complementarities between two taxa as attributes to their corresponding edge id_x: id_y:

microbetag.build_mtg_cx2.add_seed_edge_attributes(id_x, id_y, seed_scores, edgeAttributes, edge_counter)[source]
class microbetag.build_mtg_cx2.UpdateCX2Netork(microbetag_cx, outfile=None)[source]

Convert the initial microbetag-annotated network to a .cx2 format file.

get_nodes()[source]

Builds cx2-like nodes based on the initial network

Returns:

nodes (list)

Return type:

List with cx2-like nodes after the ndex2 library

get_edges()[source]

Builds cx2-like edges based on the initial network

Returns:

edges (list)

Return type:

List with cx2-like edges after the ndex2 library

build_cx()[source]

Writes a .cx2 network using the nodes and edges returned by the get_nodes() and get_edges() attributes

microbetag.build_mtg_cx2.build_ndex2_net(microbetag_pseudo_cx, outfile=None)[source]

Wrapper to fire an instance of UpdateCX2Netork class aiming to export a microbetag-annotated network file to .cx2 format

Parameters:

list) (microbetag_net_file (str |)

Returns:

(boolean)

Return type:

A .cx2 format file was successfully saved or not