Skip to content

Commit

Permalink
Update integration.R
Browse files Browse the repository at this point in the history
  • Loading branch information
debsin committed Sep 1, 2019
1 parent 53b2819 commit f78cc75
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/integration.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ Correction<-function(object, method="default", close_th=0.1, cells_th=0.1, compo
reducedDim(temp,"CComponents") = reducedDim(mnn.obj,"corrected")
SummarizedExperiment::assay(temp, "reconstructed")<-SummarizedExperiment::assay(mnn.obj, "reconstructed")
} else{
mat = Log2Normalize(normcounts(temp)[rowData(temp)$CommonDEGenes,])
if(!is.null(rowData(temp)$CommonDEGenes))
mat = Log2Normalize(normcounts(temp)[rowData(temp)$CommonDEGenes,])
else
mat = Log2Normalize(normcounts(temp))
corrected = as.matrix(.batcheffect.dc(t(mat), close_th = close_th, cells_th = cells_th))
cat("Embedding with UMAP...")
umap_proj_dc = uwot::umap(corrected, metric = 'cosine', n_components = components, ...)
Expand Down

0 comments on commit f78cc75

Please sign in to comment.