scSemiProfiler.utils.visualize_inferred

scSemiProfiler.utils.visualize_inferred(name, target, representatives, cluster_labels, realdata_path='example_data/scdata.h5ad', n_comps=100, save=None)[source]

Visualize the inference performance by plotting the representative, inferred target, and target ground truth in the same UMAP.

Parameters
  • name (str) – Project name

  • target (int) – Target sanmple ID (number)

  • representatives (list) – Representatives sample IDs (int)

  • cluster_labels (list) – Cluster labels

  • realdata_path (str) – Path to the real-profiled single-cell data

  • n_comps (int) – The number of PCs in PCA

  • save – Path within the ‘figures’ folder to save the plot

Return type

None

Returns

None

Example

>>> name = 'project name'
>>>
>>> # load representatives and cluster labels lists
>>> repres = []
>>> f=open(name + '/status/init_representatives.txt','r')
>>> lines = f.readlines()
>>> f.close()
>>> for l in lines:
>>>     repres.append(int(l.strip()))
>>>
>>> cl = []
>>> f=open(name + '/status/init_cluster_labels.txt','r')
>>> lines = f.readlines()
>>> f.close()
>>> for l in lines:
>>>     cl.append(int(l.strip()))
>>>
>>> visualize_inferred(name, 0, repres, cl)