ComBat-seq icon indicating copy to clipboard operation
ComBat-seq copied to clipboard

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

Open chiwwong opened this issue 4 years ago • 3 comments

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!

chiwwong avatar Jun 07 '21 21:06 chiwwong

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))

mvmontag avatar Jun 09 '21 12:06 mvmontag

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!

AleksZakirov avatar Jan 28 '23 22:01 AleksZakirov

as.numeric(

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

tommyfuu avatar Jul 06 '23 21:07 tommyfuu