Skip to content

Commit

Permalink
add project metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
lmw123 committed Sep 26, 2021
1 parent 6694510 commit c9e73bc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
14 changes: 8 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Package: FastIntegration
Type: Package
Title: What the Package Does (Title Case)
Title: Fast Integration of Single-cell Data
Version: 0.1.0
Author: Who wrote it
Maintainer: The package maintainer <[email protected]>
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Author: c(
person(given = "Mengwei", family = "Li", email = "[email protected]", role = "aut"),
person(given = "Xiaomeng", family = "Zhang", email = "[email protected]", role = "aut"),
person(given = "Jinmiao", family = "Chen", email = "[email protected]", role = "aut")
)
Description: FastIntegrate integrates thousands of scRNA-seq datasets and outputs batch-corrected values for downstream analysis
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Generated by roxygen2: do not edit by hand

export(BuildIntegrationFile)
export(FastFindAnchors)
export(FastIntegration)
import(Matrix)
import(Seurat)
import(SeuratObject)
Expand Down
7 changes: 5 additions & 2 deletions R/FastFindAnchors.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' @import dplyr
#' @import Matrix
#' @importFrom utils getFromNamespace
#' @export
FastFindAnchors = function(
tmp.dir = NULL,
nCores = NULL,
Expand Down Expand Up @@ -62,8 +63,10 @@ FastFindAnchors = function(
ncel.min = pmin(ncell.a, ncell.b)
similarity.matrix = similarity.matrix/ncel.min
similarity.matrix[upper.tri(x = similarity.matrix, diag = TRUE)] = NA
BuildSampleTree = getFromNamespace("BuildSampleTree", "Seurat")
sample.tree = BuildSampleTree(similarity.matrix)

saveRDS(similarity.matrix, paste0(tmp.dir, "/FastIntegrationTmp/others/similarity_matrix.rds"), compress = F)
saveRDS(sample.tree, paste0(tmp.dir, "/FastIntegrationTmp/others/sample_tree.rds"), compress = F)
saveRDS(all.anchors, paste0(tmp.dir, "/FastIntegrationTmp/anchors/anchors.rds"), compress = F)
return(NULL)
}
Expand Down Expand Up @@ -133,7 +136,7 @@ FindAnchorsPair = function(
return(anchors)
}


#' @export
BuildIntegrationFile = function(
rna.list,
tmp.dir = NULL,
Expand Down
8 changes: 6 additions & 2 deletions R/FastIntegration.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#' @import tictoc
#' @export
FastIntegration = function(
tmp.dir = NULL,
features.to.integrate = NULL,
input.pca,
nn.k = 100,
slot = c("data", "counts")
) {
setDTthreads(threads = 1L)
message("Reading anchor file")
anchors = readRDS(paste0(tmp.dir, "/FastIntegrationTmp/anchors/anchors.rds"))
offsets = readRDS(paste0(tmp.dir, "/FastIntegrationTmp/others/offsets.rds"))
obj.lengths = readRDS(paste0(tmp.dir, "/FastIntegrationTmp/others/object_ncells.rds"))
similarity.matrix = readRDS(paste0(tmp.dir, "/FastIntegrationTmp/others/similarity_matrix.rds"))
sample.tree = Seurat:::BuildSampleTree(similarity.matrix = similarity.matrix)
sample.tree = readRDS(paste0(tmp.dir, "/FastIntegrationTmp/others/sample_tree.rds"))

message("Reading rna list file")
object.list = list()
for (i in 1:length(obj.lengths)) {
a = readRDS(paste0(tmp.dir, "/FastIntegrationTmp/raw/", i, ".rds"))
Expand Down

0 comments on commit c9e73bc

Please sign in to comment.