clustering

besca.export.clustering(adata: AnnData, outpath: Optional[str] = None, export_average: bool = True, export_fractpos: bool = True, method: str = 'leiden')[source]

export mapping of cells to clusters to .tsv file

This function exports the labels saved in adata.obs.method and the corresponding cell barcode to the file cell2labels.tsv.

Parameters:
  • adata (AnnData) – the AnnData object containing the clusters

  • outpath (str | default = current working directory) – filepath to the directory in which the results should be outputed, if no directory is specified it outputs the results to the current working directory.

  • export_average (bool | default = True) – boolian indicator if the average gene expression of each cluster should be exported to file

  • export_fractpos (bool | default = True) – boolian indicator if the fraction of positive cells (i.e. cells that express the gene) should be exported to file

  • method (`str1 | default = ‘leiden’) – string indicating the clustering method used and where to store the results. Shuold be either louvain or leiden

Returns:

files are written out.

Return type:

None