seismicrna.graph package
Submodules
- class seismicrna.graph.aucroll.RollingAUCGraph(*, struct_file: Path | None, struct_sect: str | None, **kwargs)
Bases:
StructOneTableGraph,RollingGraph- property data
Data of the graph.
- get_traces()
Data traces of the graph.
- classmethod graph_kind()
Kind of graph.
- property profile_names
Names of the profiles as they appear in the data.
- classmethod what()
What is being graphed.
- property y_title
Title of the y-axis.
- class seismicrna.graph.aucroll.RollingAUCRunner
Bases:
RollingRunner,StructOneTableRunner,PosGraphRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.aucroll.RollingAUCWriter(table_file: Path)
Bases:
StructOneTableWriter,PosGraphWriter
- class seismicrna.graph.base.GraphBase(*, use_ratio: bool, quantile: float)
Bases:
ABC- abstract property codestring
String of the relationship code(s).
- property col_titles
Titles of the columns.
- property data: DataFrame
Data of the graph.
- property data_kind
either “ratio” or “count”.
- Type:
Kind of data being used
- property figure
Figure object.
- get_path_fields()
Path fields.
- classmethod get_path_segs()
Path segments.
- property graph_filename
Name of the graph’s output file, without its extension.
- property ncols
Number of columns of subplots.
- property nrows
Number of rows of subplots.
- abstract property path_subject
Subject of the graph.
- property predicate
Predicate of the graph.
- abstract property rel_names
Names of the relationships to graph.
- property row_titles
Titles of the rows.
- property title
Title of the graph.
- class seismicrna.graph.base.GraphRunner
Bases:
ABC- abstract classmethod get_table_finder() Callable[[tuple[str, ...]], Generator]
Function to find and filter table files.
- abstract classmethod get_writer_type() type[GraphWriter]
Type of GraphWriter.
- classmethod list_table_files(input_path: tuple[str, ...])
Find, filter, and list all table files from input files.
- abstract classmethod run(input_path: tuple[str, ...], *, rels: tuple[str, ...], use_ratio: bool, quantile: float, cgroup: str, csv: bool, html: bool, svg: bool, pdf: bool, png: bool, force: bool, max_procs: int, parallel: bool, **kwargs) list[Path]
Run graphing.
- classmethod universal_input_params()
Universal parameters controlling the input data.
- classmethod universal_output_params()
Universal parameters controlling the output graph.
- class seismicrna.graph.base.GraphWriter(*table_files: Path)
Bases:
ABCWrite the proper graph(s) for the table(s).
- class seismicrna.graph.base.PosGraphRunner
Bases:
GraphRunner,ABC- classmethod get_table_finder()
Function to find and filter table files.
- class seismicrna.graph.base.PosGraphWriter(*table_files: Path)
Bases:
GraphWriter,ABC- classmethod get_table_loader()
Function to load table files.
- class seismicrna.graph.base.ReadGraphRunner
Bases:
GraphRunner,ABC- classmethod get_table_finder()
Function to find and filter table files.
- class seismicrna.graph.base.ReadGraphWriter(*table_files: Path)
Bases:
GraphWriter,ABC- classmethod get_table_loader()
Function to load table files.
- seismicrna.graph.base.make_index(header: Header, order: int | None, clust: int | None)
Make an index for the rows or columns of a graph.
- class seismicrna.graph.color.ColorMapGraph(*, cmap: str | None = None, **kwargs)
-
Graph with an explicit color map.
- class seismicrna.graph.color.RelColorMap(name: str, v: str, n: str, e: str, m: str, d: str, i: str, s: str, a: str, c: str, g: str, t: str)
Bases:
ColorMapColor map for relationships.
- class seismicrna.graph.color.SeqColorMap(name: str, a: str, c: str, g: str, t: str, n: str)
Bases:
ColorMapColor map for bases A, C, G, and T.
- seismicrna.graph.color.get_cmap(cmap_class: type[ColorMap], name: str | None = None)
Get a color map of a given class by its name.
- seismicrna.graph.color.get_colormaps(cmap_class: type[ColorMap])
Return a dict of all color maps of a given class.
- class seismicrna.graph.corroll.RollingCorrelationGraph(*, metric: str, **kwargs)
Bases:
TwoTableMergedGraph,RollingGraph- property details
Additional details about the graph.
- classmethod graph_kind()
Kind of graph.
- property predicate
Predicate of the graph.
- classmethod what()
What is being graphed.
- property y_title
Title of the y-axis.
- class seismicrna.graph.corroll.RollingCorrelationRunner
Bases:
RollingRunner,TwoTableRunner,PosGraphRunner- classmethod get_writer_type()
Type of GraphWriter.
- classmethod var_params()
Parameters that can vary among different classes.
- class seismicrna.graph.corroll.RollingCorrelationWriter(table1_file: Path, table2_file: Path)
Bases:
TwoTableWriter,PosGraphWriter- classmethod get_graph_type()
Type of graph.
- class seismicrna.graph.delprof.DeltaProfileGraph(*, out_dir: str | Path, table1: Table | PosTable, order1: int | None, clust1: int | None, table2: Table | PosTable, order2: int | None, clust2: int | None, **kwargs)
Bases:
TwoTableMergedGraph,ColorMapGraph- classmethod get_cmap_type()
Type of the color map.
- classmethod graph_kind()
Kind of graph.
- classmethod what()
What is being graphed.
- property y_title
Title of the y-axis.
- class seismicrna.graph.delprof.DeltaProfileRunner
Bases:
TwoTableRunner,PosGraphRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.delprof.DeltaProfileWriter(table1_file: Path, table2_file: Path)
Bases:
TwoTableWriter,PosGraphWriter- classmethod get_graph_type()
Type of graph.
- class seismicrna.graph.giniroll.RollingGiniGraph(*, table: Table | PosTable, order: int | None, clust: int | None, **kwargs)
Bases:
RollingStatGraph- classmethod graph_kind()
Kind of graph.
- classmethod stat_func()
Function to compute a statistic on the data.
- classmethod what()
What is being graphed.
- property y_title
Title of the y-axis.
- class seismicrna.graph.giniroll.RollingGiniRunner
Bases:
RollingStatRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.giniroll.RollingGiniWriter(table_file: Path)
Bases:
RollingStatWriter- classmethod get_graph_type()
Type of graph.
- class seismicrna.graph.hist.HistogramGraph(*, hist_bins: int, hist_margin: float, **kwargs)
-
Generic histogram.
- get_bounds(data: DataFrame)
Get the lower and upper bounds of the histogram.
- get_edges(data: DataFrame)
Get the edges of the histogram bins.
- class seismicrna.graph.hist.HistogramRunner
Bases:
GraphRunner,ABC- classmethod var_params()
Parameters that can vary among different classes.
- seismicrna.graph.hist.get_edges_index(edges: ndarray, use_ratio: bool)
Generate an index for the edges of histogram bins.
- Parameters:
edges (
numpy.ndarray) – Edges of histogram bins.use_ratio (
bool) – Assume the edges represent ratios rather than counts.
- Returns:
Index for the edges.
- Return type:
pandas.Index | pandas.MultiIndex
- class seismicrna.graph.histpos.PosHistogramGraph(*, table: Table | PosTable, order: int | None, clust: int | None, **kwargs)
Bases:
RelHistogramGraph- classmethod graph_kind()
Kind of graph.
- classmethod what()
What is being graphed.
- property y_title
Title of the y-axis.
- class seismicrna.graph.histpos.PosHistogramRunner
Bases:
RelHistogramRunner,PosGraphRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.histpos.PosHistogramWriter(table_file: Path)
Bases:
RelHistogramWriter,PosGraphWriter- classmethod get_graph_type()
Type of graph.
- class seismicrna.graph.histread.ReadHistogramGraph(*, table: Table | PosTable, order: int | None, clust: int | None, **kwargs)
Bases:
RelHistogramGraph- classmethod graph_kind()
Kind of graph.
- classmethod what()
What is being graphed.
- property y_title
Title of the y-axis.
- class seismicrna.graph.histread.ReadHistogramRunner
Bases:
RelHistogramRunner,ReadGraphRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.histread.ReadHistogramWriter(table_file: Path)
Bases:
RelHistogramWriter,ReadGraphWriter- classmethod get_graph_type()
Type of graph.
- class seismicrna.graph.histrel.RelHistogramGraph(*, table: Table | PosTable, order: int | None, clust: int | None, **kwargs)
Bases:
OneTableGraph,HistogramGraph,MultiRelsGraph,ColorMapGraph,ABCHistogram of relationship(s) in one table.
- property data
Data of the graph.
- property data_header
Header of the selected data (not of the entire table).
- classmethod get_cmap_type()
Type of the color map.
- get_traces()
Data traces of the graph.
- property x_title
Title of the x-axis.
- class seismicrna.graph.histrel.RelHistogramRunner
Bases:
OneTableRunner,HistogramRunner,ABC
- class seismicrna.graph.histrel.RelHistogramWriter(table_file: Path)
Bases:
OneTableWriter,ABC- abstract classmethod get_graph_type() type[RelHistogramGraph]
Type of graph.
- class seismicrna.graph.onestruct.StructOneTableGraph(*, struct_file: Path | None, struct_sect: str | None, **kwargs)
Bases:
OneTableGraph,OneRelGraph,ABCGraph of data from one Table applied to RNA structure(s).
- get_path_fields()
Path fields.
- iter_profiles()
Yield each RNAProfile from the table.
- iter_states()
Yield each RNAState.
- property path_subject
Subject of the graph.
- property struct_sect
Name of the section from which the structure comes.
- class seismicrna.graph.onestruct.StructOneTableRunner
Bases:
OneTableRunner,ABC- classmethod get_table_finder()
Function to find and filter table files.
- classmethod var_params()
Parameters that can vary among different classes.
- class seismicrna.graph.onestruct.StructOneTableWriter(table_file: Path)
Bases:
OneTableWriter,ABC
- class seismicrna.graph.onetable.OneTableGraph(*, table: Table | PosTable, order: int | None, clust: int | None, **kwargs)
-
Graph of data from one Table.
- property action
Action that generated the data.
- property col_index
Index of columns of subplots.
- property path_subject
Subject of the graph.
- property ref
Name of the reference sequence from which the data come.
- property row_index
Index of rows of subplots.
- property sample
Name(s) of the sample(s) from which the data come.
- property sect
Name of the reference section from which the data come.
- property seq
Sequence of the section from which the data come.
- property title_action_sample
Action and sample for the title.
- property top
Path of the top-level output directory for all files.
- class seismicrna.graph.onetable.OneTableRunner
Bases:
GraphRunner,ABC
- class seismicrna.graph.onetable.OneTableWriter(table_file: Path)
Bases:
GraphWriter,ABC- abstract get_graph(*args, **kwargs) OneTableGraph
Return a graph instance.
- property table
The table providing the data for the graph(s).
- class seismicrna.graph.profile.MultiRelsProfileGraph(*, rels: str, **kwargs)
Bases:
MultiRelsGraph,ProfileGraphStacked bar graph with multiple relationships per position.
- classmethod get_cmap_type()
Type of the color map.
- get_traces()
Data traces of the graph.
- classmethod what()
What is being graphed.
- class seismicrna.graph.profile.OneRelProfileGraph(*, rel: str, **kwargs)
Bases:
OneRelGraph,ProfileGraphBar graph with one relationship per position.
- classmethod get_cmap_type()
Type of the color map.
- get_traces()
Data traces of the graph.
- classmethod what()
What is being graphed.
- class seismicrna.graph.profile.ProfileGraph(*, table: Table | PosTable, order: int | None, clust: int | None, **kwargs)
Bases:
OneTableGraph,ColorMapGraph,ABCBar graph of a mutational profile for one table.
- property data
Data of the graph.
- property data_header
Header of the selected data (not of the entire table).
- classmethod graph_kind()
Kind of graph.
- property x_title
Title of the x-axis.
- property y_title
Title of the y-axis.
- class seismicrna.graph.profile.ProfileRunner
Bases:
OneTableRunner,PosGraphRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.profile.ProfileWriter(table_file: Path)
Bases:
OneTableWriter,PosGraphWriter
- class seismicrna.graph.rel.MultiRelsGraph(*, rels: str, **kwargs)
-
Graph of one or more relationships.
- property codestring
String of the relationship code(s).
- property rel_names
Names of the relationships to graph.
- class seismicrna.graph.rel.OneRelGraph(*, rel: str, **kwargs)
-
Graph of exactly one type of relationship.
- property codestring
String of the relationship code(s).
- property rel_name
Name of the relationship to graph.
- property rel_names
Names of the relationships to graph.
- class seismicrna.graph.roc.ROCGraph(*, struct_file: Path | None, struct_sect: str | None, **kwargs)
Bases:
StructOneTableGraphGraph of a receiver operating characteristic (ROC) curve.
- property data
Data of the graph.
- property fpr
False positive rate (FPR) of each RNA state.
- get_traces()
Data traces of the graph.
- classmethod graph_kind()
Kind of graph.
- property profile_names
Names of the profiles as they appear in the data.
- property tpr
True positive rate (TPR) of each RNA state.
- classmethod what()
What is being graphed.
- property x_title
Title of the x-axis.
- property y_title
Title of the y-axis.
- class seismicrna.graph.roc.ROCRunner
Bases:
StructOneTableRunner,PosGraphRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.roc.ROCWriter(table_file: Path)
Bases:
StructOneTableWriter,PosGraphWriter
- seismicrna.graph.roc.rename_columns(df: DataFrame)
Rename the levels of the columns.
- class seismicrna.graph.roll.RollingGraph(*, window: int, winmin: int, **kwargs)
-
- property details
Additional details about the graph.
- property predicate
Predicate of the graph.
- property x_title
Title of the x-axis.
- class seismicrna.graph.roll.RollingRunner
Bases:
GraphRunner,ABC- classmethod var_params()
Parameters that can vary among different classes.
- class seismicrna.graph.scatter.ScatterPlotGraph(*, out_dir: str | Path, table1: Table | PosTable, order1: int | None, clust1: int | None, table2: Table | PosTable, order2: int | None, clust2: int | None, **kwargs)
Bases:
TwoTableGraph,ColorMapGraph- property data
Data of the graph.
- classmethod get_cmap_type()
Type of the color map.
- get_traces()
Data traces of the graph.
- classmethod graph_kind()
Kind of graph.
- classmethod what()
What is being graphed.
- property x_title
Title of the x-axis.
- property y_title
Title of the y-axis.
- class seismicrna.graph.scatter.ScatterPlotRunner
Bases:
TwoTableRunner,PosGraphRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.scatter.ScatterPlotWriter(table1_file: Path, table2_file: Path)
Bases:
TwoTableWriter,PosGraphWriter- classmethod get_graph_type()
Type of graph.
- class seismicrna.graph.snrroll.RollingSNRGraph(*, table: Table | PosTable, order: int | None, clust: int | None, **kwargs)
Bases:
RollingStatGraph- classmethod graph_kind()
Kind of graph.
- classmethod stat_func()
Function to compute a statistic on the data.
- classmethod what()
What is being graphed.
- property y_title
Title of the y-axis.
- class seismicrna.graph.snrroll.RollingSNRRunner
Bases:
RollingStatRunner- classmethod get_writer_type()
Type of GraphWriter.
- class seismicrna.graph.snrroll.RollingSNRWriter(table_file: Path)
Bases:
RollingStatWriter- classmethod get_graph_type()
Type of graph.
- class seismicrna.graph.statroll.RollingStatGraph(*, table: Table | PosTable, order: int | None, clust: int | None, **kwargs)
Bases:
OneTableGraph,OneRelGraph,RollingGraph,ABC- property data
Data of the graph.
- get_traces()
Data traces of the graph.
- class seismicrna.graph.statroll.RollingStatRunner
Bases:
RollingRunner,OneTableRunner,PosGraphRunner,ABC
- class seismicrna.graph.statroll.RollingStatWriter(table_file: Path)
Bases:
OneTableWriter,PosGraphWriter,ABC- abstract classmethod get_graph_type() type[RollingGraph]
Type of graph.
- seismicrna.graph.trace.get_seq_base_scatter_trace(xdata: Series, ydata: Series, cmap: ColorMap, base: str)
- seismicrna.graph.trace.get_seq_line_trace(data: Series)
- seismicrna.graph.trace.iter_line_traces(lines: DataFrame)
- seismicrna.graph.trace.iter_seq_line_traces(data: Series, *_, **__)
- class seismicrna.graph.twotable.TwoTableGraph(*, out_dir: str | Path, table1: Table | PosTable, order1: int | None, clust1: int | None, table2: Table | PosTable, order2: int | None, clust2: int | None, **kwargs)
Bases:
OneRelGraph,ABCGraph of two Tables.
- property action1
Action that generated dataset 1.
- property action2
Action that generated dataset 2.
- property action_sample1
Action and sample of dataset 1.
- property action_sample2
Action and sample of dataset 2.
- property col_index
Index of columns of subplots.
- property data1
Data from table 1.
- property data2
Data from table 2.
- property path_subject
Subject of the graph.
- property path_subject1
Name of subject 1.
- property path_subject2
Name of subject 2.
- property ref
Name of the reference sequence from which the data come.
- property row_index
Index of rows of subplots.
- property sample
Name(s) of the sample(s) from which the data come.
- property sample1
Name of sample 1.
- property sample2
Name of sample 2.
- property sect
Name of the reference section from which the data come.
- property seq
Sequence of the section from which the data come.
- property title_action_sample
Action and sample for the title.
- property top
Path of the top-level output directory for all files.
- class seismicrna.graph.twotable.TwoTableMergedGraph(*, out_dir: str | Path, table1: Table | PosTable, order1: int | None, clust1: int | None, table2: Table | PosTable, order2: int | None, clust2: int | None, **kwargs)
Bases:
TwoTableGraph,ABCGraph of a pair of datasets over the same sequence in which the data series are merged in some fashion into another series, and the original data are not graphed directly.
- property data
Data of the graph.
- get_traces()
Data traces of the graph.
- class seismicrna.graph.twotable.TwoTableRunner
Bases:
GraphRunner,ABC- abstract classmethod get_writer_type() type[TwoTableWriter]
Type of GraphWriter.
- classmethod run(input_path: tuple[str, ...], *, compself: bool, comppair: bool, max_procs: int, parallel: bool, **kwargs)
Run graphing.
- classmethod var_params()
Parameters that can vary among different classes.
- class seismicrna.graph.twotable.TwoTableWriter(table1_file: Path, table2_file: Path)
Bases:
GraphWriter,ABCWrite the proper types of graphs for two given tables.
- abstract classmethod get_graph_type(*args, **kwargs) type[TwoTableGraph]
Type of graph.
- property table1
The first table providing the data for the graph(s).
- property table2
The second table providing the data for the graph(s).