thapbi_pict.edit_graph module

Generate edit-distance network graph from FASTA files.

This implements the thapbi_pict edit-graph ... command.

thapbi_pict.edit_graph.main(graph_output, graph_format, db_url, input_file, min_abundance=100, show_db_marker=None, total_min_abundance=0, min_samples=0, max_edit_dist=3, ignore_prefixes=None, debug=False)

Run the edit-graph command with arguments from the command line.

This shows sequences from a database (possibly filtered with species/genus limits) and/or selected sample-tally TSV file (optionally with classifier output, and possibly with a minimum abundance limit set here).

Computes a Levenshtein edit-distance matrix from the selected sequences, which can be exported as a matrix, but is usually converted into a graph of unique sequences as nodes, with short edit distances as edges.

Graph node size is scaled by sample count (number of FASTA files that it appears in), and colored by assigned species (from a classifier TSV file).

thapbi_pict.edit_graph.write_pdf(G, handle) None

Render NetworkX graph to PDF using GraphViz fdp.

thapbi_pict.edit_graph.write_xgmml(G, handle, name: str = 'THAPBI PICT edit-graph') None

Save graph in XGMML format suitable for Cytoscape import.