report¶
- besca.tl.report(adata_pred, celltype, method, analysis_name, train_datasets=[], test_dataset='', merge='', name_prediction='auto_annot', name_report='auto_annot', use_raw=False, genes_to_use='', remove_nonshared=False, clustering='leiden', asymmetric_matrix=True, results_folder='./', delimiter=',', verbose=False)[source]¶
reports basic metrics, produces confusion matrices and plots umap of prediction
Writes out a csv file containing all accuracy and f1 scores. Writes normalized and absolute confusion matrices, as well as umap prediction comparisons to ./figures.
- Parameters:
adata_pred (AnnData) – original adata object with name_prediction column
celltype (str) – celltype column on which the prediction was performed
method (str) – method that was used for prediction.
analysis_name (str) – name of the analyis, used for writing files
train_datasets (list) – list of used training datasets
test_dataset (str) – name of test dataset
merge (str) – what merging was performed
name_prediction ("auto_annot"| default = "auto_annot") – observation name containing the prediction to compare with.
name_report ("auto_annot"| default = "auto_annot") – prefix of the report
use_raw (bool | default = False) – if anndata.raw was used
genes_to_use (list or string | default = ‘all’) – what geneset wsa used
remove_nonshared (`bool`|default = False) –
clustering (str | default = leiden) – clustering that was used in original analysis of testing set, needed for umap plotting
asymmetric_matrix (bool | default = True) – if False returns square confusion matrix, if True it only shows possible combinations
results_folder (str | default = ‘./’) – output directory. A figures folder will be generated within it.
delimiter (str | default = ‘,’) – separator between fields in the csv/txt report file
verbose (bool | default = False) – print verbose messages to standard out
- Returns:
A matplotlib figure element containing the riveplot generated for interactive display.
- Return type:
Figure