saezlab / MetaProViz

R-package to perform metabolomics pre-processing, differential metabolite analysis, metabolite clustering and custom visualisations.
https://saezlab.github.io/MetaProViz/
GNU General Public License v3.0
8 stars 0 forks source link

Add t-value to DMA #4

Closed ChristinaSchmidt1 closed 1 year ago

ChristinaSchmidt1 commented 1 year ago
  1. Add t-value column called t.val

T-value is also called t statistics and in DESeq2 it would be called "stat" in the output table.The t-value is similar to a z-score, the z-score is basically a t-value with infinite degrees of freedom. There are slightly different ways to calculate this and one option would be:

DF$stat <- qnorm((1 - DF$p.val / 2)) * sign(DF$Log2FC)

The function qnorm(), aims to find the boundary value of a given an area that determines this area. And sign returns a vector with the signs of the corresponding elements of x (the sign of a real number is 1, 0, or −1 if the number is positive, zero, or negative, respectively).

  1. Rank the DF by the t-val column, and let's not do any additionaly sheets of data selections.
dprymidis commented 1 year ago

I added the t-value and order the output df based on t-value so it goes from: +oo first row, to -oo last row. I thought about ordering with abs(t-value), but it made more sense like this. Also I used the padj for the t-value.

image
ChristinaSchmidt1 commented 1 year ago

Thanks! Could you change it to using the p-value?

As far as I am aware it is standard to not use the adjusted p-value as one really focuses on the indivivual change. And especially for metabolomics the adjusted p-values can be affected a lot by the small amount of features.

dprymidis commented 1 year ago

ok, Done