mira.pl.compare_driver_TFs_plot#

mira.pl.compare_driver_TFs_plot(adata, factor_type='motifs', background=None, alt_hypothesis='greater', axlabels=('Set1 Drivers', 'Set2 Drivers'), label_factors=None, hue=None, palette='coolwarm', hue_order=None, ax=None, figsize=(8, 8), legend_label='', show_legend=True, fontsize=13, pval_threshold=(0.001, 0.001), na_color='lightgrey', show_factor_ids=False, color='lightgrey', label_closeness=3, max_label_repeats=3, *, geneset1, geneset2)#

Use pISD (probabilistic insilico deletion) association scores between transcription factors and genes to compare and contrast driving regulatorys of two genesets.

The genesets may be determined by shared regulation (e.g. topics), by differential expression, or based on similar regulatory dynamcis.

Note

Please refer to the LITE/NITE tutorial for instruction on training RP models and calculating pISD scores.

Parameters
backgroundnp.ndarrary[str], list[str], None; default = None

List of gene names to use for background of driver TF test. For each transcription factor, assesses association in each query geneset against the provided background. If no background provided, all compares query against all other genes for which pISD scores were calculated.

geneset_1np.ndarray[str], list[str]

Query geneset 1. List of genes linked by some process (similar regulatory dynamics, topic activtation, etc.).

geneset_2np.ndarray[str], list[str]

Query geneset 1. List of genes linked by some contrasting process.

factor_typestr, ‘motifs’ or ‘chip’, default = ‘motifs’

Which factor type to use for enrichment.

label_factorslist[str], np.ndarray[str], None; default=None

List of factors to label. If not provided, will label all factors that meet the p-value thresholds.

huedict[str{str, float}] or None

If provided, colors the factors on the plot. The keys of the dict must be the names of transcription factors, and the values are the associated data to map to colors. The values may be categorical, e.g. cluster labels, or scalar, e.g. expression values. TFs not provided in the dict are colored as na_color.

palettestr, list[str], or None; default = None

Palette of plot. Default of None will set palette to the style-specific default.

hue_orderlist[str] or None, default = None

Order to assign hues to features provided by data. Works similarly to hue_order in seaborn. User must provide list of features corresponding to the order of hue assignment.

axmatplotlib.pyplot.axes, deafult = None

Provide axes object to function to add streamplot to a subplot composition, et cetera. If no axes are provided, they are created internally.

figsizetuple(float, float), default = (8,8)

Size of figure

legend_labelstr, None

Label for legend.

show_legendboolean, default=True

Show figure legend.

fontsizeint>0, default=13

Fontsize of TF labels on plot.

pval_thresholdtuple[float, float], default=(1e-50, 1e-50)

Threshold below with TFs will not be labeled on plot. The first and second positions relate p-value with respect to topic 1 and topic 2.

na_colorstr, default=’lightgrey’

Color for TFs with no provided hue

colorstr, default=’grey’

If hue not provided, colors all points on plot this color.

label_closenessint>0, default=3

Closeness of TF labels to points on plot. When label_closeness is high, labels are forced to be very close to points.

max_label_repeatsboolean, default=3

Some TFs have multiple ChIP samples or Motif PWMs. For these factors, label the top max_label_repeats examples. This prevents clutter when many samples for the same TF are close together. The rank of the sample for each TF is shown in the label as “<TF name> (<rank>)”.

Returns
matplotlib.pyplot.axes