Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: ancombc no longer works with '*' as the interaction term in the formula #133

Open
lizgehret opened this issue May 31, 2024 · 4 comments

Comments

@lizgehret
Copy link
Member

I initially discovered this while building the 2024.5 docs, but also replicated locally. Within a 2024.5 amplicon environment (on mac OS) the command in PD mice that utilizes ancombc with donor * genotype fails with the following error message:

Error in .data_qc(meta_data = meta_data, formula = formula, group = group,  :
  The following variables specified are not in the meta data: donor*genotype
Calls: ancombc -> .data_qc

This doesn't occur in 2024.2. I need to investigate further, but something seems to have changed with the input handling for ancombc. This error doesn't occur when swapping out '*' for '+' in this particular example.

@lizgehret lizgehret moved this from Backlog to In Analysis in 2024.10 🎃 May 31, 2024
@github-project-automation github-project-automation bot moved this to Backlog in 2024.10 🎃 May 31, 2024
@lizgehret
Copy link
Member Author

Update: this also fails while using the interaction term :

I tested this with the following command (using PD mice dataset):

qiime composition ancombc \
--i-data table.qza \
--m-metadata-file metadata.tsv \
--p-formula 'donor:genotype + donor + genotype' \
--p-reference-levels 'donor::hc_1' 'genotype::wild type' \
--o-differentials diff.qza \
--verbose

This is the error message:

  The following variables specified are not in the meta data: donor:genotype

@lizgehret
Copy link
Member Author

Another update: this appears to be due to the following code change in ancombc:
https://github.com/FrederickHuangLin/ANCOMBC/blob/d402833f7d5ca5033132a0abba63e06674c7b6b1/R/ancombc_prep.R#L132

This change only permits additive interaction terms.

@ebolyen
Copy link
Member

ebolyen commented Jun 3, 2024

# what should happen:
vars = rownames(attr(terms(formula), 'factors'))
# what currently happens:
vars = unlist(strsplit(formula, split = "\\s*\\+\\s*"))

@ebolyen
Copy link
Member

ebolyen commented Jun 3, 2024

It appears to be intentional: FrederickHuangLin/ANCOMBC#141

If I remember correctly, we don't use group because it's naive to the contrast for a given factor and the resulting p-value mask seemed... strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants