autogenes.Interface.deconvolve¶
-
Interface.
deconvolve
(bulk, key = None, model='nusvr')¶ Performs bulk deconvolution
Deconvolves bulk data using a gene selection. The selection can be specified through a key or the current selection is used.
If the optimizer has been run, but nothing has been selected yet, an automatic selection occurs (equivalent to
ag.select()
)- Parameters
bulk (np.ndarray, pd.Series, pd.DataFrame, AnnData) – If multi-dimensional, then each row corresponds to a sample. If it has gene annotations (e.g. var_names for AnnData or df.columns for DataFrame), the method will respond intelligently (reorder if necessary, use only those genes from the selection that are available in the bulk data)
key (str, optional (default: None)) – Name of the var column that specifies a gene selection. If None, then the current selection is used (or is automatically chosen)
model (nusvr, nnls, linear, optional (default: nusvr)) – Choose a regression model. Available options: NuSVR, non-negative least squares and linear model.
- Returns
An array of the form [[float, …],…] containing the model coefficients for each target (bulk sample)