larry._utils¶
Submodules¶
larry._utils._abc_parselarry._utils._accuracy_scoreslarry._utils._auto_parse_base_classlarry._utils._confusion_matrixlarry._utils._count_fate_valueslarry._utils._fetch_datalarry._utils._larry_in_vitro_cmaplarry._utils._lineage_classificationlarry._utils._model_evaluatorlarry._utils._multi_fate_color_maplarry._utils._multi_fated_lineage_prediction_resultslarry._utils._multiclass_precision_recalllarry._utils._sparse_mtx_operationslarry._utils._task_two_eval_callback
Package Contents¶
Classes¶
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Sort ground truth lineages based on their types. |
|
Helper class that provides a standard way to create an ABC using |
Functions¶
|
calculate variance across the specified axis of a sparse matrix. |
|
multiply each row of sparse matrix by a scalar |
|
mean-center columns of a sparse matrix |
|
variance-normalize columns of a sparse matrix |
|
z-score normalize each column of a sparse matrix |
|
Fetch data as torch.Tensor using an index for adata. |
Attributes¶
- class larry._utils.AutoParseBase¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- property _init_params¶
- property _call_params¶
- property _parse_params¶
- property _collected_params¶
- __call__()¶
- __init_kwargs__()¶
- _inspect(func)¶
- _collect_literal_kwargs(kwargs_val)¶
- __hide__(key)¶
- __collect__(key, val)¶
- __parse__(kwargs: dict, ignore: list = ['self'], private: list = ['ignore', 'private', 'public'], public: list = [], kwargs_key: str = 'kwargs')¶
Pass locals() or some other collection of kwargs to kwargs to save them as attributes of the subclass.
- kwargs
typically locals() type: dict
- ignore
type: list default: [“self”]
- private
type: list default: [“ignore”, “private”, “public”]
- public
type: list default: []
- kwargs_key
type: str default: “kwargs”
assumes all are public unless denoted in private
If a public list is provided, all kwargs are shifted to private unless denoted in public.
- larry._utils.sparse_var(E, axis=0)¶
calculate variance across the specified axis of a sparse matrix.
- larry._utils.sparse_rowwise_multiply(E, a)¶
multiply each row of sparse matrix by a scalar
- larry._utils.mean_center(E, column_means=None)¶
mean-center columns of a sparse matrix
- larry._utils.normalize_variance(E, column_stdevs=None)¶
variance-normalize columns of a sparse matrix
- larry._utils.sparse_zscore(E, gene_mean=None, gene_stdev=None)¶
z-score normalize each column of a sparse matrix
- larry._utils.fetch_data(adata: anndata.AnnData, idx: pandas.Index, n_sim: int = 1, use_key: str = 'X_pca') torch.Tensor¶
Fetch data as torch.Tensor using an index for adata.
- adata
type: anndata.AnnData
- idx
type: pd.Index
- n_sim:
type: int default: 1
- use_key:
type: str default: “X_pca”
- X_data
type: torch.Tensor
- class larry._utils.ABCParse(*args, **kwargs)¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- property _STORED: List¶
- _BUILT = False¶
- __build__() None¶
- __set__(key: str, val: Any, public: List = [], private: List = []) None¶
- __set_existing__(key: str, val: Any) None¶
- __parse__(kwargs: Dict, public: List = [], private: List = [], ignore: List = [])¶
- __update__(kwargs: dict, public: List = [], private: List = []) None¶
- larry._utils.LARRY_in_vitro_cmap¶
- larry._utils.mk_multifate_cmap()¶
- class larry._utils.MultifatedLineagePredictionResults(threshold=0.3)¶
Bases:
larry._utils._abc_parse.ABCParse- _target_label(row)¶
- _predicted_label(predicted)¶
- _compose_target_pred_df(idx, predicted, target)¶
- _compute_error(target_pred_df)¶
- __call__(F_obs_impure, F_hat)¶
- class larry._utils.LineageClassification(F_obs: pandas.DataFrame)¶
Bases:
larry._utils._abc_parse.ABCParseSort ground truth lineages based on their types.
- property homogeneity¶
- property impure_idx_mask¶
- property pure_idx_mask¶
- property n_impure¶
- property n_pure¶
- property F_obs_pure¶
- property F_obs_impure¶
- class larry._utils.TaskTwoEvalCallback(model, UMAP_model=None, t=torch.Tensor([2, 4, 6]), device=autodevice.AutoDevice(), N=2000, use_key='X_scaled', PR_threshold=0.3)¶
Bases:
lightning.Callback,larry._utils._abc_parse.ABCParseHelper class that provides a standard way to create an ABC using inheritance.
- property _TESTING¶
- property t¶
- property fate_df¶
- property t0_idx¶
- property F_obs¶
- property labels¶
- property F_hat¶
- property F_obs_pred¶
- property LOGPATH¶
- _plot_fate_bias_clustermap()¶
- on_fit_end(trainer, pl_module, *args, **kwargs)¶