repic.commands.get_cliques ========================== .. py:module:: repic.commands.get_cliques .. autoapi-nested-parse:: Finds cliques (potential consensus particles) of size k in each graph (micrograph) Attributes ---------- .. autoapisummary:: repic.commands.get_cliques.name repic.commands.get_cliques.parser Functions --------- .. autoapisummary:: repic.commands.get_cliques.add_arguments repic.commands.get_cliques.add_nodes_to_graph repic.commands.get_cliques.calc_jaccard repic.commands.get_cliques.find_cliques repic.commands.get_cliques.main Module Contents --------------- .. py:data:: name :value: 'get_cliques' module name (used by argparse subparser) :type: str .. py:function:: add_arguments(parser) Adds argparse command line arguments for get_cliques.py :param parser: argparse parse_args() object :type parser: object :returns: None .. py:function:: add_nodes_to_graph(graph, node_pairs, node_names, k=3) Adds vertices and edges to the graph :param graph: NetworkX graph() object :type graph: obj :param node_pairs: list of paired vertex (particle bounding box) coordinates and their edge weight :type node_pairs: list :param node_names: list of node (particle picking algorithm) names :type node_names: list :keyword k: number of methods :kwtype k: int, default=3 :returns: None .. py:function:: 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 :param x: x-coodinate of particle bounding box A :type x: int :param y: y-coordinate of particle bounding box A :type y: int :param a: x-coordinate of particle bounding box B :type a: int :param b: y-coordinate of particle bounding box B :type b: int :param box_size: particle bounding box height/width :type box_size: int :returns: Jaccard Index of two particle bounding boxes :rtype: float .. py:function:: find_cliques(graph, k) Finds all cliques in graph of size k :param graph: NetworkX graph() object :type graph: obj :param k: clique size :type k: int :returns: set of k-sized cliques in the graph :rtype: set .. py:function:: main(args) Builds NetworkX graph from file set and finds all k-sized cliques :param args: argparse command line argument object :type args: obj .. py:data:: parser argparse parse_args() object :type: obj