Use of pmax(na.rm =TRUE) in addPeak2GeneLinks #1522
RegnerM2015
started this conversation in
General
Replies: 1 comment 3 replies
-
Hi @RegnerM2015, I think the base idea of it was to make sure that the TStat is 0 for a correlation of 0 instead of NaN for computing the Pvalues and FDR. If you have an NA correlation you should still get NA because its in the numerator. I just did it in this manner to be safe in some sense. rowCorCpp shouldnt give NA correlations unless there are NA's in the input to my understanding. I guess the na.rm=TRUE doesnt do anything I am just exceedingly paranoid about NA's creating unwanted bugs...
Please let me know if that helps or if I am mistaken! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @rcorces,
I wanted to better understand the logic for using the pmax function in the code below for
addPeak2GeneLinks
:To my understanding, pmax with na.rm = TRUE is used to remove potential NaNs from the output of
rowCorCpp
, is this correct?Can we interpret NaNs from
rowCorCpp
as low correlations? Or should users not interpret NaN correlations at all? Based on the pmax code above, it seems like the T statistic and P-value are still calculated for NaN correlations by swapping in a value of 0.00000000000000001.Alternatively, could users just ignore the NaN correlations or remove them from the analysis all together?
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions