Comments (8)
Hi @matthiaswietz,
I understand your concern, but unfortunately, all current differential abundance methods can only handle the difference, not the individual effect size. Here is an illustrative example, consider a simple linear regression with a categorical variable sex
as the only covariate
# Load the data
data("Salaries", package = "car")
# Linear regression model
model <- lm(salary ~ sex, data = Salaries)
summary(model)$coef
The output looks like
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 101002 4809 21.00 2.68e-66
## sexMale 14088 5065 2.78 5.67e-03
where 101002
is the average salary among females, 101002 + 14088
is the average salary among males, and 14088
is the average difference in salary between males and females. ANCOM-BC is able to estimate the difference (14088
in this example unbiasedly), but not able to estimate the intercept term (101002
in this example, or the effect size of fall
in your case) unbiasedly like all other methods.
Hope it makes sense,
Frederick
from ancombc.
Hi @FrederickHuangLin ,
I was looking for info in a related matter and I found this issue. I understand what you say, which is more or less what's in the tutorial, but what it threw me out was the Figure 6a in the ANCOM-BC paper as it shows all possible comparisons between the 3 countries, something that I'm interested, and pretty sure that is closer to what @matthiaswietz was enquiring about. How did you run that?
This is also referred to in Supplementary Tables 2 and 3 for example where you refer to them as "Pairwise tests using ANCOM-BC". Is there a hidden pairwise test option or is it required something else to get there?
Thank you in advance.
from ancombc.
Hi @xvazquezc,
The figure 6a you referred to was generated by applying two-group comparison to different subsets of data, i.e., the subgroup of "MA" and "US", the subgroup of "VEN" and "US", and the subgroup of "MA" and "VEN", respectively.
We understand that this is not the perfect and statistically rigorous way to handle pairwise comparisons, and we have a prototype extension to ANCOM-BC but the updated algorithm has not been fully tested. We put all resources at this moment to develop a correlation methodology and it is about to wrap up. The formal ANCOM-BC extension will come next. Stay tuned!
Best,
Frederick
from ancombc.
Hi @papelypluma,
Yes, you can definitely relevel the groups in R. For example, you can refer to this post.
Best,
Frederick
from ancombc.
Hi Matthias,
Thanks for your interest in ANCOMBC.
I guess the season
variable is a categorical variable with four levels: spring
, summer
, fall
, and winter
, right? In R, the categorical variable will be ordered alphabetically by default, so the levels are: fall
< spring
< summer
< winter
, which means fall
is the reference level.
Therefore, for the outputs you saw, seasonspring
means spring - fall
, seasonsummer
mean summer - fall
, etc. You won't see seasonfall
as it is essentially 0.
res$diff_abn
will give you a hint whether a taxon is differentially abundant (TRUE
) or not (FALSE
). To see whether a taxon abundance is increasing or decreasing, you can go to res$beta
. For example, seasonspring = 0.5
means the average abundance in spring
is exp(0.5)
times more than that of fall
.
Best,
Frederick
from ancombc.
Thanks Frederick for the detailed explanation! Maybe I'm confused now, but how would I convert the output to identify the taxa enriched in fall, if this is "only" the reference level? Eventually, I was hoping to pinpoint the taxa significantly enriched per season, and not only in comparison to fall. Many thanks again!
from ancombc.
Hi @FrederickHuangLin, thanks for sharing this tool. If I may just ask a question in this thread since it's somewhat related. I was wondering if there's a way to re-level the levels of a variable i.e. manually setting the reference level besides the default alphabetical order. Thanks a lot!
Update: One way I can re-level is to change the names of the covariate levels (in the metadata file before generating the phyloseq object) in such a way the first level in the alphabetical arrangement is the reference group.
from ancombc.
Hi @papelypluma,
Yes, you can definitely relevel the groups in R. For example, you can refer to this post.
Best, Frederick
I think the problem is that the formula argument only accepts strings instead of factor levels/designs as input (which is commonly used in similar tools), which makes it incredibly difficult to change reference using the relevel()
command.
It would be great if we can input something like ancombc(.... , formula = ~condition+batch,..)
instead of ancombc(.... , formula = "condition+batch",..)
of course we can do something like
condition = str_replace_all(condition,pattern = "reference_of_interest",replacement = "A")
as @papelypluma said
from ancombc.
Related Issues (20)
- lmer error: function not provided by package 'Matrix' HOT 2
- Changed reference group - different p value
- higher level test: duplicate taxa HOT 1
- Pairwise Issue pseudo_sens :
- Error in `[.data.frame`(ss_flag, fix_eff) : undefined columns selected
- ancombc2 output fmt length exceeds maximal format length 8192
- Models used for DA and binomial outcomes
- Additive log-ratio on counts vs proportions
- ANCOM_BC2's Global test approach?
- passed_ss_ not found HOT 2
- R session aborted while running ANCOMBC2 HOT 2
- Interpreting negative lfc values for "intercept" in primary result
- Installing ANCOMBC HOT 2
- Continuous variable as main variable of interest
- Different results with ancombc2 depending on the order of the taxa
- Visualization the output of ancombc2
- Pseudo-count sensitivity testing when no pseudo-counts are added
- Error in { : task 1 failed - "values must be length 1, but FUN(X[[2]]) result is length 0"
- Help with ancombc2 analysis with repeated measures
- Extract normalised counts for linear models outside of ANCOMBC?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ancombc.