{"action":"created","issue":{"url":"https://api.github.com/repos/veg/hyphy/issues/303","labels_url":"https://api.github.com/repos/veg/hyphy/issues/303/labels{/name}","comments_url":"https://api.github.com/repos/veg/hyphy/issues/303/comments","events_url":"https://api.github.com/repos/veg/hyphy/issues/303/events","html_url":"https://github.com/veg/hyphy/issues/303","id":86761448,"number":303,"title":"Spidermonkey/BGM batch file template for amino acid sequences?","user":{"login":"aavilahe","id":5460218,"avatar_url":"https://avatars.githubusercontent.com/u/5460218?v=3","gravatar_id":"","url":"https://api.github.com/users/aavilahe","html_url":"https://github.com/aavilahe","followers_url":"https://api.github.com/users/aavilahe/followers","following_url":"https://api.github.com/users/aavilahe/following{/other_user}","gists_url":"https://api.github.com/users/aavilahe/gists{/gist_id}","starred_url":"https://api.github.com/users/aavilahe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aavilahe/subscriptions","organizations_url":"https://api.github.com/users/aavilahe/orgs","repos_url":"https://api.github.com/users/aavilahe/repos","events_url":"https://api.github.com/users/aavilahe/events{/privacy}","received_events_url":"https://api.github.com/users/aavilahe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ArtPoon","id":1109328,"avatar_url":"https://avatars.githubusercontent.com/u/1109328?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtPoon","html_url":"https://github.com/ArtPoon","followers_url":"https://api.github.com/users/ArtPoon/followers","following_url":"https://api.github.com/users/ArtPoon/following{/other_user}","gists_url":"https://api.github.com/users/ArtPoon/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtPoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtPoon/subscriptions","organizations_url":"https://api.github.com/users/ArtPoon/orgs","repos_url":"https://api.github.com/users/ArtPoon/repos","events_url":"https://api.github.com/users/ArtPoon/events{/privacy}","received_events_url":"https://api.github.com/users/ArtPoon/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-06-09T22:54:22Z","updated_at":"2015-06-09T22:59:33Z","closed_at":null,"body":"Hi all — I was wondering if there was an example or template batch file for running [Spidermonkey/BGM](http://www.datamonkey.org/help/spidermonkey.php) on *protein alignments* locally.\r\n\r\nI found the the example for nucleotides in `res/TemplateBatchFiles/QuickSelectionDetection.bf` but I'm having trouble adapting it for amino acid sequences to match the [Spidermonkey webserver](http://www.datamonkey.org/help/spidermonkey.php). I'm not sure exactly which variables I need to set in order to do the amino acid analysis. I am guessing these are the lines where the magic happens: `_bgm_data = obtainBGMParameters (\"lf\");` and `ml_bgm_results          = runBGM (_bgm_data);` . I assume I need something from the model fitting (`AnalyzeNucProtData.bf`) and ancestral mapping (`Utility/AncestralMapper.bf`) batch files, but I am getting lost navigating through the `#include`s, `ExecuteAFile()`s, and `LoadFunctionLibrary()`s.\r\n\r\nI would greatly appreciate any pointers to code I could adapt or for which batch files to modify.\r\n\r\nThanks,\r\na"},"comment":{"url":"https://api.github.com/repos/veg/hyphy/issues/comments/110527639","html_url":"https://github.com/veg/hyphy/issues/303#issuecomment-110527639","issue_url":"https://api.github.com/repos/veg/hyphy/issues/303","id":110527639,"user":{"login":"ArtPoon","id":1109328,"avatar_url":"https://avatars.githubusercontent.com/u/1109328?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtPoon","html_url":"https://github.com/ArtPoon","followers_url":"https://api.github.com/users/ArtPoon/followers","following_url":"https://api.github.com/users/ArtPoon/following{/other_user}","gists_url":"https://api.github.com/users/ArtPoon/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtPoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtPoon/subscriptions","organizations_url":"https://api.github.com/users/ArtPoon/orgs","repos_url":"https://api.github.com/users/ArtPoon/repos","events_url":"https://api.github.com/users/ArtPoon/events{/privacy}","received_events_url":"https://api.github.com/users/ArtPoon/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T22:59:33Z","updated_at":"2015-06-09T22:59:33Z","body":"You can find better example code for using BGM in standalone HyPhy in `tests/hbltests/BayesianGraphicalModels/TestBGM.bf`\r\n\r\nThe `QuickSelectionDetection.bf` code is a bit of a kludge, I would not use it as a template.\r\nAssuming that you want to analyze the amino acid substitution process using BGMs (and not the observed distribution of amino acids), you will need some ancestral reconstruction of AAs in the tree.   Also assuming that you are working with a protein sequence alignment and not codon sequences, you can fit a model of AA evolution with `AnalyzeNucProtData.bf` (good guess!).\r\nNext you need to map AA substitution events to your tree.  I will dig around for how to do this and my carpal is acting up so please be patient :)\r\n\r\nother a\r\n"}}