repic.commands.get_cliques

Finds cliques (potential consensus particles) of size k in each graph (micrograph)

Attributes

name

module name (used by argparse subparser)

parser

argparse parse_args() object

Functions

add_arguments(parser)

Adds argparse command line arguments for get_cliques.py

add_nodes_to_graph(graph, node_pairs, node_names[, k])

Adds vertices and edges to the graph

calc_jaccard(x, y, a, b, box_size)

Calculates Jaccard Index (similarity) for particle bounding boxes A (x,y) and B (a,b) with given box size

find_cliques(graph, k)

Finds all cliques in graph of size k

main(args)

Builds NetworkX graph from file set and finds all k-sized cliques

Module Contents

repic.commands.get_cliques.name = 'get_cliques'

module name (used by argparse subparser)

Type:

str

repic.commands.get_cliques.add_arguments(parser)

Adds argparse command line arguments for get_cliques.py

Parameters:

parser (object) – argparse parse_args() object

Returns:

None

repic.commands.get_cliques.add_nodes_to_graph(graph, node_pairs, node_names, k=3)

Adds vertices and edges to the graph

Parameters:
  • graph (obj) – NetworkX graph() object

  • node_pairs (list) – list of paired vertex (particle bounding box) coordinates and their edge weight

  • node_names (list) – list of node (particle picking algorithm) names

Keyword Arguments:

k (int, default=3) – number of methods

Returns:

None

repic.commands.get_cliques.calc_jaccard(x, y, a, b, box_size)

Calculates Jaccard Index (similarity) for particle bounding boxes A (x,y) and B (a,b) with given box size

Parameters:
  • x (int) – x-coodinate of particle bounding box A

  • y (int) – y-coordinate of particle bounding box A

  • a (int) – x-coordinate of particle bounding box B

  • b (int) – y-coordinate of particle bounding box B

  • box_size (int) – particle bounding box height/width

Returns:

Jaccard Index of two particle bounding boxes

Return type:

float

repic.commands.get_cliques.find_cliques(graph, k)

Finds all cliques in graph of size k

Parameters:
  • graph (obj) – NetworkX graph() object

  • k (int) – clique size

Returns:

set of k-sized cliques in the graph

Return type:

set

repic.commands.get_cliques.main(args)

Builds NetworkX graph from file set and finds all k-sized cliques

Parameters:

args (obj) – argparse command line argument object

repic.commands.get_cliques.parser

argparse parse_args() object

Type:

obj