Skip to content
Snippets Groups Projects
Commit 6a0e0cb8 authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Change find cutoff in PCA for Stress and NE to first local minima after global maxima

parent 72c642e8
Branches
Tags
No related merge requests found
...@@ -96,7 +96,7 @@ ts_1 <- ts(d1$y) ...@@ -96,7 +96,7 @@ ts_1 <- ts(d1$y)
#ts_2 <- ts(d2$y) #ts_2 <- ts(d2$y)
tp1 <- turnpoints(ts_1) tp1 <- turnpoints(ts_1)
#tp2 <- turnpoints(ts_2) #tp2 <- turnpoints(ts_2)
pit1 <- min(d1$x[tp1$pits][d1$y[tp1$pits]==min(d1$y[tp1$pits])]) pit1 <- min(d1$x[tp1$pits][d1$x[tp1$pits]>d1$x[tp1$peaks][d1$y[tp1$peaks]==max(d1$y[tp1$peaks])]])
#pit2 <- d2$x[tp2$pits][length(d2$x[tp2$pits])] #pit2 <- d2$x[tp2$pits][length(d2$x[tp2$pits])]
#abline(v=pit1) #abline(v=pit1)
......
...@@ -75,13 +75,14 @@ plot(plot) ...@@ -75,13 +75,14 @@ plot(plot)
dev.off() dev.off()
#find first turning point on a KDE of Stress1 #find first turning point on a KDE of Stress1
histo <- hist(GetCellEmbeddings(object=sc10x.Group,reduction.type="Stress",dims.use=1),breaks=10,prob=TRUE,plot=TRUE)
d1 <- density(GetCellEmbeddings(object=sc10x.Group,reduction.type="Stress",dims.use=1),n=1000) d1 <- density(GetCellEmbeddings(object=sc10x.Group,reduction.type="Stress",dims.use=1),n=1000)
#d2 <- density(GetCellEmbeddings(object=sc10x.Group,reduction.type="Stress",dims.use=2),n=1000) #d2 <- density(GetCellEmbeddings(object=sc10x.Group,reduction.type="Stress",dims.use=2),n=1000)
ts_1 <- ts(d1$y) ts_1 <- ts(d1$y)
#ts_2 <- ts(d2$y) #ts_2 <- ts(d2$y)
tp1 <- turnpoints(ts_1) tp1 <- turnpoints(ts_1)
#tp2 <- turnpoints(ts_2) #tp2 <- turnpoints(ts_2)
pit1 <- min(d1$x[tp1$pits]) pit1 <- min(d1$x[tp1$pits][d1$x[tp1$pits]>d1$x[tp1$peaks][d1$y[tp1$peaks]==max(d1$y[tp1$peaks])]])
#pit2 <- min(d2$x[tp2$pits]) #pit2 <- min(d2$x[tp2$pits])
#plot clusters #plot clusters
...@@ -98,6 +99,8 @@ plot <- plot+geom_vline(xintercept=pit1,color="red",lwd=2.5) ...@@ -98,6 +99,8 @@ plot <- plot+geom_vline(xintercept=pit1,color="red",lwd=2.5)
plot(plot) plot(plot)
dev.off() dev.off()
#subsample all cells (+Stress) to better visualize their clustering #subsample all cells (+Stress) to better visualize their clustering
if (!is.na(opt$s)){ if (!is.na(opt$s)){
rnd <- sample(1:ncol(sc10x.Group@data),opt$sv) rnd <- sample(1:ncol(sc10x.Group@data),opt$sv)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment