Skip to content

Commit

Permalink
change readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lmw123 committed Jul 8, 2022
1 parent 0851e9a commit f9d4da1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/FastIntegration.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ FastFindWeights = function(
)

distances = Seurat::Distances(object = knn_2_2)
a = as.numeric(distances[,ncol(x = distances)]/distances[,2])
b = distances/distances[,2]
b = which(b > qnorm(0.99, mean(a), sd(a)))

distances = 1 - (distances / distances[, ncol(x = distances)])
distances[b] = 0
# a = as.numeric(distances[,ncol(x = distances)]/distances[,2])
# b = distances/distances[,2]
# b = which(b > qnorm(0.99, mean(a), sd(a)))
#
# distances = 1 - (distances / distances[, ncol(x = distances)])
# distances[b] = 0
cell.index = Seurat::Indices(object = knn_2_2)
FindWeightsC = getFromNamespace("FindWeightsC", "Seurat")
weights = FindWeightsC(
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ for (i in 1:length(rna.list)) {


### Onestop function

For large sample size (> 200 samples), we recommend to use step by step integration.
```R
library(FastIntegration)
# rna.list is the list of seurat object
Expand All @@ -77,6 +79,13 @@ library(FastIntegration)
BuildIntegrationFile(rna.list = rna.list, tmp.dir = "./", nCores = 50)
FastFindAnchors(tmp.dir = "./", nCores = 50)

# close current R session and open a new one to clean the memory (This is important for large data integration)
# In the new session, please just set work directory and do not load any data. Then run the following codes:

library(Seurat)
library(pbmcapply)
library(FastIntegration)

genes = readRDS("FastIntegrationTmp/raw/1.rds")
genes = rownames(genes)
idx = split(1:length(genes), cut(1:length(genes), 20, labels = FALSE))
Expand Down

0 comments on commit f9d4da1

Please sign in to comment.