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

Remove depreciated code

parent 751d0a65
Branches
Tags
2 merge requests!4Merge ds,!3Merge completed D17 downsample in to develop
......@@ -124,7 +124,6 @@ colnames(cell.codes) <- "barcodes"
rownames(cell.codes) <- cell.codes$barcodes
cell.codes$samples <- "All"
sc10x <- CreateSeuratObject(raw.data=sc10x.data,meta.data=cell.codes["samples"],min.cells=3,min.genes=-Inf,project="DS.D17")
#sc10x <- AddMetaData(sc10x,cell.codes["samples"],"samples")
rm(cell.codes)
rm(sc10x.data)
......@@ -307,10 +306,6 @@ sc10x.Epi.NE <- scNE(sc10x.Epi,neg="dws",cut=opt$cut.ne)
sc10x <- scMerge(sc10x,sc10x.Epi,sc10x.St,i.1="Epi.dws.sc",i.2="St.dws.sc",nm="Merge_Epi.dws.sc_St.dws.sc")
#sc10x <- scMerge(sc10x,sc10x,sc10x.Epi.NE,i.1="Merge_Epi.dws.sc_St.dws.sc",i.2="NE",nm="Merge_Epi.dws.sc_St.dws.sc_NE")
#sc10x.Epi <- scMerge(sc10x.Epi,sc10x.Epi,sc10x.Epi.NE,i.1="Epi.dws.sc",i.2="NE",nm="Epi.dws.sc_NE")
sc10x <- SetAllIdent(object=sc10x,id="Merge_Epi.dws.sc_St.dws.sc")
sc10x <- SetAllIdent(object=sc10x,id="Merge_Epi.dws.sc_St.dws.sc")
sc10x@ident <- factor(sc10x@ident,levels=c("BE","LE","OE_SCGB","OE_KRT13","Fib","SM","Endo","Leu"))
......@@ -322,8 +317,6 @@ plot(plot)
dev.off()
scTables(sc10x,i.1="samples",i.2="Merge_Epi.dws.sc_St.dws.sc")
#scTables(sc10x,i.1="samples",i.2="Merge_Epi.dws.sc_St.dws.sc_NE")
#scTables(sc10x,i.1="Merge_Epi.dws.sc_St.dws.sc_NE",i.2="Merge_Epi.dws.sc_St.dws.sc")
sctSNECustCol(sc10x,i="Lin",bl="Epi",rd="St",file="D17")
sctSNECustCol(sc10x,i="Merge_Epi.dws.sc_St.dws.sc",bl=c("BE","LE","OE_SCGB","OE_KRT13"),rd=c("Fib","SM","Endo","Leu"),file="D17")
......@@ -344,7 +337,6 @@ for (g in c("BE","LE","OE_SCGB","OE_KRT13")){
sctSNEHighlight(sc10x,i="Merge_Epi.dws.sc_St.dws.sc",g=g,file="D17")
sctSNEHighlight(sc10x.Epi,i="Epi.dws.c",g=g,file="D17")
}
#sctSNEHighlight(sc10x.Epi.NE,i="NE",g="NE",file="D17")
for (g in c("Fib","SM","Endo","Leu")){
sctSNEHighlight(sc10x,i="Merge_Epi.dws.sc_St.dws.sc",g=g,file="D17")
sctSNEHighlight(sc10x.St,i="St.dws.sc",g=g,file="D17")
......
......@@ -44,14 +44,12 @@ for (i in downsample){
for (i in downsample){
assign(paste0("sc10x.",i),SetAllIdent(get(paste0("sc10x.",i)),id="Merge_Epi.dws.sc_St.dws.sc"))
assign(paste0("cluster.",i),data.frame(Barcodes=names(get(paste0("sc10x.",i))@ident),Cluster=get(paste0("sc10x.",i))@ident))
#assign(paste0("cluster.",i,".filter"),get(paste0("cluster.",i))[get(paste0("cluster.",i))$Barcodes %in% shared.cells,])
assign(paste0("cluster.",i,".filter"),get(paste0("cluster.",i))[get(paste0("cluster.",i))$Barcodes %in% sc10x.All@data@Dimnames[[2]],])
}
nmi <- data.frame(Sample=character(),value=double())
for (i in downsample[-1]){
nmi <- rbind(nmi,data.frame(Sample=i,value=NMI(cluster.All.filter,get(paste0("cluster.",i,".filter")))))
#nmi <- rbind(nmi,data.frame(Sample=i,value=NMI(cluster.All.filter,get(paste0("cluster.",i)))))
}
nmi$Sample <- as.numeric(levels(nmi$Sample))
......@@ -98,11 +96,9 @@ model <- loess(NMI~RPC,data=nmi.rpc)
fit.y <- 0.9
fit.x <- approx(y=nmi.rpc$RPC,x=predict(model),xout=fit.y)$y
plot.comb <- plot.comb+geom_vline(xintercept=fit.x,linetype=2,size=1.5)+geom_hline(yintercept=fit.y,linetype=2,size=1.5)
#plot.comb <- plot.comb+geom_text(aes(40000,0.5,label=paste0("Mean Read/Cell = ",round(fit.x,0)),vjust=3))
#plot.comb <- plot.comb+geom_text(aes(40000,0.5,label=paste0("NMI = ",fit.y),vjust=1.5))
plot.comb <- plot.comb+labs(x="Mean Reads Per Cell",y="NMI")
plot.comb <- plot.comb+scale_x_continuous(expand=c(0,0),limits=c(0,80000),breaks=c(seq(0,100000,25000),round(fit.x,0)))+scale_y_continuous(expand=c(0,0),limits=c(0,1),breaks=c(seq(0,1,0.2),fit.y))
plot(plot.comb)
dev.off()
save.image(file="./analysis/NMI.RData")
\ No newline at end of file
save.image(file="./analysis/NMI.RData")
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