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

How to calculate pvalue, FDR and IncLevelDifference #349

Open
lsh74 opened this issue Dec 22, 2023 · 1 comment
Open

How to calculate pvalue, FDR and IncLevelDifference #349

lsh74 opened this issue Dec 22, 2023 · 1 comment

Comments

@lsh74
Copy link

lsh74 commented Dec 22, 2023

Hello, I feel very confused after reading the source code. If I have two groups of samples, and the PSI value of each sample forms a count matrix, how can I calculate the three values of pvalue, FDR and IncLevelDifference? It would be great if you could help me solve the problem

@EricKutschera
Copy link
Contributor

The PSI values (IncLevel1, IncLevel2) are calculated based on the read counts (IJC_SAMPLE_1, SJC_SAMPLE_1, IJC_SAMPLE_2, SJC_SAMPLE_2) and the effective lengths for the event (IncFormLen, SkipFormLen). Here's the code to calculate a PSI value: https://github.com/Xinglab/rmats-turbo/blob/v4.2.0/rMATS_P/inclusion_level.py#L24

That code is essentially: (IJC_SAMPLE_1/IncFormLen) / ((IJC_SAMPLE_1/IncFormLen) + (SJC_SAMPLE_1/SkipFormLen))

IncLevelDifference is average(IncLevel1) - average(IncLevel2). Here's the code: https://github.com/Xinglab/rmats-turbo/blob/v4.2.0/rMATS_P/inclusion_level.py#L65

The code for calculating the PValue is here https://github.com/Xinglab/rmats-turbo/blob/v4.2.0/rMATS_C/src/myfunc.c#L462

The details are described in the supporting information file of http://dx.doi.org/10.1073/pnas.1419161111, but the code implements a likelihood-ratio test for the difference in PSI value between the two groups exceeding some threshold

Here's the code for calculating the FDR from the list of PValues: https://github.com/Xinglab/rmats-turbo/blob/v4.2.0/rMATS_P/FDR.py

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

No branches or pull requests

2 participants