egr95 / R-codacore

An R package for learning log-ratio biomarkers from high-throughput sequencing data.
Other
21 stars 3 forks source link

Question regarding the decision between putting taxa to numerator or denominator #17

Closed adriaaula closed 1 year ago

adriaaula commented 1 year ago

Hi @egr95 ,

Thanks for the package, it works like a charm and it is fast even with big data.

I have a question regarding the construction of the ratios. We are comparing the ratios between multiple genes. These genes should present a similar distribution between them, given that they are housekeeping genes and the basal expression should be pretty similar. For each gene I have ~410 samples, and I am comparing around 300 genes.

What we realized is that in some cases, for a gene the ratio with the maximum predictive power was taxaA / taxaB, whereas for others the ratio was the contrary, taxaB / taxaA. The ratios are predicted on the basis of explanatory power against the CLR of the sample, as explained in the guideline.

We thought that this makes sense since the decision behind choosing a taxon as denominator and as a numerator does not change much except from the sign.

Is that a normal behaviour? We calculate afterwards the similarity between the ratios, and it is important to us to determine if we only have to compare numerators with numerators or if else we can treat both num and denominator as the same set.

egr95 commented 1 year ago

Hi @adriaaula,

You're very welcome! Indeed, when comparing similarity between the ratios, I would typically compare across the entire set, not just the numerator/denominator sets in isolation. However, as you correctly noted, the logratio log(taxaA/taxaB) is simply the negative of log(taxaB/taxaA), so if the logratio is flipped this means the effect found by Codacore is in the opposite direction (assuming the sign of the regression coefficient stayed the same). In other words, it is the same taxa that explain the response variable, but the mechanism is somehow inverted. Depending on the application, such a result may warrant further investigation.

adriaaula commented 1 year ago

I never closed the issue! Thanks for everything :)