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

Contrast-FEL results interpretation in hyphy #1780

Open
geofrunz opened this issue Dec 22, 2024 · 3 comments
Open

Contrast-FEL results interpretation in hyphy #1780

geofrunz opened this issue Dec 22, 2024 · 3 comments

Comments

@geofrunz
Copy link

geofrunz commented Dec 22, 2024

Dear all,

Sorry for the basic question. I am trying to use Contrast-FEL in HyPhy for better annotation of the tree branches. However, when I get the results, I cannot figure out in which dataset beta is greater.

I tried using the reference dataset provided in https://hyphy.org/methods/other/contrast-fel/, and while the values match, in the local version the larger values are always reported in the right-hand column, regardless of whether they refer to the test or reference dataset.
image
this is different compared to the table provided in the tutorial (https://hyphy.org/methods/other/contrast-fel/)
Is there a way to clarify this?
I'm using HYPHY 2.5.64(MP)
Thank you in advance!

@spond
Copy link
Member

spond commented Jan 9, 2025

Dear @geofrunz,

Sorry for the delay is responding. As you've discovered, the documentation page is rather old, and no longer matches what the contrast-fel implementation prints out.

When you run the 'overall' test, e.g., a branch-set vs the rest of the tree, beta values will be sorted numerically. The reason for this is that if you have more than two branch groups, there will be more than two beta values. For example:

hyphy contrast-fel --alignment tests/hbltests/libv3/data/CD2.nex --branch-set GROUP1 --branch-set GROUP2 --branch-set GROUP3 

....

| Codon  |     alpha      |             beta             |        substitutions         |                  test                  |LRT p-value|Permutation p-value|
|:------:|:--------------:|:----------------------------:|:----------------------------:|:--------------------------------------:|:---------:|:-----------------:|
|   29   |        0.000   |       13.670 :      0.000    |             5, 0             |            GROUP2 vs GROUP3            |  0.0373   |      0.5000       |
|   67   |        0.679   |        0.000 -     11.603    |           0, 0, 2            |                overall                 |  0.0273   |      1.0000       |
|   67   |        0.679   |        0.000 :      0.000    |             0, 2             |            GROUP2 vs GROUP3            |  0.0095   |      1.0000       |
|   79   |        0.000   |      505.054 :      0.000    |             5, 0             |            GROUP2 vs GROUP3            |  0.0316   |      0.0588       |
|  145   |        0.754   |       11.546 :      0.000    |             4, 0             |            GROUP2 vs GROUP3            |  0.0414   |      1.0000       |
|  176   |       98.860   |        3.381 :     20.022    |             3, 0             |            GROUP2 vs GROUP3            |  0.0055   |      1.0000       |

...

When two specific groups are being compared, their order is reported and the beta values are in the same order (e.g. GROUP2 then GROUP3).

For the example from the documentation,

 hyphy contrast-fel --alignment /Users/sergei/Downloads/HIVtransmission.nex --branch-set SOURCE

If you look at the json file generated by contrast-fel, you will be able to pull the estimates from the following fields

image

Which tell you how to interpert the values in the following record.

image

For example at codon 4

alpha = 0.5351902730936974,
beta (SOURCE) = 4.274275168505837e-05
beta (background) =  22.57461519170956,
subs (SOURCE) = 0
P-value (overall) = 0.07220085398256504
q-value (overall) = 1
Permutation p-value = -1 (not run)
Total branch length = 0.3824319484135117

Hope this helps,
Sergei

@geofrunz
Copy link
Author

geofrunz commented Jan 9, 2025

Dear Sergei,

Thank you so much for your reply!

Now I understand! I used Vision.hyphy to visualize the JSON file, and I assume I get the same results — the foreground beta and background beta values in the appropriate columns, correct? I just marked the foreground branches.

Thank you so much again.

Very best regards,
Geofrunz

@spond
Copy link
Member

spond commented Jan 9, 2025

Dear @geofrunz,

That's correct. You should be able to see a breakdown by branch-set in vision.

Best,
Sergei

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