{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/comments/77446099","id":77446099,"diff_hunk":"@@ -172,11 +175,11 @@ public void fitMCMC(final int numSamples, final int numBurnIn) {\n     }\n \n     //use width of a probability distribution given the position of its mode (estimated from Gaussian approximation) as step size\n-    private static double getStepSizeFromApproximatePosteriorWidthAtMode(final Function<Double, Double> logPDF, final double mode) {\n+    private static double approximatePosteriorWidthAtMode(final Function<Double, Double> logPDF, final double mode) {\n         final double absMode = Math.abs(mode);\n-        final double EPSILON = Math.min(1e-6, absMode / 2);    //adjust scale is mode is very near zero\n-        final double DEFAULT = absMode / 10;                   //if \"mode\" is not close to true mode of logPDF, approximation may not apply; just use 1/10 of absMode in this case\n-        final double secondDerivative = (logPDF.apply(mode + EPSILON) - 2*logPDF.apply(mode) + logPDF.apply(mode - EPSILON))/(EPSILON*EPSILON);\n-        return secondDerivative < 0 ? Math.sqrt(-1.0 / secondDerivative) : DEFAULT;\n+        final double epsilon = Math.min(1e-6, absMode / 2);    //adjust scale is mode is very near zero","path":"src/main/java/org/broadinstitute/hellbender/tools/exome/allelefraction/AlleleFractionModeller.java","position":61,"original_position":61,"commit_id":"18997489048a1bcd025119af1f77ae3757060c1a","original_commit_id":"18997489048a1bcd025119af1f77ae3757060c1a","user":{"login":"davidbenjamin","id":8438890,"avatar_url":"https://avatars.githubusercontent.com/u/8438890?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbenjamin","html_url":"https://github.com/davidbenjamin","followers_url":"https://api.github.com/users/davidbenjamin/followers","following_url":"https://api.github.com/users/davidbenjamin/following{/other_user}","gists_url":"https://api.github.com/users/davidbenjamin/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbenjamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbenjamin/subscriptions","organizations_url":"https://api.github.com/users/davidbenjamin/orgs","repos_url":"https://api.github.com/users/davidbenjamin/repos","events_url":"https://api.github.com/users/davidbenjamin/events{/privacy}","received_events_url":"https://api.github.com/users/davidbenjamin/received_events","type":"User","site_admin":false},"body":"*if* mode is. . .  Typo was originally mine, of course.","created_at":"2016-09-04T03:23:13Z","updated_at":"2016-09-04T03:23:13Z","html_url":"https://github.com/broadinstitute/gatk-protected/pull/660#discussion_r77446099","pull_request_url":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/660","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/comments/77446099"},"html":{"href":"https://github.com/broadinstitute/gatk-protected/pull/660#discussion_r77446099"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/660"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/660","id":83562096,"html_url":"https://github.com/broadinstitute/gatk-protected/pull/660","diff_url":"https://github.com/broadinstitute/gatk-protected/pull/660.diff","patch_url":"https://github.com/broadinstitute/gatk-protected/pull/660.patch","issue_url":"https://api.github.com/repos/broadinstitute/gatk-protected/issues/660","number":660,"state":"open","locked":false,"title":"Changed allele-fraction model to use slice sampling.","user":{"login":"samuelklee","id":11076296,"avatar_url":"https://avatars.githubusercontent.com/u/11076296?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelklee","html_url":"https://github.com/samuelklee","followers_url":"https://api.github.com/users/samuelklee/followers","following_url":"https://api.github.com/users/samuelklee/following{/other_user}","gists_url":"https://api.github.com/users/samuelklee/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelklee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelklee/subscriptions","organizations_url":"https://api.github.com/users/samuelklee/orgs","repos_url":"https://api.github.com/users/samuelklee/repos","events_url":"https://api.github.com/users/samuelklee/events{/privacy}","received_events_url":"https://api.github.com/users/samuelklee/received_events","type":"User","site_admin":false},"body":"The allele-fraction model was previous sampled using adaptive Metropolis-Hastings sampling.  However, we did not implement thinning of samples, which resulted in many autocorrelated posterior samples, leading to repeated values in reported posterior deciles.  This PR changes the allele-fraction model to use slice sampling instead.\r\n\r\nAlso:\r\n-Removed AlleleFractionSamplersUnitTest, which were specifically testing MH sampling.  I also think the allele-fraction samplers are essentially covered by the AlleleFractionModellerUnitTest.\r\n-Minor-allele fraction is a bounded random variable, so minor changes to the SliceSampler class were required.  Unit tests for sampling of a beta distribution were added to cover this case.\r\n-Tweaked the failure thresholds for other MCMC tests.\r\n-Optimized imports, miscellaneous cleanup.\r\n\r\nEDIT:  Looks like this bumps up the runtime about 2-3x (due to the increased number of likelihood evaluations required for slice sampling) to about 30-40 min for an exome.  I would guess that the autocorrelation scale is higher than this, so it's probably faster than doing MH and thinning.\r\n\r\nAlthough we can adjust some of the default parameters (like number of MCMC refits per similar-segment merging iteration, similar-segment merging thresholds, etc.) to bring this down, I think we could probably optimize the AF likelihood calculation as well.","created_at":"2016-09-01T02:47:15Z","updated_at":"2016-09-04T03:23:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b845b4a1fdd6777dc28e33e60379b1e62b65addd","assignee":{"login":"davidbenjamin","id":8438890,"avatar_url":"https://avatars.githubusercontent.com/u/8438890?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbenjamin","html_url":"https://github.com/davidbenjamin","followers_url":"https://api.github.com/users/davidbenjamin/followers","following_url":"https://api.github.com/users/davidbenjamin/following{/other_user}","gists_url":"https://api.github.com/users/davidbenjamin/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbenjamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbenjamin/subscriptions","organizations_url":"https://api.github.com/users/davidbenjamin/orgs","repos_url":"https://api.github.com/users/davidbenjamin/repos","events_url":"https://api.github.com/users/davidbenjamin/events{/privacy}","received_events_url":"https://api.github.com/users/davidbenjamin/received_events","type":"User","site_admin":false},"assignees":[{"login":"davidbenjamin","id":8438890,"avatar_url":"https://avatars.githubusercontent.com/u/8438890?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbenjamin","html_url":"https://github.com/davidbenjamin","followers_url":"https://api.github.com/users/davidbenjamin/followers","following_url":"https://api.github.com/users/davidbenjamin/following{/other_user}","gists_url":"https://api.github.com/users/davidbenjamin/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbenjamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbenjamin/subscriptions","organizations_url":"https://api.github.com/users/davidbenjamin/orgs","repos_url":"https://api.github.com/users/davidbenjamin/repos","events_url":"https://api.github.com/users/davidbenjamin/events{/privacy}","received_events_url":"https://api.github.com/users/davidbenjamin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/660/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/660/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/gatk-protected/issues/660/comments","statuses_url":"https://api.github.com/repos/broadinstitute/gatk-protected/statuses/18997489048a1bcd025119af1f77ae3757060c1a","head":{"label":"broadinstitute:sl_af_slice_sampling","ref":"sl_af_slice_sampling","sha":"18997489048a1bcd025119af1f77ae3757060c1a","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34413897,"name":"gatk-protected","full_name":"broadinstitute/gatk-protected","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/gatk-protected","description":"GATK4 development of the license-protected part of the toolkit","fork":false,"url":"https://api.github.com/repos/broadinstitute/gatk-protected","forks_url":"https://api.github.com/repos/broadinstitute/gatk-protected/forks","keys_url":"https://api.github.com/repos/broadinstitute/gatk-protected/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/gatk-protected/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/gatk-protected/teams","hooks_url":"https://api.github.com/repos/broadinstitute/gatk-protected/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/gatk-protected/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/gatk-protected/events","assignees_url":"https://api.github.com/repos/broadinstitute/gatk-protected/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/gatk-protected/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/gatk-protected/tags","blobs_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/gatk-protected/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/gatk-protected/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/gatk-protected/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/gatk-protected/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/gatk-protected/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/gatk-protected/subscription","commits_url":"https://api.github.com/repos/broadinstitute/gatk-protected/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/gatk-protected/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/gatk-protected/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/gatk-protected/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/gatk-protected/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/gatk-protected/merges","archive_url":"https://api.github.com/repos/broadinstitute/gatk-protected/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/gatk-protected/downloads","issues_url":"https://api.github.com/repos/broadinstitute/gatk-protected/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/gatk-protected/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/gatk-protected/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/gatk-protected/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/gatk-protected/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/gatk-protected/deployments","created_at":"2015-04-22T20:24:45Z","updated_at":"2016-08-30T12:05:46Z","pushed_at":"2016-09-04T01:23:00Z","git_url":"git://github.com/broadinstitute/gatk-protected.git","ssh_url":"git@github.com:broadinstitute/gatk-protected.git","clone_url":"https://github.com/broadinstitute/gatk-protected.git","svn_url":"https://github.com/broadinstitute/gatk-protected","homepage":null,"size":194741,"stargazers_count":14,"watchers_count":14,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":153,"forks":10,"open_issues":153,"watchers":14,"default_branch":"master"}},"base":{"label":"broadinstitute:master","ref":"master","sha":"9f7d0ea96413297f78694bcab1e5ae969261f8d5","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34413897,"name":"gatk-protected","full_name":"broadinstitute/gatk-protected","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/gatk-protected","description":"GATK4 development of the license-protected part of the toolkit","fork":false,"url":"https://api.github.com/repos/broadinstitute/gatk-protected","forks_url":"https://api.github.com/repos/broadinstitute/gatk-protected/forks","keys_url":"https://api.github.com/repos/broadinstitute/gatk-protected/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/gatk-protected/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/gatk-protected/teams","hooks_url":"https://api.github.com/repos/broadinstitute/gatk-protected/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/gatk-protected/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/gatk-protected/events","assignees_url":"https://api.github.com/repos/broadinstitute/gatk-protected/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/gatk-protected/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/gatk-protected/tags","blobs_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/gatk-protected/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/gatk-protected/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/gatk-protected/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/gatk-protected/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/gatk-protected/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/gatk-protected/subscription","commits_url":"https://api.github.com/repos/broadinstitute/gatk-protected/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/gatk-protected/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/gatk-protected/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/gatk-protected/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/gatk-protected/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/gatk-protected/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/gatk-protected/merges","archive_url":"https://api.github.com/repos/broadinstitute/gatk-protected/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/gatk-protected/downloads","issues_url":"https://api.github.com/repos/broadinstitute/gatk-protected/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/gatk-protected/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/gatk-protected/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/gatk-protected/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/gatk-protected/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/gatk-protected/deployments","created_at":"2015-04-22T20:24:45Z","updated_at":"2016-08-30T12:05:46Z","pushed_at":"2016-09-04T01:23:00Z","git_url":"git://github.com/broadinstitute/gatk-protected.git","ssh_url":"git@github.com:broadinstitute/gatk-protected.git","clone_url":"https://github.com/broadinstitute/gatk-protected.git","svn_url":"https://github.com/broadinstitute/gatk-protected","homepage":null,"size":194741,"stargazers_count":14,"watchers_count":14,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":153,"forks":10,"open_issues":153,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/660"},"html":{"href":"https://github.com/broadinstitute/gatk-protected/pull/660"},"issue":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/issues/660"},"comments":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/issues/660/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/660/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/pulls/660/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/gatk-protected/statuses/18997489048a1bcd025119af1f77ae3757060c1a"}}}}
{"actor":{"display_login":"davidbenjamin"}}