ANCOMBC analysis Pairwise comparison

I've been trying to get the ancombc2 to run for me, i am new to using ancombc. I have 3 study groups that i would like to compare with pairwise but I keep running into an error:
Error in names(x) <- value :
'names' attribute [3] must be the same length as the vector [2]

the pairwise works fine if it have pseudo_sense = FALSE but once im setting it to TRUE, it doesnt work anymore.
I used debug to see where the error occurs and found its from this line:
colnames(ss_flag_pair) = pair_col_name and they do indeed not match up, however, i have no idea how to fix this issue.
the ss_flag_pair only contains two of the studyarms, whereas pair_col_name has all three. when i looked at how they are both made, it seems that its only the 2 study arms as the it is the refernce group, but im not sure if thats the right conclusion/reason.

output_pw1 <- ancombc2( data = ancom_phyl, tax_level = "Species", fix_formula = "studyarm", group = "studyarm", p_adj_method = "BH", pseudo_sens = TRUE, prv_cut = 0.10, struc_zero = TRUE, neg_lb = FALSE, global = TRUE, pairwise = TRUE, mdfdr_control = list(fwer_ctrl_method = "holm", B = 100) )

I would greatly appreciate any insights or suggestions on how to resolve this issue. Thanks in advance for your help!

Hi @Chiara_D,
Because this isn't a question about QIIME 2 specifically, you may or may not get a reply here. We'll leave your post and someone may jump in and help, but you also may wish to contact the developers of the R package that you're using through whatever means they provide for getting technical support.

Good luck!

Hi @Chiara_D,

I experienced a similar error when I used pseudo_sense = TRUE two months ago. The ANCOMBC2 paper was under revision and the developer was updating the code according to reviewer's suggestions. At that moment, they recommeded a fresh ANCOMBC2 installing from GitHub. Maybe, you could try it and also you could check the official GitHub page to check the issues.

Good luck!

1 Like