jonny jeep
jonny jeep

Reputation: 417

change color clusters umap python

sorry I'm totally new in python but I need to use it for some analysis. I usually use R. However, I need to change colours in my umap plot:

import scanpy as sc
import anndata
from scipy import io
from scipy.sparse import coo_matrix, csr_matrix
import numpy as np
import os
import pandas as pd

>>> adata.obs.columns
Index(['nCount_RNA', 'nFeature_RNA', 'percent.mt', 'nCount_ATAC',
       'nFeature_ATAC', 'nCount_motif', 'nFeature_motif', 'TSS.enrichment',
       'TSS.percentile', 'nucleosome_signal', 'nucleosome_percentile',
       'blacklist_fraction', 'dataset', 'integrated_rna.weight', 'ATAC.weight',
       'wsnn_res.0.1', 'wsnn_res.0.2', 'wsnn_res.0.5', 'wsnn_res.1',
       'wsnn_res.1.5', 'treatment', 'timepoint', 'treatment_timepoint',
       'RNA_snn_res.0.2', 'seurat_clusters', 'RNA_snn_res.0.3',
       'RNA_snn_res.0.4', 'RNA_snn_res.0.5', 'seurat_cluster_0.4',
       'treatment_timepoint_cluster', 'barcode', 'UMAP_1', 'UMAP_2'],
      dtype='object')
cols =["#F8766D",  "#ABA300", "#0CB702", "#00B8E7", "#ED68ED"]

sc.pl.umap(adata, color=['seurat_clusters'], palette= cols, frameon=False, save=True)

this not works. where I did a mistake?

Upvotes: 1

Views: 818

Answers (0)

Related Questions