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

Ensure p-values are numeric before sorting #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Ensure p-values are numeric before sorting #2

wants to merge 1 commit into from

Conversation

ryananeff
Copy link

@ryananeff ryananeff commented Apr 11, 2018

The p variable may at some point become a list of character strings that when sorted, do not sort properly due to the number of digits in the p-value. For instance, a p-value of 0.999984 would be sorted as being larger than 0.9999864 even though it's numeric value is smaller.

I believe this has the effect of increasing the q-values from the qvalue function because the list is no longer in order, so larger q-values may sometimes be treated as being smaller. This will then decrease the number of significant associations output by WGCNA.

Therefore, either ensure that the p-values are numeric before sorting or cast it to a numeric type.

The p variable at some point became a list of character strings that when sorted, do not sort properly due to the number of digits in the p-value. For instance, a p-value of 0.999984 would be sorted as being larger than 0.9999864 even though it's numeric value is smaller. 

I believe this has the effect of increasing the q-values from the qvalue function because the list is no longer in order, so larger q-values may sometimes be treated as being smaller. This will then decrease the number of significant associations output by WGCNA.
@ryananeff ryananeff changed the title Treat p-values as numeric before sorting Ensure p-values are numeric before sorting Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant