scSemiProfiler.utils.assemble_cohort

scSemiProfiler.utils.assemble_cohort(name, representatives, cluster_labels, celltype_key='celltypes', sample_info_keys=['states_collection_sum'], bulkpath='example_data/bulkdata.h5ad', annotator=MLPClassifier(hidden_layer_sizes=(200)))[source]

Assemble inferred sample data and representative sample data into semi-profiled cohort and annotate the celltype.

Parameters
  • name (str) – Project name

  • representatives (typing.Union[list, str]) – Either a list of representatives or path to a txt file specifying the representative information

  • cluster_labels (typing.Union[list, str]) – Either a list of sample cluster labels or path to a txt file specifying the sample cluster label information

  • celltype_key (str) – The key in .obs specifying the cell type information

  • sample_info_keys (list) – Keys for other sample-level information to be stored in the assembled dataset

  • bulkpath (str) – Path to the bulk data

Returns

semidata – The assembled and annotated semi-profiled dataset

Example

>>> semisdata = assemble_cohort(name,
>>>                 repre,
>>>                 cls,
>>>                 celltype_key = 'celltypes',
>>>                 sample_info_keys = ['states_collection_sum'],
>>>                 bulkpath = 'example_data/bulkdata.h5ad')