Skip to content

Commit 0b776ca

Browse files
authored
Merge pull request #2235 from GreenleafLab/ia/suppress-archr-warnings
remove seurat/harmony warnings
2 parents 474a057 + d24793d commit 0b776ca

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

R/Clustering.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ addClusters <- function(
435435

436436
clustParams <- tryCatch({
437437

438-
obj <- Seurat::CreateSeuratObject(tmp, project='scATAC', min.cells=0, min.features=0)
438+
obj <- suppressWarnings(Seurat::CreateSeuratObject(tmp, project='scATAC', min.cells=0, min.features=0))
439439
obj[['pca']] <- Seurat::CreateDimReducObject(embeddings=mat, key='PC_', assay='RNA')
440440
clustParams$object <- obj
441441
clustParams$reduction <- "pca"
@@ -469,7 +469,7 @@ addClusters <- function(
469469
colnames(tmp) <- rownames(mat)
470470
rownames(tmp) <- paste0("t",seq_len(nrow(tmp)))
471471

472-
obj <- Seurat::CreateSeuratObject(tmp, project='scATAC', min.cells=0, min.features=0)
472+
obj <- suppressWarnings(Seurat::CreateSeuratObject(tmp, project='scATAC', min.cells=0, min.features=0))
473473
obj[['pca']] <- Seurat::CreateDimReducObject(embeddings=mat, key='PC_', assay='RNA')
474474
clustParams$object <- obj
475475
clustParams$reduction <- "pca"

R/Harmony.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ addHarmony <- function(
8080
harmonyParams$plot_convergence <- FALSE
8181

8282
#Call Harmony
83-
harmonyMat <- do.call(HarmonyMatrix, harmonyParams)
83+
harmonyMat <- suppressWarnings(do.call(HarmonyMatrix, harmonyParams))
8484
harmonyParams$data_mat <- NULL
8585
ArchRProj@reducedDims[[name]] <- SimpleList(
8686
matDR = harmonyMat,
@@ -89,7 +89,6 @@ addHarmony <- function(
8989
scaleDims = NA, #Do not scale dims after
9090
corToDepth = NA
9191
)
92-
9392
ArchRProj
9493

9594
}

R/RNAIntegration.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ addGeneIntegrationMatrix <- function(
220220

221221
#Set up RNA
222222
if(inherits(seRNA, "SummarizedExperiment")){
223-
seuratRNA <- CreateSeuratObject(counts = assay(seRNA))
223+
seuratRNA <- suppressWarnings(CreateSeuratObject(counts = assay(seRNA)))
224224
if(groupRNA %ni% colnames(colData(seRNA))){
225225
.logMessage("groupRNA not in colData of seRNA", logFile = logFile)
226226
stop("groupRNA not in colData of seRNA")
@@ -475,7 +475,7 @@ addGeneIntegrationMatrix <- function(
475475

476476
#Log-Normalize
477477
mat <- log(mat + 1) #use natural log
478-
seuratATAC <- Seurat::CreateSeuratObject(counts = mat[head(seq_len(nrow(mat)), 5), , drop = FALSE])
478+
seuratATAC <- supressWarninggs(Seurat::CreateSeuratObject(counts = as.matrix(mat[head(seq_len(nrow(mat)), 5), , drop = FALSE])))
479479
seuratATAC[["GeneScore"]] <- Seurat::CreateAssayObject(counts = mat)
480480

481481
#Clean Memory

0 commit comments

Comments
 (0)