Networks

class network.networks.Network(hits: protlego.database.data.Result)[source]

Graph constructor and visualizer .. rubric:: Examples

hits = fetch_subspace(args) g = Network(hits) g.create_graph() g.plot_graph(labels=[‘ids’,’domains’,’folds’]) g.get_fragments() g.view_vertex(v1) g.view_edge(v1,v2) g.view_component(n)

create_network()graph_tool.Graph[source]

Creates a network based on the hits. It draws a node for every unique cluster and links two cluster when they have a fragment (hit) in common. :return: A Graph object

property fragments

This function creates and prints out the number of fragments in the graph :rtype: integer, number of fragments

get_representative_domain(frag: int)int[source]

Gets the most representative domain of a fragment (or graph component) :param frag: the index of the fragment :return: A vertex object

plot_graph(graph, fill, **keyword_parameters)[source]

This function plots the graph with customized labels :param graph: A graph-tool object to plot :param fill: To choose between [‘fam’,’sufam’,’fold’,’class’] :param keyword_parameters: labels, output (filename). labels can be: “domain”,”fam”,”sufam”,”fold”,”scopclass” :return: A plot of the computed with the customized colors

show_component(fragment: int)[source]

Aligns the fragment(s) of all domains belonging to a component, provided the component has less than 50 vertices. Note that all domains in the same component present a fragment in common in different protein environments :param fragment: :return:

show_edge(edge: graph_tool.Graph.edge)Tuple[protlego.builder.chimera.Chimera, protlego.builder.chimera.Chimera][source]

Shows an alignment of the two domains that the edge links with their respective fragment they have in common colored in red :param edge: A graph tool edge object :return: The query and subject chimera objects. It also opens a VMD window with the superimposition.

show_vertex(vertex: graph_tool.Graph.vertex)protlego.builder.chimera.Chimera[source]

Shows the protein that corresponds to that specific vertex with the fragment colored in red :param vertex: A Graph.vertex object. The domain to be shown, :return: A Chimera object with an internal representation of the fragment

property sizes

Computes the average size for each fragment. :return: list of tuples with the average and the stds of sizes (float)