AlloViz.Protein.analyze#

Protein.analyze(pkgs='all', filterings='all', elements='edges', metrics='all', cores=1, nodes_dict={'btw': 'networkx.algorithms.centrality.betweenness_centrality', 'cfb': 'networkx.algorithms.centrality.current_flow_betweenness_centrality'}, edges_dict={'btw': 'networkx.algorithms.centrality.edge_betweenness_centrality', 'cfb': 'networkx.algorithms.centrality.edge_current_flow_betweenness_centrality'}, **kwargs)[source]#

Analyzed filtered network

Analyze the selected (un)filtered networks with the passed elements-metrics. It calls AlloViz.AlloViz.Analysis.analyze() and results are stored in instances of classes from the AlloViz.AlloViz.Elements module, which extend the pandas.DataFrame class.

Parameters:
pkgsstr or list, default: “all”

Package(s)/Network construction method(s) for which to analyze their raw edge weights, which must be already calculated and their data saved as instance attribute. In this case, “all” sends the computation for all available methods that are already calculated and saved as instance attributes.

filteringsstr or list, default: “all”

Filtering scheme(s) for which to perform the analyses, which must exist already for the selected packages. “all” sends the computation for all available schemes that are already saved.

elementsstr or list, {“edges”, “nodes”}

Network elements for which to perform the analysis.

metricsstr or list, default: “all”

Network metrics to compute, which must be keys in the nodes_dict or edges_dict dictionaries. Default is “all” and it sends the computation for all the metrics defined in the corresponding dictionary of the selected elements in element.

coresint, default: 1

Number of cores to use for parallelization with a multiprocess Pool. Default value only uses 1 core with a custom AlloViz.utils.dummypool that performs computations synchronously.

Other Parameters:
nodes_dict, edges_dictdict

Optional kwarg(s) of the dictionary(ies) that maps network metrics custom names (e.g., betweenness centrality, “btw”) with their corresponding NetworkX function (e.g., “networkx.algorithms.centrality.betweenness_centrality”). Functions strings must be written as if they were absolute imports, and must return a dictionary of edges or nodes, depending on the element dictionary in which they are. The keys of the dictionaries will be used to name the columns of the analyzed data that the functions produce. Defaults are nodes_dict and edges_dict.

**kwargs

Other optional keyword arguments that will be passed to the NetworkX analysis function(s) that is(are) used on the method call in case they need extra parameters. All keyward arguments will be passed to all analysis function calls, so if the function doesn’t accept the arguments there will be an error. weight parameter is already specified by AlloViz.

See also

AlloViz.AlloViz.Analysis

Module with analysis functions.

AlloViz.Protein.calculate

Class method to calculate the network(s) raw edge weights with different network construction methods.

AlloViz.Protein.filter

Class method to filter the network(s) raw edge weights with different criteria.

AlloViz.Protein.view

Class method to visualize the network on the protein structure.

Examples

>>> opioidGPCR = AlloViz.Protein(GPCR=169)
>>> opioidGPCR.calculate(["getcontacts", "dynetan"], cores=6, taskcpus=2)
>>> opioidGPCR.filter("dynetan", "GetContacts_edges")
>>> opioidGPCR.analyze("dynetan", "GetContacts_edges", "nodes", "btw")
<AlloViz.AlloViz.Elements.Nodes at 0x7f892c3c0fa0>