scanpy_plus.tl.map_to_dahlin module

class scanpy_plus.tl.map_to_dahlin.Project_landscape(my_adata, ref_adata, genes_to_consider, ref_data_obs_label='CellSubType', npcs=25, knn=15)

Bases: object

Projecting onto landscapes and performing label transfer For Niki’s dataset scale together as they are both 10x For Nestorowa’s dataset scale separately

Run methods flowchart:

normalise, log, scale_(together/separately), run_pca_ref, pca_project_myadata, calc_pcadist, labelling, plot_on_ref, cluster_assignment

calc_pca_dist()

Compute euclidean dist between each cell in my_adata to each cell in ref_adata in the PCA space

cluster_assignment()

Based on cell labelling, use the most common label for the cells in each cluster of my_adata as the cluster name.

labelling()

Using the distances find knn nearest neighbours of ref_adata for each cell in my_adata. The most common NN in ref_adata is returned as the label for each cell in my_adata.

log()

Logp data

normalise()

Normalise per cell

pca_project_myadata()

Using PCs from ref data predict the coords for my_adata

plot_on_ref(my_adata_cluster_obs='leiden', prefix='niki')

Using the distances map each cluster in my_adata onto cells in niki dataset.

run_pca_ref()

Run PCA and optain pca object for ref data

scale_separately()

Scales the two data separately. Adviced if the datasets are from two different sequencing methods, for eg Nesterowa and 10x

scale_together()

Combine the two anndata. Scale them together. Adviced for Niki’s dataset integration

scanpy_plus.tl.map_to_dahlin.map_to_dahlin(data)

Maps to dahlin landscape Expects the anndata to have anndata.raw instantiated.

Run methods flowchart:

normalise, log, scale_(together/separately), run_pca_ref, pca_project_myadata, calc_pcadist, labelling, plot_on_ref, cluster_assignment

Returns: Project_landscape object