Skip to content

Commit d963032

Browse files
authored
Update fitdevo.R
1 parent f8f0343 commit d963032

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fitdevo.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ fitdevo<-function(MAT, BGW, NORM=TRUE, PCNUM=50, VARGENE=2000, tooLargeLimit=500
115115

116116
# Preprocess
117117
this_mat=.toUpper(MAT)
118-
NNN=min(c(PCNUM,ncol(this_mat)-1))
119118

120119
#############################################
121120
# Create Seurat object
@@ -144,13 +143,17 @@ fitdevo<-function(MAT, BGW, NORM=TRUE, PCNUM=50, VARGENE=2000, tooLargeLimit=500
144143
pbmc=subset(pbmc, cells=colnames(pbmc)[used_index])
145144
}
146145

146+
147147
#####################################################
148148
print('Calculating PCs ... ')
149149
#####################################################
150150
# Calculate PCs
151151
pbmc <- FindVariableFeatures(object =pbmc, selection.method = "vst", nfeatures = VARGENE)
152152
pbmc <- ScaleData(object = pbmc, features =VariableFeatures(pbmc))
153+
####################################
154+
NNN=min(c(PCNUM,ncol(pbmc)-1))
153155
pbmc <- RunPCA(object = pbmc, npcs=NNN, features = VariableFeatures(pbmc) , ndims.print=1,nfeatures.print=1, seed.use=123)
156+
####################################
154157
PCA=pbmc@reductions$pca@cell.embeddings
155158

156159
#####################################################
@@ -769,5 +772,3 @@ fitdevo.field<-function(DP, VEC,COL=NULL, N=25, CUT=1, P=0.9, CEX=0.5, LWD=1.5,
769772

770773

771774

772-
773-

0 commit comments

Comments
 (0)