mira.rp.LITE_Model#
- class mira.rp.LITE_Model(*, expr_model, accessibility_model, genes, learning_rate=1, counts_layer=None, initialization_model=None, search_reps=1)#
Container for multiple regulatory potential (RP) LITE models. LITE models learn a relationship between a gene’s expression and accessibility in nearby cis-regulatory elements (CRE). The MIRA model assumes the regulatory influence of a CRE on a gene decays with respect to distance from that gene. MIRA learns this distance using variational Bayesian inference.
With a trained RP model, one may assess the
LITE/NITE characteristics of a gene: whether that gene’s expression is decoupled from changes in local chromatin.
Chromatin differential: the relative levels of nearby accessibility versus gene expression.
Insilico-deletion: predicts transcription factor regulators based on a model of nearby binding in influential CREs, as determined by the RP model.
- Parameters
- expr_model: mira.topics.ExpressionTopicModel
Trained MIRA expression topic model.
- accessibility_modelmira.topics.AccessibilityTopicModel
Trained MIRA accessibility topic model.
- genesnp.ndarray[str], list[str]
List of genes for which to learn RP models.
- learning_ratefloat>0
Learning rate for L-BGFS optimizer.
- counts_layerstr, default=None
Layer in AnnData that countains raw counts for modeling.
- initialization_modelmira.rp.LITE_Model, mira.rp.NITE_Model, None
Initialize parameters of RP model using the provided model before further optimization with L-BGFS. This is used when training the NITE model, which is initialized with the LITE model parameters learned for the same genes, then retrained to optimized the NITE model’s extra parameters. This procedure speeds training.
Examples
Setup requires RNA and ATAC AnnData objects with shared cell barcodes and trained topic models for both modes:
>>> rp_args = dict(expr_adata = rna_data, atac_adata = atac_data)
Instantiating a LITE model (local chromatin accessibility only):
>>> litemodel = mira.rp.LITE_Model( ... expr_model = rna_model, ... accessibility_model = atac_model, ... counts_layer = 'counts', ... genes = ['LEF1','WNT3','EDA','NOTCH1'], ... ) >>> litemodel.fit(**rp_args)
- Attributes
- genesnp.ndarray[str]
Array of gene names for models
- featuresnp.ndarray[str]
Array of gene names for models
- modelslist[mira.rp.GeneModel]
List of trained RP models
- model_type{“NITE”, “LITE”}
Methods
fit([callback, n_workers, atac_topic_comps_key])Optimize parameters of RP models to learn cis-regulatory relationships.
get_model(gene)Gets model for gene
join(rp_model)Merge RP models from two model containers.
load(prefix)Load RP models saved with prefix.
load_dir([counts_layer])Load directory of RP models.
predict(*, expr_adata, atac_adata[, ...])Predicts the expression of genes given their cis-accessibility state.
probabilistic_isd([n_samples, checkpoint, ...])For each gene, calcuate association scores with each transcription factor.
save(prefix)Save RP models.
Returns a NITE model seeded with the LITE model's parameters.
subset(genes)Return a subset container of RP models.
bn
convert_models
get_features
get_isd_features
get_logp
score
subset_fit_models
- spawn_NITE_model()#
Returns a NITE model seeded with the LITE model’s parameters.