diff --git a/R/branchPropTest.R b/R/branchPropTest.R index 8a48631..a4dcc91 100644 --- a/R/branchPropTest.R +++ b/R/branchPropTest.R @@ -15,7 +15,7 @@ branchPropTest <- function(data, design, method = 't.test') { if (method == 't.test'){ id1 = which(design[, 2] == 0) id2 = which(design[, 2] == 1) - res <- apply(data, 1, function(i) + res <- apply(data[,design[,1]], 1, function(i) t.test(i[id1], i[id2])$p.value) } diff --git a/R/cellPropTest.R b/R/cellPropTest.R index e9e74f4..60f594c 100644 --- a/R/cellPropTest.R +++ b/R/cellPropTest.R @@ -21,6 +21,7 @@ cellPropTest <- function(cellanno, design = NULL, ncores = detectCores(), test.type = 'variable', + permuiter = 100, testvar = 2) { ptw <- cut(pseudotime, seq(min(pseudotime), max(pseudotime), length.out = 100), include.lowest = T) @@ -54,6 +55,7 @@ cellPropTest <- function(cellanno, ncores = ncores, test.type = test.type, test.method = 'permutation', + permuiter = permuiter, ncores.fit = 1, fix.all.zero = F ) diff --git a/R/getPopulationFit.R b/R/getPopulationFit.R index da10f4d..5dc26d9 100644 --- a/R/getPopulationFit.R +++ b/R/getPopulationFit.R @@ -17,7 +17,7 @@ getPopulationFit <- function(testobj, gene = NULL, type = 'time', - num.timepoint = 1e3){ + num.timepoint = max(testobj$pseudotime)){ type <- toupper(type) if (!'testvar' %in% names(testobj)) { testvar <- testobj$testvar <- 2