-
Notifications
You must be signed in to change notification settings - Fork 9
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
Different RightTrimFraction settings give same p values #32
Comments
Yeah sorry, that was just a typo in my original post, not reflective of my code. I updated my post with the correct codes. Same result. |
Can you also add for each model:
## $ FSTbar :
## $ FSTNoCorrbar :
## $ dfInferred :
## $ numberLowFstOutliers :
## $ numberHighFstOutliers:
…________________________________
From: Lotterhos, Katie ***@***.***>
Sent: 02 March 2023 16:11
To: whitlock/OutFLANK ***@***.***>
Subject: Re: [whitlock/OutFLANK] Different RightTrimFraction settings give same p values (Issue #32)
Thanks. Can you add a histogram of the distribution of FST values, and add the OutFLANKResultsPlotter histograms for each of the models.
________________________________
From: dmacguigan ***@***.***>
Sent: 02 March 2023 13:55
To: whitlock/OutFLANK ***@***.***>
Cc: Lotterhos, Katie ***@***.***>; Comment ***@***.***>
Subject: Re: [whitlock/OutFLANK] Different RightTrimFraction settings give same p values (Issue #32)
Yeah sorry, that was just a typo in my original post, not reflective of my code. I updated my post with the correct codes. Same result.
—
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwhitlock%2FOutFLANK%2Fissues%2F32%23issuecomment-1452393719&data=05%7C01%7Ck.lotterhos%40northeastern.edu%7Cc8a7ad6a71be45798c6d08db1b4fa58e%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C638133801119183497%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DMiLosQYXEYGaG%2Bsh9E2MqM%2BxRlMcYDzDg0OoAVEQCA%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABUNI3N7D2DQBDTNCG3DSX3W2DUI3ANCNFSM6AAAAAAVMTY5OI&data=05%7C01%7Ck.lotterhos%40northeastern.edu%7Cc8a7ad6a71be45798c6d08db1b4fa58e%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C638133801119183497%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oaMZ%2BjsE0MLWQcrc1P1DWX6wfQU9eRA09SXg8f1eC2k%3D&reserved=0>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Sure thing. Histogram of corrected Fst
First, the model with the default trim values, 0.05 for right and left.
Now the model with left trim = 0.75. We can see that the inferred Fst distribution has changed.
And lastly, the model with right trim = 0.75. The inferred Fst distribution does not appear different from the default model, at least by eye.
|
Although OutFLANK removes the RightTrimFraction for the initial estimate of the degrees of freedom, it then uses that initial estimate of the degrees of freedom to remove outliers and re-estimates the degrees of freedom. So, if the outliers that OutFLANK removes in this iterative process are the same as what you ask it to remove in the RightTrimFraction, you can get the same results for different RightTrimFraction.
Here, I think part of the reason this is happening is because you only have 2 populations in the data, so the maximum likelihood estimator is driven by information at the left side of the distribution.
You can test this by running your code through the OutFLANK function line-by-line and seeing if there is any unexpected behavior:
https://github.com/whitlock/OutFLANK/blob/master/R/OutFLANK.R
In any case, it looks like you get a good fit to the chi-square distribution with the default parameters.
________________________________
From: dmacguigan ***@***.***>
Sent: 03 March 2023 10:21
To: whitlock/OutFLANK ***@***.***>
Cc: Lotterhos, Katie ***@***.***>; Comment ***@***.***>
Subject: Re: [whitlock/OutFLANK] Different RightTrimFraction settings give same p values (Issue #32)
Sure thing. Histogram of corrected Fst
hist(outflank_dat$FST)
[Rplot]<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F8762055%2F222754496-155b134d-bb09-4e78-8557-37d3148bdcee.png&data=05%7C01%7Ck.lotterhos%40northeastern.edu%7C350409eeda7e40c69e7f08db1bfaf580%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C638134536901004697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ivjLVNk8VkFjEYrAQSTkrkN%2FQWd2E%2FfROQ9l40HTdPw%3D&reserved=0>
First, the model with the default trim values, 0.05 for right and left.
outflank_results <- OutFLANK(FstDataFrame = outflank_dat,
LeftTrimFraction=0.05,
RightTrimFraction=0.05,
Hmin=0.1,
NumberOfSamples=2,
qthreshold=0.05)
outflank_results$FSTbar
[1] 0.1917848
outflank_results$FSTNoCorrbar
[1] 0.2038839
outflank_results$dfInferred
[1] 2
outflank_results$numberLowFstOutliers
[1] 0
outflank_results$numberHighFstOutliers
[1] 0
OutFLANKResultsPlotter(outflank_results, withOutliers = TRUE,
NoCorr = TRUE, Hmin = 0.1, binwidth = 0.005, Zoom = FALSE,
RightZoomFraction = 0.05, titletext = NULL)
[Rplot01]<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F8762055%2F222754856-37365ae9-d0ec-4582-9805-185f61e1d0b2.png&data=05%7C01%7Ck.lotterhos%40northeastern.edu%7C350409eeda7e40c69e7f08db1bfaf580%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C638134536901004697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PYbD0z9yalmpY0XcB9Ais3eD%2FljaIJBYsoapX9G1esQ%3D&reserved=0>
Now the model with left trim = 0.75. We can see that the inferred Fst distribution has changed.
outflank_results <- OutFLANK(FstDataFrame = outflank_dat,
LeftTrimFraction=0.75,
RightTrimFraction=0.05,
Hmin=0.1,
NumberOfSamples=2,
qthreshold=0.05)
outflank_results$FSTbar
[1] 0.1917848
outflank_results$FSTNoCorrbar
[1] 0.2038839
outflank_results$dfInferred
[1] 3.466949
outflank_results$numberLowFstOutliers
[1] 0
outflank_results$numberHighFstOutliers
[1] 0
OutFLANKResultsPlotter(outflank_results, withOutliers = TRUE,
NoCorr = TRUE, Hmin = 0.1, binwidth = 0.005, Zoom = FALSE,
RightZoomFraction = 0.05, titletext = NULL)
[Rplot02]<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F8762055%2F222757216-a1ec31d8-bbd3-4918-9cd1-fe89422f79fd.png&data=05%7C01%7Ck.lotterhos%40northeastern.edu%7C350409eeda7e40c69e7f08db1bfaf580%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C638134536901004697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1y75zCRDrgHCqiIoRJuVC528t%2BjxFqBd%2FCLwwoshfAQ%3D&reserved=0>
And lastly, the model with right trim = 0.75. The inferred Fst distribution does not appear different from the default model, at least by eye.
outflank_results <- OutFLANK(FstDataFrame = outflank_dat,
LeftTrimFraction=0.05,
RightTrimFraction=0.75,
Hmin=0.1,
NumberOfSamples=2,
qthreshold=0.05)
outflank_results$FSTbar
[1] 0.1917848
outflank_results$FSTNoCorrbar
[1] 0.2038839
outflank_results$dfInferred
[1] 2
outflank_results$numberLowFstOutliers
[1] 0
outflank_results$numberHighFstOutliers
[1] 0
OutFLANKResultsPlotter(outflank_results, withOutliers = TRUE,
NoCorr = TRUE, Hmin = 0.1, binwidth = 0.005, Zoom = FALSE,
RightZoomFraction = 0.05, titletext = NULL)
[Rplot03]<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F8762055%2F222757801-b12deb60-caf9-41cb-93b4-8b3c82cbfe79.png&data=05%7C01%7Ck.lotterhos%40northeastern.edu%7C350409eeda7e40c69e7f08db1bfaf580%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C638134536901004697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3jD%2FS3Q6RTSuZcT2omomvidOqUBthUGFOyLjJN9UGb4%3D&reserved=0>
—
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwhitlock%2FOutFLANK%2Fissues%2F32%23issuecomment-1453690627&data=05%7C01%7Ck.lotterhos%40northeastern.edu%7C350409eeda7e40c69e7f08db1bfaf580%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C638134536901004697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xrGqMA5%2BR8Yds0vihAItRMeDEit8Rl%2Bvf2VOsLIhizU%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABUNI3MXSCT645Y2C53RFM3W2ID7PANCNFSM6AAAAAAVMTY5OI&data=05%7C01%7Ck.lotterhos%40northeastern.edu%7C350409eeda7e40c69e7f08db1bfaf580%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C638134536901004697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VORuJd4VQRPnrAfsFpwObgafeGdY74PvQbohyiLxYf4%3D&reserved=0>.
You are receiving this because you commented.Message ID: ***@***.***>
|
If I understand correctly, modifying the
RightTrimFraction
orLeftTrimFraction
parameters of theOutFLANK
function changes the Fst values used to estimate the Fst distribution. Since the Fst distribution is different, we should expect different p-values.When I change the
LeftTrimFraction
parameter, the right-tailed p-values are different.However, when I change the
RightTrimFraction
parameter, the resulting p-values are identical.I have attached my data (outflank_dat) if you would like to try replicating these results.
outflank_dat.txt
Do you have any thoughts on why this is happening? I would like to adjust my
RightTrimFraction
parameter because I suspect there are many loci under selection in my dataset. But at the moment, adjusting that parameter has no effect.The text was updated successfully, but these errors were encountered: