mossnet package¶
MossNet is a Python library for performing network analyses on MOSS results
Module contents¶
-
mossnet.build(moss_results_links, verbose=False)[source]¶ Download MOSS results into a
MossNetobject- Args:
moss_results_links(list): A list of MOSS result URLsverbose(bool):Trueto show verbose messages, otherwiseFalse- Returns:
MossNet: AMossNetobject
-
mossnet.load(mossnet_file)[source]¶ Load a
MossNetobject from file- Args:
mossnet_file(str): The desired input file- Returns:
MossNet: The resultingMossNetobject
-
class
mossnet.MossNet(moss_results_dict)[source]¶ Bases:
object-
export(outpath, style='html', gte=0, verbose=False)[source]¶ Export the links in this
MossNetin the specified style- Args:
outpath(str): Path to desired output folder/filestyle(str): Desired output stylegte(int): The minimum number of links for an edge to be exported"dot"to export as a GraphViz DOT file"gexf"to export as a Graph Exchange XML Format (GEXF) file"html"to export one HTML file per pair
verbose(bool):Trueto show verbose messages, otherwiseFalse
-
get_networkx()[source]¶ Return a NetworkX
MultiDiGraphequivalent to thisMossNetobject- Returns:
MultiDiGraph: A NetworkXDiGraphequivalent to thisMossNetobject
-
get_nodes()[source]¶ Returns a
setof node labels in thisMossNetobject- Returns:
set: The node labels in thisMossNetobject
-
get_pair(u, v, style='tuples')[source]¶ Returns the links between nodes
uandv- Args:
u(str): A node labelv(str): A node label not equal toustyle(str): The representation of a given link"tuples": Links are((u_percent, u_html), (v_percent, v_html))tuples"html": Links are HTML representation (one HTML for all links)"htmls": Links are HTML representations (one HTML per link)
- Returns:
dict: The links betweenuandv(keys are filenames)
-
num_edges()[source]¶ Returns the number of (undirected) edges in this
MossNetobject (including parallel edges)- Returns:
int: The number of (undirected) edges in thisMossNetobject (including parallel edges)
-
num_links(u, v)[source]¶ Returns the number of links between
uandv- Args:
u(str):v(str):- Returns:
int: The number of links betweenuandv
-
num_nodes()[source]¶ Returns the number of nodes in this
MossNetobject- Returns:
int: The number of nodes in thisMossNetobject
-