zhangyuqing / ComBat-seq

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

Error in qr.default(design) : NA/NaN/Inf in foreign function call (arg 1) #25

Open chiwwong opened 3 years ago

chiwwong commented 3 years ago

I encountered the error when I ran the following: ComBat_seq(cts, batch = coldata_filtered$Rep2, group=NULL, covar_mod=cbind(coldata_filtered$Cancer, coldata_filtered$Treatment)) Error in qr.default(design) : NA/NaN/Inf in foreign function call (arg 1)

I did a brief google search and found that it might due to 0 variance rows. I am not sure how to mitigate the error. Thanks!

mvmontag commented 3 years ago

Hi, I had the exact same error as you when I ran my code for ComBat-Seq with a covariate matrix. For me it worked by changing the covar_mod input. What are your coldata_filtered$Cancer and coldata_filtered$Treatment ? It did the trick when changing the input for the covariates to numeric and then combinig them. For example cancer <- as.numeric(factor(coldata_filtered$Cancer))

AleksZakirov commented 1 year ago

Hi, I had the exact same error as you when I ran my code for ComBat-Seq with a covariate matrix. For me it worked by changing the covar_mod input. What are your coldata_filtered$Cancer and coldata_filtered$Treatment ? It did the trick when changing the input for the covariates to numeric and then combinig them. For example cancer <- as.numeric(factor(coldata_filtered$Cancer))

This worked for me! Thanks for posting the answer!

tommyfuu commented 1 year ago

as.numeric(

thanks! but i am still running into the issue... @chiwwong @zhangyuqing if you were able to solve this please let me know!