Commit 31988046 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

Make DEG try

parent e1789e83
......@@ -307,6 +307,11 @@ rm(gene.set)
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")
cells.ne <- names(sc10x.Epi.NE@ident[sc10x.Epi.NE@ident=="NE"])
sc10x <- SetAllIdent(object=sc10x,id="Merge_Epi.dws.sc_St.dws.sc")
sc10x <- SetIdent(object=sc10x,cells.use=cells.ne,ident.use="NE")
sc10x <- StashIdent(object=sc10x,save.name="Merge_Epi.dws.sc_St.dws.sc_NE")
rm(cells.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")
......@@ -318,7 +323,7 @@ plot <- plot+guides(colour=guide_legend(override.aes=list(size=10)))
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")
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")
......@@ -346,41 +351,40 @@ for (g in c("Fib","SM","Endo","Leu")){
rm(i)
rm(g)
try(genes.deg.Stress <- scDEG(sc10x.Stress,i="Stress",g.1="Stress",g.2="ALL",pct=0.5,t=5))
genes.deg.Stress <- scDEG(sc10x.Stress,i="Stress",g.1="Stress",g.2="ALL",pct=0.5,t=5)
genes.deg.Epi <- scDEG(sc10x,i="Lin",g.1="Epi",g.2="St",t=2)
genes.deg.St <- scDEG(sc10x,i="Lin",g.1="St",g.2="Epi",t=2)
try(genes.deg.Epi <- scDEG(sc10x,i="Lin",g.1="Epi",g.2="St",t=2))
try(genes.deg.St <- scDEG(sc10x,i="Lin",g.1="St",g.2="Epi",t=2))
genes.deg.BE <- scDEG(sc10x.Epi,i="Epi.dws.sc",g.1="BE",g.2=c("LE","OE_SCGB","OE_KRT13"),pct=0.25,t=2)
genes.deg.LE <- scDEG(sc10x.Epi,i="Epi.dws.sc",g.1="LE",g.2=c("BE","OE_SCGB","OE_KRT13"),pct=0.25,t=2)
genes.deg.OE1 <- scDEG(sc10x.Epi,i="Epi.dws.sc",g.1="OE_SCGB",g.2=c("BE","LE","OE_KRT13"),pct=0.25,t=2)
genes.deg.OE2 <- scDEG(sc10x.Epi,i="Epi.dws.sc",g.1="OE_KRT13",g.2=c("BE","LE","OE_SCGB"),pct=0.25,t=2)
try(genes.deg.BE <- scDEG(sc10x,i="Merge_Epi.dws.sc_St.dws.sc_NE",g.1="BE",g.2=c("LE","OE_SCGB","OE_KRT13"),pct=0.25,t=2))
try(genes.deg.LE <- scDEG(sc10x,i="Merge_Epi.dws.sc_St.dws.sc_NE",g.1="LE",g.2=c("BE","OE_SCGB","OE_KRT13"),pct=0.25,t=2))
try(genes.deg.OE1 <- scDEG(sc10x,i="Merge_Epi.dws.sc_St.dws.sc_NE",g.1="OE_SCGB",g.2=c("BE","LE","OE_KRT13"),pct=0.25,t=2))
try(genes.deg.OE2 <- scDEG(sc10x,i="Merge_Epi.dws.sc_St.dws.sc_NE",g.1="OE_KRT13",g.2=c("BE","LE","OE_SCGB"),pct=0.25,t=2))
genes.deg.NE <- scDEG(sc10x.Epi.NE,i="NE",g.1="NE",g.2="ALL",pct=0.01,t=1)
try(genes.deg.NE <- scDEG(sc10x,i="Merge_Epi.dws.sc_St.dws.sc_NE",g.1="NE",g.2=c("BE","LE","OE_SCGB","OE_KRT13"),pct=0.01,t=1))
genes.deg.Fib <- scDEG(sc10x.St,i="Merge_Epi.dws.sc_St.dws.sc",g.1="Fib",g.2=c("SM","Endo","Leu"),pct=0.25,t=2)
genes.deg.SM <- scDEG(sc10x.St,i="Merge_Epi.dws.sc_St.dws.sc",g.1="SM",g.2=c("Fib","Endo","Leu"),pct=0.25,t=2)
genes.deg.Endo <- scDEG(sc10x.St,i="Merge_Epi.dws.sc_St.dws.sc",g.1="Endo",g.2=c("Fib","SM","Leu"),pct=0.25,t=2)
genes.deg.Leu <- scDEG(sc10x.St,i="St.dws.sc",g.1="Leu",g.2=c("Fib","SM","Endo"),pct=0.25,t=2)
try(genes.deg.Fib <- scDEG(sc10x.St,i="Merge_Epi.dws.sc_St.dws.sc",g.1="Fib",g.2=c("SM","Endo","Leu"),pct=0.25,t=2))
try(genes.deg.SM <- scDEG(sc10x.St,i="Merge_Epi.dws.sc_St.dws.sc",g.1="SM",g.2=c("Fib","Endo","Leu"),pct=0.25,t=2))
try(genes.deg.Endo <- scDEG(sc10x.St,i="Merge_Epi.dws.sc_St.dws.sc",g.1="Endo",g.2=c("Fib","SM","Leu"),pct=0.25,t=2))
try(genes.deg.Leu <- scDEG(sc10x.St,i="St.dws.sc",g.1="Leu",g.2=c("Fib","SM","Endo"),pct=0.25,t=2))
genes.deg.BE.unique <- setdiff(rownames(genes.deg.BE),Reduce(union,list(rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu))))
genes.deg.LE.unique <- setdiff(rownames(genes.deg.LE),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu))))
genes.deg.OE1.unique <- setdiff(rownames(genes.deg.OE1),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu))))
genes.deg.OE2.unique <- setdiff(rownames(genes.deg.OE2),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu))))
genes.deg.NE.unique <- setdiff(rownames(genes.deg.NE),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu))))
genes.deg.Fib.unique <- setdiff(rownames(genes.deg.Fib),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu))))
genes.deg.SM.unique <- setdiff(rownames(genes.deg.SM),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.Endo),rownames(genes.deg.Leu))))
genes.deg.Endo.unique <- setdiff(rownames(genes.deg.Endo),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Leu))))
genes.deg.Leu.unique <- setdiff(rownames(genes.deg.Leu),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo))))
try(genes.deg.BE.unique <- setdiff(rownames(genes.deg.BE),Reduce(union,list(rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu)))))
try(genes.deg.LE.unique <- setdiff(rownames(genes.deg.LE),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu)))))
try(genes.deg.OE1.unique <- setdiff(rownames(genes.deg.OE1),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu)))))
try(genes.deg.OE2.unique <- setdiff(rownames(genes.deg.OE2),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu)))))
try(genes.deg.NE.unique <- setdiff(rownames(genes.deg.NE),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu)))))
try(genes.deg.Fib.unique <- setdiff(rownames(genes.deg.Fib),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.SM),rownames(genes.deg.Endo),rownames(genes.deg.Leu)))))
try(genes.deg.SM.unique <- setdiff(rownames(genes.deg.SM),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.Endo),rownames(genes.deg.Leu)))))
try(genes.deg.Endo.unique <- setdiff(rownames(genes.deg.Endo),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Leu)))))
try(genes.deg.Leu.unique <- setdiff(rownames(genes.deg.Leu),Reduce(union,list(rownames(genes.deg.BE),rownames(genes.deg.LE),rownames(genes.deg.OE1),rownames(genes.deg.OE2),rownames(genes.deg.NE),rownames(genes.deg.Fib),rownames(genes.deg.SM),rownames(genes.deg.Endo)))))
genes.deg.5 <- c(genes.deg.BE.unique[1:5],genes.deg.LE.unique[1:5],genes.deg.OE1.unique[1:5],genes.deg.OE2.unique[1:5],genes.deg.NE.unique[1:5],genes.deg.Fib.unique[1:5],genes.deg.SM.unique[1:5],genes.deg.Endo.unique[1:5],genes.deg.Leu.unique[1:5])
genes.deg.5 <- rev(genes.deg.5)
genes.deg.10 <- c(genes.deg.BE.unique[1:10],genes.deg.LE.unique[1:10],genes.deg.OE1.unique[1:10],genes.deg.OE2.unique[1:10],genes.deg.NE.unique[1:10],genes.deg.Fib.unique[1:10],genes.deg.SM.unique[1:10],genes.deg.Endo.unique[1:10],genes.deg.Leu.unique[1:10])
genes.deg.10 <- rev(genes.deg.10)
try(genes.deg.5 <- c(genes.deg.BE.unique[1:5],genes.deg.LE.unique[1:5],genes.deg.OE1.unique[1:5],genes.deg.OE2.unique[1:5],genes.deg.NE.unique[1:5],genes.deg.Fib.unique[1:5],genes.deg.SM.unique[1:5],genes.deg.Endo.unique[1:5],genes.deg.Leu.unique[1:5]))
try(genes.deg.5 <- rev(genes.deg.5))
try(genes.deg.10 <- c(genes.deg.BE.unique[1:10],genes.deg.LE.unique[1:10],genes.deg.OE1.unique[1:10],genes.deg.OE2.unique[1:10],genes.deg.NE.unique[1:10],genes.deg.Fib.unique[1:10],genes.deg.SM.unique[1:10],genes.deg.Endo.unique[1:10],genes.deg.Leu.unique[1:10]))
try(genes.deg.10 <- rev(genes.deg.10))
for (i in ls(pattern="^genes.deg")){
write.table(get(i),file=paste0("./analysis/deg/",i,".csv"),row.names=TRUE,col.names=NA,append=FALSE,sep=",")
try(write.table(get(i),file=paste0("./analysis/deg/",i,".csv"),row.names=TRUE,col.names=NA,append=FALSE,sep=","))
}
save(list=ls(pattern="sc10x.Stress"),file="./analysis/sc10x.Stress.Rda")
......
Markdown is supported
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