From 415028b673e36c0f88e3b0f56cbd88944cefa4d3 Mon Sep 17 00:00:00 2001 From: ismailelshimy <102971147+ismailelshimy@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:12:57 +0100 Subject: [PATCH 1/2] Update branchPropTest.R it is important to arrange the samples in the branch cell proportions matrix such that they have the same order as the order of samples in the design data frame before running a t-test. --- R/branchPropTest.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } From 928b4cc53292f07480f5b775605dc01a3eeee63c Mon Sep 17 00:00:00 2001 From: ismailelshimy <102971147+ismailelshimy@users.noreply.github.com> Date: Fri, 2 Feb 2024 13:00:39 +0100 Subject: [PATCH 2/2] Update getPopulationFit.R It is important to set the default num.time point in the getPopulationFit() function to the maximum of the pseudotime vector, otherwise running plotGene function downstream would result in subscript out of bounds error. --- R/getPopulationFit.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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