library(stringi)
library(reticulate)
source_from_github(repositoy = "DEG_functions",version = "0.2.24")
source_from_github(repositoy = "cNMF_functions",version = "0.3.85",script_name = "cnmf_function_Harmony.R")
no_neg <- function(x) {
x = x + abs(min(x))
x
}
sum_2_one <- function(x) {
x =x/sum(x)
x
}
xeno = readRDS("./Data/10x_xeno_1000.Rds")
lung = readRDS("./Data/lung_cancercells_withTP_onlyPatients.rds")
lung_patients = lung$patient.ident %>% unique() %>% as.character()
lung_patients_filtered = lung_patients[!(lung_patients %in% c("X1055new","X1099"))] # remove patients with less than 100 malignant cells
lung = subset(x = lung,subset = patient.ident %in% lung_patients_filtered)
suffix = r.suffix
import pickle
from cnmf import cNMF
f = open('./Data/cnmf/cnmf_objects/models_2Kvargenes_cnmf_obj.pckl', 'rb')
cnmf_obj = pickle.load(f)
f.close()
# gep_scores = readRDS("/sci/labs/yotamd/lab_share/avishai.wizel/R_projects/EGFR/Data/cnmf/harmony_models_gep_scores.rds")
selected_k = 3
density_threshold = 0.1
# cnmf_obj.consensus(k=selected_k, density_threshold=density_threshold)
usage_norm, gep_scores, gep_tpm, topgenes = cnmf_obj.load_results(K=selected_k, density_threshold=density_threshold)
gep_scores = py$gep_scores
gep_tpm = py$gep_tpm
usage_norm= py$usage_norm
names (gep_scores) = c("Hypoxia","TNFa","Cell_cycle")
plt_list = list()
for (program in names (gep_scores)) {
p = ggplot(gep_scores, aes(x=!!ensym(program))) +
geom_density()+xlab(program)+
geom_vline(
aes(xintercept=sort(gep_scores[,program],TRUE)[200] ,color="top200"),
linetype="dashed", size=1)+
geom_vline(
aes(xintercept=sort(gep_scores[,program],TRUE)[100] ,color="top100"),
linetype="dashed", size=1)+
geom_vline(
aes(xintercept=sort(gep_scores[,program],TRUE)[50] ,color="top50"),
linetype="dashed", size=1)+
geom_vline(
aes(xintercept=sort(gep_scores[,program],TRUE)[150] ,color="top150"),
linetype="dashed", size=1)+
scale_color_manual(name = "top n genes", values = c(top200 = "blue",top100 = "red",top150 = "yellow",top50 = "green"))
plt_list[[program]] <- p
}
ggarrange(plotlist = plt_list)
ntop = 150
plt_list = list()
hif_targets_set = data.frame(gs_name = "hif_targets",gene_symbol = hif_targets)
for (i in 1:ncol(gep_scores)) {
top_genes = gep_scores %>% arrange(desc(gep_scores[i])) #sort by score a
top = head(rownames(top_genes),ntop) #take top top_genes_num
res = genes_vec_enrichment(genes = top,background = rownames(gep_scores),homer = T,title =
i,silent = T,return_all = T,custom_pathways = hif_targets_set)
plt_list[[i]] = res$plt
}
gridExtra::grid.arrange(grobs = plt_list)
xeno = FindVariableFeatures(object = xeno,nfeatures = 2000)
Calculating gene variances
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
import numpy as np
import scanpy as sc
expr_after_harmony = sc.read_h5ad('./Data/cnmf/xeno_Harmony_NoNeg_2Kvargenes.h5ad').to_df()
tpm = compute_tpm(expr_after_harmony)
cnmf_genes = expr_after_harmony.keys().to_list()
usage_by_calc = get_usage_from_score(counts=expr_after_harmony,tpm=tpm,genes=cnmf_genes,cnmf_obj=cnmf_obj,k=3)
usage_by_calc = py$usage_by_calc
usage_norm = py$usage_norm
cor(usage_by_calc,usage_norm)
usage_by_calc = get_usage_from_score(counts=xeno_expression,tpm=tpm,genes=xeno_vargenes, cnmf_obj=cnmf_obj,k=3)
/sci/labs/yotamd/lab_share/avishai.wizel/python_envs/miniconda/envs/cnmf_env_6/bin/python3.7:7: FutureWarning: X.dtype being converted to np.float32 from float64. In the next version of anndata (0.9) conversion will not be automatic. Pass dtype explicitly to avoid this warning. Pass `AnnData(X, dtype=X.dtype, ...)` to get the future behavour.
/sci/labs/yotamd/lab_share/avishai.wizel/python_envs/miniconda/envs/cnmf_env_6/bin/python3.7:8: FutureWarning: X.dtype being converted to np.float32 from float64. In the next version of anndata (0.9) conversion will not be automatic. Pass dtype explicitly to avoid this warning. Pass `AnnData(X, dtype=X.dtype, ...)` to get the future behavour.
all_metagenes = py$usage_by_calc
names (all_metagenes) = c("Hypoxia","TNFa","Cell_cycle")
#add each metagene to metadata
for (i in 1:ncol(all_metagenes)) {
metage_metadata = all_metagenes %>% dplyr::select(i)
# metage_metadata = scale(metage_metadata)
xeno = AddMetaData(object = xeno,metadata = metage_metadata,col.name = names(all_metagenes)[i])
}
print_tab(plt = FeaturePlot(object = xeno,features = colnames(all_metagenes)),title = "umap expression")
NA
metagenes_mean_compare(dataset = xeno,time.point_var = "treatment",prefix = "model",patient.ident_var = "orig.ident",pre_on = c("NT","OSI"),test = "wilcox.test",programs = c("Hypoxia","TNFa","Cell_cycle"))
NA
hallmark_name = "GO_MITOTIC_CELL_CYCLE"
genesets =getGmt("./Data/h.all.v7.0.symbols.pluscc.gmt")
var_features=xeno@assays$RNA@var.features
geneIds= genesets[[hallmark_name]]@geneIds
score <- apply(xeno@assays$RNA@data[intersect(geneIds,var_features),],2,mean)
xeno=AddMetaData(xeno,score,"GO_MITOTIC_CC")
metagenes_mean_compare(dataset = xeno,time.point_var = "treatment",prefix = "model",patient.ident_var = "orig.ident",pre_on = c("NT","OSI","res"),programs = c("GO_MITOTIC_CC"))
NA
DotPlot(object = xeno, features = c("Hypoxia","TNFa","Cell_cycle","GO_MITOTIC_CC"),scale = F,group.by = 'treatment')
DotPlot(object = xeno, features = c("Hypoxia","TNFa","Cell_cycle","GO_MITOTIC_CC"),scale = T,group.by = 'treatment')
larger_by = 1.5
xeno = program_assignment(dataset = xeno,larger_by = larger_by,program_names = colnames(all_metagenes))
print_tab(plt =
DimPlot(xeno,group.by = "program.assignment",cols = c(Hypoxia = "red",TNFa = "green",Cell_cycle = "blue","NA" = "grey"))
,title = "program.assignment",subtitle_num = 2)
print_tab(plt =
DimPlot(xeno,group.by = "orig.ident")
,title = "orig.ident",subtitle_num = 2)
print_tab(plt =
DimPlot(xeno,group.by = "treatment")
,title = "treatment",subtitle_num = 2)
p = cell_percentage(dataset = xeno,time.point_var = "treatment",by_program = T,x_order = c("NT","OSI","res"))
print_tab(plt = p,title = "by program",subtitle_num = 2)
p = cell_percentage(dataset = xeno,time.point_var = "treatment",by_tp = T,x_order =c("Hypoxia","TNFa","Cell_cycle","NA"))
print_tab(plt = p,title = "by time point",subtitle_num = 2)
top_genes = gep_scores %>% arrange(desc(gep_scores["Hypoxia"])) #sort by score a
hypoxia_genes = head(rownames(top_genes),20) #take top top_genes_num
intersect(cluster_3_genes,hypoxia_genes)
library(ggvenn)
all = list(hypoxia_genes = hypoxia_genes, hif_targets = cluster_3_genes)
ggvenn(
all
)
for (genes in list(hif_targets,xeno_cluster_3_genes,xeno_cluster_3_2_genes)) {
hif_targets_by_tp = FetchData(object = xeno,vars = c(genes)) %>% rowSums() %>% as.data.frame() #mean expression
# hif_targets_by_tp[,2] = tnf_and_hypoxia2[,1]
hif_targets_by_tp[,2] = xeno$Hypoxia
names(hif_targets_by_tp) = c("hif_targets","hypoxia_program")
p1 = ggplot(hif_targets_by_tp, aes(x=hif_targets, y=hypoxia_program)) +
geom_point()+
geom_density_2d(aes(color = ..level..)) +
geom_smooth(method=lm) +
stat_cor(method = "pearson", label.x = 20, label.y = 1.1)+
scale_color_viridis_c()
p2 = ggplot(hif_targets_by_tp, aes(x=hif_targets, y=hypoxia_program)) +
geom_bin2d() +
theme_bw()+ scale_fill_gradientn(limits=c(0,1100), breaks=seq(0, 1100, by=200), colours=c("blue","yellow","red"))+
stat_cor(method = "pearson", label.x = 20, label.y = 1.1)+
geom_smooth(method=lm)
p = ggarrange(plotlist = list(p1,p2),nrow = 2)
print_tab(plt = p,title = "geom_bin2d")
}
Warning in FetchData.Seurat(object = xeno, vars = c(genes)) : The
following requested variables were not found: AK4P1, BNIP3P1, LDHAP5,
AL158201.1, MIR210, NLRP3P1, AL109946.1 geom_smooth() using
formula ‘y ~ x’ geom_smooth() using formula ‘y ~ x’ ##
geom_bin2d {.unnumbered }
geom_smooth() using formula ‘y ~ x’
geom_smooth() using formula ‘y ~ x’ ## geom_bin2d
{.unnumbered }
geom_smooth() using formula ‘y ~ x’
geom_smooth() using formula ‘y ~ x’ ## geom_bin2d
{.unnumbered }
NA
hif_targets_by_tp = FetchData(object = xeno,vars = c(hif_targets)) %>% rowSums() %>% as.data.frame() #mean expression
Warning in FetchData.Seurat(object = xeno, vars = c(hif_targets)) :
The following requested variables were not found: AK4P1, BNIP3P1, LDHAP5, AL158201.1, MIR210, NLRP3P1, AL109946.1
hif_targets_by_tp[,2] = xeno$Hypoxia
names(hif_targets_by_tp) = c("hif_targets","hypoxia_program")
high_hif_low_hypoxia_cells = hif_targets_by_tp %>% filter(hif_targets>25 & hypoxia_program < 0.2) %>% rownames()
low_hif_high_hypoxia_cells = hif_targets_by_tp %>% filter(hif_targets<15 & hypoxia_program > 0.6) %>% rownames()
hif_targets_by_tp = FetchData(object = xeno,vars = c(hif_targets)) %>% rowSums() %>% as.data.frame() #mean expression
Warning in FetchData.Seurat(object = xeno, vars = c(hif_targets)) :
The following requested variables were not found: AK4P1, BNIP3P1, LDHAP5, AL158201.1, MIR210, NLRP3P1, AL109946.1
xeno = AddMetaData(object = xeno, metadata = hif_targets_by_tp,col.name = "HIF_targets_score")
cells_to_highlight = list(high_hif_low_hypoxia_cells = high_hif_low_hypoxia_cells, low_hif_high_hypoxia_cells = low_hif_high_hypoxia_cells)
DimPlot(object = xeno, cells.highlight = cells_to_highlight, cols.highlight = c("red","blue"), cols = "gray", order = TRUE)
FeaturePlot(object = xeno,features = c( "HIF_targets_score","Hypoxia","Cell_cycle" ))
markers = FindMarkers(object = xeno, ident.1 = "high_hif_low_hypoxia",ident.2 = "high_hif_high_hypoxia",densify = T)
| | 0 % ~calculating
|+ | 1 % ~27s
|++ | 2 % ~22s
|++ | 3 % ~21s
|+++ | 4 % ~20s
|+++ | 5 % ~19s
|++++ | 6 % ~19s
|++++ | 7 % ~19s
|+++++ | 8 % ~19s
|+++++ | 9 % ~18s
|++++++ | 10% ~18s
|++++++ | 11% ~19s
|+++++++ | 12% ~18s
|+++++++ | 13% ~18s
|++++++++ | 14% ~18s
|++++++++ | 15% ~17s
|+++++++++ | 16% ~17s
|+++++++++ | 17% ~16s
|++++++++++ | 18% ~16s
|++++++++++ | 19% ~16s
|+++++++++++ | 20% ~15s
|+++++++++++ | 21% ~15s
|++++++++++++ | 22% ~15s
|++++++++++++ | 23% ~14s
|+++++++++++++ | 24% ~14s
|+++++++++++++ | 25% ~14s
|++++++++++++++ | 26% ~14s
|++++++++++++++ | 27% ~13s
|+++++++++++++++ | 28% ~13s
|+++++++++++++++ | 29% ~13s
|++++++++++++++++ | 30% ~13s
|++++++++++++++++ | 31% ~13s
|+++++++++++++++++ | 32% ~12s
|+++++++++++++++++ | 33% ~12s
|++++++++++++++++++ | 34% ~12s
|++++++++++++++++++ | 35% ~12s
|+++++++++++++++++++ | 36% ~11s
|+++++++++++++++++++ | 37% ~11s
|++++++++++++++++++++ | 38% ~11s
|++++++++++++++++++++ | 39% ~11s
|+++++++++++++++++++++ | 40% ~11s
|+++++++++++++++++++++ | 41% ~10s
|++++++++++++++++++++++ | 42% ~10s
|++++++++++++++++++++++ | 43% ~10s
|+++++++++++++++++++++++ | 44% ~10s
|+++++++++++++++++++++++ | 45% ~10s
|++++++++++++++++++++++++ | 46% ~09s
|++++++++++++++++++++++++ | 47% ~09s
|+++++++++++++++++++++++++ | 48% ~09s
|+++++++++++++++++++++++++ | 49% ~09s
|++++++++++++++++++++++++++ | 51% ~09s
|++++++++++++++++++++++++++ | 52% ~09s
|+++++++++++++++++++++++++++ | 53% ~08s
|+++++++++++++++++++++++++++ | 54% ~08s
|++++++++++++++++++++++++++++ | 55% ~08s
|++++++++++++++++++++++++++++ | 56% ~08s
|+++++++++++++++++++++++++++++ | 57% ~08s
|+++++++++++++++++++++++++++++ | 58% ~08s
|++++++++++++++++++++++++++++++ | 59% ~07s
|++++++++++++++++++++++++++++++ | 60% ~07s
|+++++++++++++++++++++++++++++++ | 61% ~07s
|+++++++++++++++++++++++++++++++ | 62% ~07s
|++++++++++++++++++++++++++++++++ | 63% ~07s
|++++++++++++++++++++++++++++++++ | 64% ~06s
|+++++++++++++++++++++++++++++++++ | 65% ~06s
|+++++++++++++++++++++++++++++++++ | 66% ~06s
|++++++++++++++++++++++++++++++++++ | 67% ~06s
|++++++++++++++++++++++++++++++++++ | 68% ~06s
|+++++++++++++++++++++++++++++++++++ | 69% ~06s
|+++++++++++++++++++++++++++++++++++ | 70% ~05s
|++++++++++++++++++++++++++++++++++++ | 71% ~05s
|++++++++++++++++++++++++++++++++++++ | 72% ~05s
|+++++++++++++++++++++++++++++++++++++ | 73% ~05s
|+++++++++++++++++++++++++++++++++++++ | 74% ~05s
|++++++++++++++++++++++++++++++++++++++ | 75% ~04s
|++++++++++++++++++++++++++++++++++++++ | 76% ~04s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~04s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~04s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~03s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=18s
updeg = markers %>% filter(p_val_adj<0.05 & avg_log2FC>0) %>% rownames()
new_hif_targets = hif_targets[!hif_targets %in% updeg]
hif_targets_by_tp = FetchData(object = xeno,vars = c(new_hif_targets)) %>% rowSums() %>% as.data.frame() #mean expression
Warning in FetchData.Seurat(object = xeno, vars = c(new_hif_targets)) : The following requested variables were not found: AK4P1, BNIP3P1, LDHAP5, AL158201.1, MIR210, NLRP3P1, AL109946.1
hif_targets_by_tp[,2] = xeno$Hypoxia
names(hif_targets_by_tp) = c("hif_targets","hypoxia_program")
p1 = ggplot(hif_targets_by_tp, aes(x=hif_targets, y=hypoxia_program)) +
geom_point()+
geom_density_2d(aes(color = ..level..)) +
geom_smooth(method=lm) +
stat_cor(method = "pearson", label.x = 20, label.y = 1.1)+
scale_color_viridis_c()
p2 = ggplot(hif_targets_by_tp, aes(x=hif_targets, y=hypoxia_program)) +
geom_bin2d() +
theme_bw()+ scale_fill_gradientn(limits=c(0,1100), breaks=seq(0, 1100, by=200), colours=c("blue","yellow","red"))+
stat_cor(method = "pearson", label.x = 20, label.y = 1.1)+
geom_smooth(method=lm)
p = ggarrange(plotlist = list(p1,p2),nrow = 2)
geom_smooth() using formula ‘y ~ x’
geom_smooth() using formula ‘y ~ x’
print_tab(plt = p,title = "geom_bin2d")
NA
upreg_hif_targets = hif_targets[hif_targets %in% updeg]
upreg_hif_targets_expr = FetchData(object = xeno,vars = c(upreg_hif_targets)) %>% rowSums() %>% as.data.frame() #mean expression
xeno = AddMetaData(object = xeno, metadata = upreg_hif_targets_expr,col.name = "upreg_hif_targets_score")
FeaturePlot(object = xeno,features = "upreg_hif_targets_score")
import numpy as np
import scanpy as sc
xeno_expression = r.xeno_expression
xeno_vargenes = r.xeno_vargenes
tpm = compute_tpm(xeno_expression)
usage_by_calc = get_usage_from_score(counts=xeno_expression,tpm=tpm,genes=xeno_vargenes, cnmf_obj=cnmf_obj,k=3)
/sci/labs/yotamd/lab_share/avishai.wizel/python_envs/miniconda/envs/cnmf_env_6/bin/python3.7:7: FutureWarning: X.dtype being converted to np.float32 from float64. In the next version of anndata (0.9) conversion will not be automatic. Pass dtype explicitly to avoid this warning. Pass `AnnData(X, dtype=X.dtype, ...)` to get the future behavour.
/sci/labs/yotamd/lab_share/avishai.wizel/python_envs/miniconda/envs/cnmf_env_6/bin/python3.7:8: FutureWarning: X.dtype being converted to np.float32 from float64. In the next version of anndata (0.9) conversion will not be automatic. Pass dtype explicitly to avoid this warning. Pass `AnnData(X, dtype=X.dtype, ...)` to get the future behavour.
all_metagenes_noSumTo1 = py$usage_by_calc
tnf_and_hypoxia = all_metagenes_noSumTo1[,1:2]
tnf_and_hypoxia = apply(X = tnf_and_hypoxia, MARGIN = 1, sum_2_one) %>% t() %>% as.data.frame()
tnf_and_hypoxia[is.na(tnf_and_hypoxia)] <- 0 #replace NAN's with 0.
# plot correlation for every subset of hif targets
for (genes in list(hif_targets,xeno_cluster_3_genes,xeno_cluster_3_2_genes)) {
hif_targets_by_tp = FetchData(object = xeno,vars = c(genes)) %>% rowSums() %>% as.data.frame() #mean expression
hif_targets_by_tp[,2] = tnf_and_hypoxia[,1]
# hif_targets_by_tp[,2] = xeno$Hypoxia
names(hif_targets_by_tp) = c("hif_targets","hypoxia_program")
p1 = ggplot(hif_targets_by_tp, aes(x=hif_targets, y=hypoxia_program)) +
geom_point()+
geom_density_2d(aes(color = ..level..)) +
geom_smooth(method=lm) +
stat_cor(method = "pearson", label.x = 20, label.y = 1.1)+
scale_color_viridis_c()
p2 = ggplot(hif_targets_by_tp, aes(x=hif_targets, y=hypoxia_program)) +
geom_bin2d() +
theme_bw()+ scale_fill_gradientn(limits=c(0,1100), breaks=seq(0, 1100, by=200), colours=c("blue","yellow","red"))+
stat_cor(method = "pearson", label.x = 20, label.y = 1.1)+
geom_smooth(method=lm)
p = ggarrange(plotlist = list(p1,p2),nrow = 2)
print_tab(plt = p,title = "geom_bin2d")
}
Warning in FetchData.Seurat(object = xeno, vars = c(genes)) : The
following requested variables were not found: AK4P1, BNIP3P1, LDHAP5,
AL158201.1, MIR210, NLRP3P1, AL109946.1 geom_smooth() using
formula ‘y ~ x’ geom_smooth() using formula ‘y ~ x’ ##
geom_bin2d {.unnumbered }
geom_smooth() using formula ‘y ~ x’
geom_smooth() using formula ‘y ~ x’ ## geom_bin2d
{.unnumbered }
geom_smooth() using formula ‘y ~ x’
geom_smooth() using formula ‘y ~ x’ ## geom_bin2d
{.unnumbered }
NA
hif_targets_by_tp = FetchData(object = xeno,vars = c(hif_targets)) %>% rowSums() %>% as.data.frame() #mean expression
Warning in FetchData.Seurat(object = xeno, vars = c(hif_targets)) :
The following requested variables were not found: AK4P1, BNIP3P1, LDHAP5, AL158201.1, MIR210, NLRP3P1, AL109946.1
hif_targets_by_tp[,2] = tnf_and_hypoxia[,1]
names(hif_targets_by_tp) = c("hif_targets","hypoxia_program")
high_hif_low_hypoxia_cells = hif_targets_by_tp %>% filter(hif_targets>25 & hypoxia_program < 0.2) %>% rownames()
hif_targets_by_tp = FetchData(object = xeno,vars = c(hif_targets)) %>% rowSums() %>% as.data.frame() #mean expression
Warning in FetchData.Seurat(object = xeno, vars = c(hif_targets)) :
The following requested variables were not found: AK4P1, BNIP3P1, LDHAP5, AL158201.1, MIR210, NLRP3P1, AL109946.1
xeno = AddMetaData(object = xeno, metadata = hif_targets_by_tp,col.name = "HIF_targets_score")
xeno = AddMetaData(object = xeno, metadata = tnf_and_hypoxia[,1],col.name = "Hypoxia2")
DimPlot(object = xeno, cells.highlight = high_hif_low_hypoxia_cells, cols.highlight = "red", cols = "gray", order = TRUE)
FeaturePlot(object = xeno,features = c( "HIF_targets_score","Hypoxia2","Cell_cycle" ))
FeaturePlot(object = xeno,features = c("Hypoxia2"))
DimPlot(object = xeno,group.by = "orig.ident")
xeno = AddMetaData(object = xeno,metadata = all_metagenes_noSumTo1[,1],col.name = "hypoxia_raw")
FeaturePlot(object = xeno,features = "hypoxia_raw") + scale_color_gradientn(colours = rainbow(5), limits = c(0, 3000))
Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.