newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Yan_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Yan_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Treutlein_sd.csv",sep=",",header=T)
newdata<-file1
View(newdata)
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Treutlein_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Treutlein_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Deng135_sd.csv",sep=",",header=T)
newdata<-file1
View(newdata)
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Deng135_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Deng135_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/patel_sd.csv",sep=",",header=T)
newdata<-file1
View(newdata)
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/patel_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/patel_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Li58_sd.csv",sep=",",header=T)
newdata<-file1
View(newdata)
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Li58_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Li58_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Biase_sd.csv",sep=",",header=T)
newdata<-file1
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Baise_sd.csv",sep=",",header=T)
newdata<-file1
View(newdata)
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Biase_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/Biase_subcluster.csv",sep = ',')
library(splatter)
library(scater)
sce<-mockSCE()
View(sce)
load("C:/R/cellcluster/dataset/Baise.Rdata")
library(SingleCellExperiment)
View(entrezid_data)
Biase_fpkm <- read.csv("C:/R/cellcluster/dataset/Biase_fpkm.csv", header=FALSE)
View(Biase_fpkm)
data<-Biase_fpkm
rownames(data)<-data[,1]
colnames(data)<-data[1,]
View(data)
data<-data[-1,-1]
sce<-SingleCellExperiment(assays=data)
View(sce)
sce@colData@metadata
cell_metadata <- data.frame(batch = c(1, 1, 2))
rownames(cell_metadata) <- paste0("cell_", 1:3)
View(cell_metadata)
cell_metadata <- data.frame(batch = c(1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3))
rownames(cell_metadata) <- paste0("cell_", 1:49)
sce<-SingleCellExperiment(assays=data,colData=cell_metadata)
sce<-SingleCellExperiment(assays=data)
sce<-SingleCellExperiment(assays=list(data),colData=cell_metadata)
colData(sce)<-DataFrame(cell_metadata)
sce@colData@metadata
View(sce)
sce@colData
sce@assays
params<-splatEstimate(sce)
sc1<-mockSCE()
View(sc1)
sc1@colData@listData[["Cell_Cycle"]]
sc1@assays@data@listData[["counts"]]
sc2@assays@data@listData[["counts"]]<-data
sce<-@assays@data@listData[["counts"]]<-data
sce@assays@data@listData[["counts"]]<-data
View(sce@assays@data@listData[[1]])
sce<-SingleCellExperiment(counts=list(data))
View(sce)
rm(sce)
sce<-SingleCellExperiment(counts=list(data))
View(sc1)
sce<-SingleCellExperiment(counts=data)
sce<-SingleCellExperiment(assays=list(counts=data))
View(sce)
colnames(cell_metadata)<-c(Cell_type)
colnames(cell_metadata)<-c("cell_type")
View(cell_metadata)
rm(sce)
sce<-SingleCellExperiment(assays=list(counts=data),colData=cell_metadata)
sce<-SingleCellExperiment(assays=list(counts=data))
sce@colData@listData<-cell_metadata
View(sce)
params<-splatEstimate(sce)
data1<-as.matrix(data)
View(data1)
rm(sce)
sce<-SingleCellExperiment(assays=list(counts=data))
sce@colData@listData<-cell_metadata
View(sce)
rm(sce)
sce<-SingleCellExperiment(assays=list(counts=data1))
sce@colData@listData<-cell_metadata
View(sce)
data1<-as.numeric(data1)
View(data1)
data1<-as.matrix(data)
View(data1)
class(data1)
data1<-as.numeric(data)
class(data)
data1<-as.array(data)
data1<-as.matrix(data)
data1<-as.array(data1)
class(data1)
data1<-as.numeric(data)
data1<-as.numeric(data1)
y<-apply(data1,2,as.numeric)
data1<-as.matrix(data)
y<-apply(data1,2,as.numeric)
class(y)
class(y[1,1])
rm(sce)
sce<-SingleCellExperiment(assays=list(counts=y))
sce@colData@listData<-cell_metadata
params<-splatEstimate(sce)
View(sce)
sim<splatSimulate(params)
sim<-splatSimulate(params)
View(sim)
View(params)
params<-setParam(params,"nGenes",10000)
params<-setParam(params,"nCells",1000)
View(params)
params<-setParam(params,"batchCells",1000)
View(params)
sim.groups<-splatSimulate(group.prob=c(0.3,0.3,0.3,0.1),method="groups",verbose = FALSE)
sim<-logNormCounts(sim)
sim<-runPCA(sim)
plotPCA(sim,colour_by="Group")
View(sce)
View(sim)
sim.groups<-splatSimulateGroups(group.prob=c(0.3,0.3,0.3,0.1),method="groups",verbose = FALSE)
counts(sim)[1:5,1:5]
View(sim)
params<-setParam(params,"nGenes",10000)
sim<-splatSimulate(params)
View(sim)
sim<-logNormCounts(sim)
sim<-runPCA(sim)
plotPCA(sim)
sim.groups<-splatSimulate(group.prob=c(0.2,0.2,0.3,0.3),method="groups",verbose = FALSE)
sim.groups<-logNormCounts(sim.groups)
sim.groups<-runPCA(sim.groups)
plotPCA(sim.groups,colour_by="Group")
View(sim.groups)
View(sim)
sim.groups<-splatSimulate(params,group.prob=c(0.2,0.2,0.3,0.3),method="groups",verbose = FALSE)
View(sim.groups)
Li58_rpkm <- read.csv("C:/R/cellcluster/dataset/Li58_rpkm.csv", header=FALSE)
View(Li58_rpkm)
Biase_fpkm <- read.csv("C:/R/cellcluster/dataset/Biase_fpkm.csv", header=FALSE)
View(Biase_fpkm)
#####
data<-Biase_fpkm
rownames(data)<-data[,1]
colnames(data)<-data[1,]
data<-data[-1,-1]
data<-as.matrix(data)
data<-apply(data,2,as.numeric)
View(data)
cell_metadata <- data.frame(batch = c(1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3))
rownames(cell_metadata) <- paste0("cell_", 1:49)
sce<-SingleCellExperiment(assays=list(counts=data))
sce@colData@listData<-cell_metadata
View(sce)
params<-splatEstimate(sce)
sim<-splatSimulate(params)
params<-setParam(params,"nGenes",10000)
sim<-splatSimulate(params,group.prob=c(0.2,0.2,0.3,0.3),method="groups",verbose = FALSE)
sim<-logNormCounts(sim)
sim<-runPCA(sim)
plotPCA(sim,colour_by="Group")
View(sim)
sim.group<-splatSimulate(params,group.prob=c(0.2,0.2,0.3,0.3),method="groups",verbose = FALSE)
sim.group<-logNormCounts(sim.group)
sim.group<-runPCA(sim.group)
plotPCA(sim.group,colour_by="Group")
View(sim.group)
View(params)
View(sim.group)
View(sim)
params<-setParam(params,"batchCells",1000)
sim<-splatSimulate(params,group.prob=c(0.2,0.2,0.3,0.3),method="groups",verbose = FALSE)
sim<-logNormCounts(sim.group)
sim<-runPCA(sim.group)
plotPCA(sim.group,colour_by="Group")
View(sim)
params<-splatEstimate(sce)
sim<-splatSimulate(params)
params<-setParam(params,"nGenes",10000)
params<-setParam(params,"batchCells",1000)
sim.group<-splatSimulate(params,group.prob=c(0.2,0.2,0.3,0.3),method="groups",verbose = FALSE)
sim.group<-logNormCounts(sim.group)
sim.group<-runPCA(sim.group)
plotPCA(sim.group,colour_by="Group")
params<-splatEstimate(sce)
sim<-splatSimulate(params)
params<-setParam(params,"nGenes",10000)
params<-setParam(params,"batchCells",1000)
sim.group<-splatSimulate(params,group.prob=c(0.5,0.5),method="groups",verbose = FALSE)
sim.group<-logNormCounts(sim.group)
sim.group<-runPCA(sim.group)
plotPCA(sim.group,colour_by="Group")
params<-splatEstimate(sce)
sim<-splatSimulate(params)
#params<-setParam(params,"nGenes",10000)
params<-setParam(params,"batchCells",1000)
sim.group<-splatSimulate(params,group.prob=c(0.5,0.5),method="groups",verbose = FALSE)
sim.group<-logNormCounts(sim.group)
sim.group<-runPCA(sim.group)
plotPCA(sim.group,colour_by="Group")
params.group<-newSplatParams(batchCells=2000,nGenes=10000)
sim1<-splatSimulateGroups(params.group,group.prob=c(0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05),verbose = FALSE)
params.group<-newSplatParams(batchCells=2000,nGenes=10000)
sim1<-splatSimulateGroups(params.group,group.prob=c(0.05,0.05,0.9),verbose = FALSE)
sim1<-logNormCounts(sim1)
sim1<-runPCA(sim1)
plotPCA(sim1,colour_by="Group")
View(sim.group)
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Baise_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
View(newdata)
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Biase_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Biase_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Deng135_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
View(newdata)
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Deng135_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Deng135_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/patel_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
View(newdata)
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/patel_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/patel_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Treutlein_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Treutlein_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
View(newdata)
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Treutlein_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Treutlein_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Yan_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Yan_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Yan_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Tian305_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
View(newdata)
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Tian305_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Tian305_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Tian307_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Tian307_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Li58_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Li58_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Li58_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Tian307_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Tian307_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Tian307_subcluster.csv",sep = ',')
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Biase_sd.csv",sep=",",header=T)
rm(list = ls())
file1<-read.table(file="C:/R/cellcluster/experiment_data_906/log2_10/k_2_10/sd1000/Baise_sd.csv",sep=",",header=T)
newdata<-file1
rm(file1)
rownames(newdata)<-newdata[,1]
newdata<-newdata[,-1]
newdata<-newdata[1:1000,]
file1<-read.table(file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Biase_subcluster.txt",sep=",",header=T)
gc<-file1$Y_optimal
rm(file1)
newdata=as.data.frame(newdata)
gc=as.data.frame(gc)
names(gc)="y"
gcluster=cbind(newdata,gc)
gcluster<-gcluster[order(gcluster$y),]
gcluster<-t(gcluster)
write.table(gcluster,file="C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/返修/实验/result/mahalanobis/Biase_subcluster.csv",sep = ',')
rm(list = ls())
setwd("C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/code")
load(Biase.RData)
rm(list = ls())
setwd("C:/Users/86137/doctor/singlecellclustering/投稿/PeerJ(2.984Q2)/code")
load("Biase.RData")
View(data)
#file1<-read.table(file="C:/R/cellcluster/dataset/Treutlein_fpkm.csv",sep=",",header=T)
#data<-file1
#rownames(data)<-data[,1]
#data<-data[,-1]
library(matrixStats)
t1 <- proc.time()
Mdata<-max(data)
if(Mdata>10000){
data<-log(data+1)/log(10)
}else {
data<-log(data+1)/log(2)
}
data<-as.matrix(
data[rowSums(data)>0,]
)
ncol<-dim(data)[2]
sd<-matrixStats::rowVars(data)
data<-cbind(data,sd)
newdata<-data[order(-sd),]
newdata<-newdata[1:1000,1:ncol]
den=512
name<-rownames(newdata)
nrow<-dim(newdata)[1]
ncol<-dim(newdata)[2]
d<-list()
for(i in 1:nrow){
a<-density(as.numeric(newdata[i,]),n=den)
d[[i]]=a$y
}
t2<-proc.time()
t=t2-t1
print(paste0('执行时间：',t[3][[1]]))
d<-as.data.frame(d)
rm(a)
names(d)<-name
d<-as.data.frame(t(d),)
View(newdata)
View(d)
