JoeThorntonLab / MNM_SelectionTests

Tests of selection incorporating multinucleotide mutations
5 stars 3 forks source link

Issue with BranchSites_MNMSimulations_null.bf and Likelihood value #1

Open Anh-Thu-Weber opened 6 years ago

Anh-Thu-Weber commented 6 years ago

Hi,

I read your paper with interest and would like to use your new model for my data. I am testing your custom batch files using your example alignment, but I ran into a few issues.

1) issue with simulations: I tried to simulate data using BranchSites_MNMSimulations_null.bf, but I got an error: Error:Variable characters has not been defined in Simulate. I attached the messages_simulate_data.log.txt in case it helps. I checked the simulate function and it is true that characters is not defined. Is there a definition line missing?

2) trouble finding the likelihood values: Then I ran the three other batch files (null, alt, k2) on the example file and they ran fine without an error message. Yet, I cannot find the likelihood value in the output files that would allow me to compare the models; it should be coded lf right? Could you help me finding the likelihood values? I attached the three output files in case it helps.

Let me know if you need additional files, and thank you in advance!

Cheers,

Alexandra

knownGene.uc001hmo.1.1.testHyPhyBS_alt.txt knownGene.uc001hmo.1.1.testHyPhyBS_K2.txt knownGene.uc001hmo.1.1.testHyPhyBS_null.txt messages_simulate_data.log.txt

aartivnkt commented 6 years ago

Hi, Thanks for your interest with the models. Here are some pointers to your issues:

1) Which version of hyphy are you running? The simulate function is defined in the hyphy/res/TemplateBatchFiles/simulate.bf batch file. Please check it is available, and that you are able to run/call that function using the right version of hyphy correctly.

2) The likelihood values are output in the line that says "mles". So you will see mles outputs two rows of values, each enclosed by a {}. The likelihood is the first field in the second row (eg:-4379.2842 in the *null.txt file ).

Hope this helps!

Anh-Thu-Weber commented 6 years ago

Hi, Thanks for your answer! I am running HyPhy 2.3.13-foss-2016b, and indeed I cannot find the batchfile simulate.bf in TemplateBatchFiles, I'll install the latest version and let you know if I still have issues

Thank for pointing the likelihood values!

Cheers,

Alexandra

Anh-Thu-Weber commented 6 years ago

Hi again,

I realized that I dowloaded the latest version of HyPhy, is there another way to access the file simulate.bf?

Also, I ran the null & alt models on one of the gene I'm exploring, and strangely I am getting the exact same value for the likelihood, is it possible? I also cannot find the omega_2 estimate in the alt outfile, but it was present in the alt outfile for the example file (knownGene.uc001hmo.1.1.testHyPhyBS_alt.txt)

I also tried some other genes and I got sometimes the exact same estimate for global_delta and global_kappa_inv (not the case in the tcp1 gene here attached); is that possible too? or am I missing something?

I attached the alignement file, two bf files and two output files in case it helps

thank you for your help!

BranchSites_delta_alt_path_edited_test.bf.txt BranchSites_delta_null_path_edited_test.bf.txt tcp1_Amphiuridae.hyphy.txt tcp1_Amphiuridae.hyphy_alt.txt tcp1_Amphiuridae.hyphy_null.txt

aartivnkt commented 6 years ago

Hi! Thanks for your interest with these models!

In our paper we've used hyphy 2.2.6 -- that's the version that has the simulate.bf function in TemplateBatchFiles. You would need to use this version to get the simulate function. Could you try to download this version from the hyphy website? If not, I could send the file to you to add in the templatebatchfiles dir, perhaps over email if that works?

I looked at your alt file, and there's a line that specifies the foreground branch that needs to be edited -- specifically, this line:

ExecuteCommands ("givenTree."+"hg18"+".nonSynRate:=omega_FG*givenTree."+"hg18"+".synRate;");

refers to the hg18, or human branch in the example alignment file. Please change "hg18" to whatever foreground branch you are interested in to estimate omega_2. This could be a reason why you got the same exact likelihood (although it could happen for reasons unrelated to this, and model convergence).

Hope this helps!

Anh-Thu-Weber commented 6 years ago

Hi, Thanks for your answer! I cannot download earlier versions of HyPhy, could you send me the simulate.bf file? I think you can attach the file here, otherwise my email is: aweber@museum.vic.gov.au

Also, I specified the foreground branch in the alt model and it worked, the likelihoods of null & alt are different This might be a naive question but shouldn't we also specificy the foreground branch in the null model? Finally, is it possible to specify several foreground branches at the same time in a single analysis, or should I run one analysis per foreground branch?

Thanks again!