mira.rp.NITE_Model#

class mira.rp.NITE_Model(*, expr_model, accessibility_model, genes, learning_rate=1, counts_layer=None, initialization_model=None, search_reps=1)#

Container for multiple regulatory potential (RP) NITE models. NITE models learn a relationship between a gene’s expression and accessibility in nearby cis-regulatory elements (CRE), and the cell-wide chromatin landscape.

The predictive capacity of local vs. cell-wide chromatin in predicting a gene’s expression state determines a gene’s NITE Score, and edulicates whether that gene is primarily regulated by local or nonlocal mechanisms.

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 NITE model (local chromatin accessibility only):

>>> nitemodel = mira.rp.NITE_Model(
...     expr_model = rna_model, 
...     accessibility_model = atac_model,
...     counts_layer = 'counts',
...     genes = litemodel.genes,
...     instantiation_model = litemodel
... )
>>> nitemodel.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.

subset(genes)

Return a subset container of RP models.

bn

convert_models

get_features

get_isd_features

get_logp

score

subset_fit_models