ranked_genes

besca.export.ranked_genes(adata: AnnData, type: str = 'wilcox', outpath: Optional[str] = None, geneannotation: str = 'SYMBOL', additional_geneannotation: str = 'ENSEMBL')[source]

export marker genes for each cluster to .gct file

This function exports the results of scanpy.tl.rank_genes_groups() on your AnnData object to a .gct file. This file can easily be uploaded into the scsqe database since it follows the FAIR data formats. It expect the label “rank_genes_groups” and not a personalized one.

A prerequisit for executing this function is that sc.tl.rank_genes_groups() has already been run. Through the variables geneannotation and additional_geneannotation you can specify the type of gene annotationi that is saved in adata.var_names and any additional geneannotation columns saved in adata.vars.

Parameters:
  • adata (AnnData) – AnnData object on which scanpy.tl.rank_genes_groups has been executed

  • type (str | ‘wilcox’ or ‘t-test overest var’ or ‘t-test’) –

  • directory (outpath str | default = current working) – 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.

  • geneannotation (‘ENSEMBL’ or ‘SYMBOL’) – type of gene annotation that is located in adata.var_names

  • additional_geneannotation

Returns:

writes results to file in output directory

Return type:

None