zhangyuqing / ComBat-seq

Batch effect adjustment based on negative binomial regression for RNA sequencing count data
154 stars 39 forks source link

Error in phi_matrix #6

Closed JOUNGCHANGYOUNG closed 3 years ago

JOUNGCHANGYOUNG commented 4 years ago

Hi. I tried to use the code in the tutorial (contents 8 of "The SVA package for moving batch effects and other desired variants in high-throughput experiences"), the ComBat_seq function was not defined. So, I defined ComBat_seq function using ComBat-seq/ComBat_seq.R in github.

However, the following error occurred:

" adjusted <- ComBat_seq(count_matrix, batch=batch, group=NULL) Found 2 batches Using null model in ComBat-seq. Adjusting for 0 covariate(s) or covariate level(s) Estimating dispersions

Error in phi_matrix[, batches_ind[[k]]] <- vec2mat(genewise_disp_lst[[k]], : number of items to replace is not a multiple of replacement length In addition: Warning message: In result[lower.tri(result, diag = FALSE)] <- data : number of items to replace is not a multiple of replacement length"

Can you check this problem?

zhangyuqing commented 4 years ago

Hi @JOUNGCHANGYOUNG, please update edgeR version to at least 3.22.1.

JOUNGCHANGYOUNG commented 4 years ago

My edgeR version is already 3.28.1. I reinstalled edgeR, but the same error still occured.

zhangyuqing commented 4 years ago

@JOUNGCHANGYOUNG I see, interesting... Would you share your data with me at zhangyuqing.pkusms@gmail.com? If it is not plausible to share the data, would you provide as much information as possible for your data (sample size, how many batches you have, how many subjects in each batch, study design, preprocessing steps, etc)? Thanks.

YiyanYang0728 commented 4 years ago

I encounted with the same question. Is there any solution now? Thanks

jialuw commented 3 years ago

Same issue here.

YiyanYang0728 commented 3 years ago

Hey guys, I have solved this problem by using devtools:

install.packages("devtools")
devtools::install_github("zhangyuqing/sva-devel")

I guess there maybe some implicit dependent packages we missed by using this function directly. Hope it works for you too!