zhangyuqing / ComBat-seq

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

The covariates are confounded #42

Open SimonSchlumbohm opened 3 months ago

SimonSchlumbohm commented 3 months ago

Dear @zhangyuqing , creator of ComBat-seq,

for experimental reasons, I was trying to run ComBat-seq on only two batches of the GFRN dataset you provided. I cropped the matrix accordingly (99 % sure it is not the issue). Everything works perfectly as long as I do not use the 'group' parameter. I made sure only to use the correct labels here. See my batch and group input:

batch <- as.integer(c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2))

group <- factor(c("gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "her2", "her2", "her2", "her2", "her2", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "egfr", "egfr", "egfr", "egfr", "egfr", "egfr", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "gfp", "kraswt", "kraswt", "kraswt", "kraswt", "kraswt", "kraswt", "kraswt", "kraswt", "kraswt"))

Both have the same length of 29, which matches with my amount of samples/columns in the count dataset (attached). main1_2.csv

Be aware that I am a programmer myself and doublechecked everything to be correct. Everything should work, yet I get the following error: The covariates are confounded! Please remove one or more of the covariates so the design is not confounded

Is there any hidden restriction on the covariates (groups) I use? With all three batches and respective metadata it works fine on the full GFRN dataset. In my example above, Batch 1 contains gfp and her2 and Batch 2 contains gfp and kraswt.

I do need your input on this, I believe.

Thank you in advance!

Simon Schlumbohm

Joyjoyjoyc commented 1 month ago

Hi, did you figure it out? I have the same question now. Really appreciate for your reply.

SimonSchlumbohm commented 1 month ago

@Joyjoyjoyc Unfortunately not. To have the input running properly, I assume a necessity of covariate-existence in every batch. I have posted the same question on the ComBat-seq Bioconductor release with no answer yet...

Joyjoyjoyc commented 1 month ago

Yes,I guess so. As I input data with a covariate-existence in every batch, it does work. Thank you so much!

---- Replied Message ---- | From | @.> | | Date | 05/15/2024 18:44 | | To | zhangyuqing/ComBat-seq @.> | | Cc | Joyjoyjoyc @.>, Mention @.> | | Subject | Re: [zhangyuqing/ComBat-seq] The covariates are confounded (Issue #42) |

@Joyjoyjoyc Unfortunately not. To have the input running properly, I assume a necessity of covariate-existence in every batch. I have posted the same question on the ComBat-seq Bioconductor release with no answer yet...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>