Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when running runDESeq if both condition.a and condition.b contain more than 1 groups #23

Open
lixin4306ren opened this issue Dec 15, 2018 · 1 comment

Comments

@lixin4306ren
Copy link

lixin4306ren commented Dec 15, 2018

Hi, after running runCORE, I got 4 clusters for the sample. Then I used runDESeq to identify DE genes between cluter1,3 and cluster2,4 with the following command.

cluster1_3_vs_2_4 <- runDESeq(scran_normalised, group = "cluster", condition.a = c("1","3"), condition.b = c("2", "4"), ngenes = 5000, fitType = "local", method = "per-condition")

got error information as

Loading required package: dynamicTreeCut
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: lattice
    Welcome to 'DESeq'. For improved performance, usability and
    functionality, please consider migrating to 'DESeq2'.
[1] "Identifying genes to retain..."
[1] "Running DESeq..."
  |=======                                                               |  10%
Error: BiocParallel errors
  element index: 1, 2, 3, 4, 5, 6, ...
  first error: fewer than one row in the data
library(BiocParallel)
Execution halted

After checked the code of function runDESeq, I found one suspicious part which might be a bug. I think the third line in following in code, the condition.b should be changed to 'condition.a'. Otherwise, it will overwrite the original condition.b, and then make the actual comparison between condition.a itself and cause the error.

    if (length(condition.a) > 1) {
        reformatted <- reformatCondition(condition.a, condition_list = condition_list)
        condition.b <- reformatted$condition
        condition_list <- reformatted$condition_list
    }
    else {
        replace_idx <- which(condition_list %in% condition.a)
        condition.a <- as.character(condition.a)
        condition_list[replace_idx] <- condition.a
    }
    if (length(condition.b > 1)) {
        reformatted <- reformatCondition(condition.b, condition_list = condition_list)
        condition.b <- reformatted$condition
        condition_list <- reformatted$condition_list
    }
    else {
        replace_idx <- which(condition_list %in% condition.b)
        condition.b <- as.character(condition.b)
        condition_list[replace_idx] <- condition.b
    }
@asenabouth
Copy link
Collaborator

Hi @lixin4306ren ,

Nice catch! I'll add a fix for the next update.

Thanks,
Anne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants