Skip to content

Commit

Permalink
Fixed data preprocessing bugs. v0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
innesbre committed Aug 27, 2018
1 parent f09333a commit 0c1229d
Show file tree
Hide file tree
Showing 10 changed files with 560 additions and 552 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,7 +1,7 @@
Package: scClustViz
Type: Package
Title: Differential Expression-based scRNAseq Cluster Assessment and Viewing
Version: 0.2.2
Version: 0.2.3
Date: 2018-08-21
Authors@R: c(as.person("Brendan T. Innes <brendan.innes@mail.utoronto.ca> [aut,cre]"),
as.person("Gary D. Bader [aut,ths]"))
Expand Down
20 changes: 10 additions & 10 deletions NAMESPACE
@@ -1,10 +1,10 @@
# Generated by roxygen2: do not edit by hand

export(clusterWiseDEtest)
export(meanLogX)
export(readFromManual)
export(readFromSeurat)
export(runShiny)
import(shiny)
importFrom(scales,alpha)
importFrom(viridis,viridis)
# Generated by roxygen2: do not edit by hand
export(clusterWiseDEtest)
export(meanLogX)
export(readFromManual)
export(readFromSeurat)
export(runShiny)
import(shiny)
importFrom(scales,alpha)
importFrom(viridis,viridis)
6 changes: 4 additions & 2 deletions R/deTest.R
Expand Up @@ -230,8 +230,10 @@ clusterWiseDEtest <- function(il,testAll=TRUE,
deM_dDR <- apply(combos,2,function(i) DR[i[1],] - DR[i[2],])
deM_logGER <- apply(combos,2,function(i) MTC[i[1],] - MTC[i[2],])
deM_genesUsed <- switch(threshType,
dDR=apply(deM_dDR,2,function(X) which(abs(X) > dDRthresh)),
logGER=apply(deM_logGER,2,function(X) which(abs(X) > logGERthresh)))
dDR=sapply(colnames(combos),function(X)
which(abs(deM_dDR[,X]) > dDRthresh),simplify=F),
logGER=sapply(colnames(combos),function(X)
which(abs(deM_logGER[,X]) > logGERthresh),simplify=F))
if (any(sapply(deM_genesUsed,length) < 1)) {
stop("Gene filtering threshold is set too high.")
}
Expand Down
10 changes: 8 additions & 2 deletions R/importData.R
Expand Up @@ -76,13 +76,16 @@ readFromSeurat <- function(inD) {
out <- list()
out[["nge"]] <- inD@data

out[["md"]] <- inD@meta.data[,!grepl("res\\.[0-9]",colnames(inD@meta.data))]
out[["md"]] <- inD@meta.data[,!grepl("res\\.[0-9]",colnames(inD@meta.data))]
for (X in which(sapply(out[["md"]],is.character))) {
out[["md"]][[X]] <- as.factor(out[["md"]][[X]])
}
# metadata for cells (dataframe of cells), not including cluster assignments.

if (is.data.frame(inD@meta.data[,grepl("res\\.[0-9]",colnames(inD@meta.data))])) {
cl <- data.frame(lapply(inD@meta.data[,grepl("res\\.[0-9]",colnames(inD@meta.data))],as.factor))
} else {
cl <- data.frame(inD@meta.data[,grepl("res\\.[0-9]",colnames(inD@meta.data))])
cl <- data.frame(inD@meta.data[,grepl("res\\.[0-9]",colnames(inD@meta.data))],stringsAsFactors=T)
colnames(cl) <- grep("res\\.[0-9]",colnames(inD@meta.data),value=T)
}
rownames(cl) <- rownames(inD@meta.data)
Expand Down Expand Up @@ -177,6 +180,9 @@ readFromManual <- function(nge,md,cl,dr_clust,dr_viz) {
out <- list()
out[["nge"]] <- nge
out[["md"]] <- md
for (X in which(sapply(out[["md"]],is.character))) {
out[["md"]][[X]] <- as.factor(out[["md"]][[X]])
}
if (!all(sapply(cl,is.factor))) {
temp_cells <- rownames(cl)
cl <- data.frame(lapply(cl,as.factor))
Expand Down
334 changes: 167 additions & 167 deletions man/clusterWiseDEtest.Rd

Large diffs are not rendered by default.

74 changes: 37 additions & 37 deletions man/meanLogX.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions man/rainbow2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

162 changes: 81 additions & 81 deletions man/readFromManual.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0c1229d

Please sign in to comment.