{"action":"created","comment":{"url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/comments/229264158","pull_request_review_id":169715757,"id":229264158,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTI2NDE1OA==","diff_hunk":"@@ -121,6 +123,35 @@ def _expression(self, species_contam):\n         return sorted(k for k, v in species_contam['contaminant_unique_mapped'].items() if v > 500)\n \n \n+class RequiredYield(Calculation):\n+    @cached_property\n+    def quantised_yields(self):\n+        return cfg['available_yields']\n+\n+    def _expression(self, genome_size):\n+        return {\n+            # keys have to be strings to be valid BSON\n+            str(required_coverage) + 'X': self._get_yield(genome_size, required_coverage)\n+            for required_coverage in cfg['available_coverages']\n+        }\n+\n+    def _get_yield(self, genome_size, required_coverage):\n+        exact_yield = genome_size * required_coverage\n+        for y in sorted(self.quantised_yields):\n+            if y >= exact_yield:\n+                return y\n+\n+        raise ValueError(\n+            'Could not resolve a required yield for %sX coverage and genome size %s' % (required_coverage, genome_size)","path":"rest_api/aggregation/database_hooks.py","position":32,"original_position":32,"commit_id":"d6a377bcd6fffd663def906bb222d7ca53802bcb","original_commit_id":"d6a377bcd6fffd663def906bb222d7ca53802bcb","user":{"login":"tcezard","id":650891,"node_id":"MDQ6VXNlcjY1MDg5MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/650891?v=4","gravatar_id":"","url":"https://api.github.com/users/tcezard","html_url":"https://github.com/tcezard","followers_url":"https://api.github.com/users/tcezard/followers","following_url":"https://api.github.com/users/tcezard/following{/other_user}","gists_url":"https://api.github.com/users/tcezard/gists{/gist_id}","starred_url":"https://api.github.com/users/tcezard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcezard/subscriptions","organizations_url":"https://api.github.com/users/tcezard/orgs","repos_url":"https://api.github.com/users/tcezard/repos","events_url":"https://api.github.com/users/tcezard/events{/privacy}","received_events_url":"https://api.github.com/users/tcezard/received_events","type":"User","site_admin":false},"body":"Not a big fan of the aggregation raising exception. These are not translated in anything the request can understand. We can either:\r\n - raise an werkzeug exception such as abort. This has the additional disadvantage of leaving the request half processed. \r\n - fail silently and log the error and have sensible default such as None or 0.","created_at":"2018-10-30T11:10:07Z","updated_at":"2018-10-30T11:10:50Z","html_url":"https://github.com/EdinburghGenomics/Reporting-App/pull/201#discussion_r229264158","pull_request_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/201","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/comments/229264158"},"html":{"href":"https://github.com/EdinburghGenomics/Reporting-App/pull/201#discussion_r229264158"},"pull_request":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/201"}}},"pull_request":{"url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/201","id":225462195,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NDYyMTk1","html_url":"https://github.com/EdinburghGenomics/Reporting-App/pull/201","diff_url":"https://github.com/EdinburghGenomics/Reporting-App/pull/201.diff","patch_url":"https://github.com/EdinburghGenomics/Reporting-App/pull/201.patch","issue_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues/201","number":201,"state":"open","locked":false,"title":"Reference data storage","user":{"login":"mwhamgenomics","id":12951686,"node_id":"MDQ6VXNlcjEyOTUxNjg2","avatar_url":"https://avatars2.githubusercontent.com/u/12951686?v=4","gravatar_id":"","url":"https://api.github.com/users/mwhamgenomics","html_url":"https://github.com/mwhamgenomics","followers_url":"https://api.github.com/users/mwhamgenomics/followers","following_url":"https://api.github.com/users/mwhamgenomics/following{/other_user}","gists_url":"https://api.github.com/users/mwhamgenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/mwhamgenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwhamgenomics/subscriptions","organizations_url":"https://api.github.com/users/mwhamgenomics/orgs","repos_url":"https://api.github.com/users/mwhamgenomics/repos","events_url":"https://api.github.com/users/mwhamgenomics/events{/privacy}","received_events_url":"https://api.github.com/users/mwhamgenomics/received_events","type":"User","site_admin":false},"body":"- Closes #184, closes #196\r\n- Updating Eve to 0.8\r\n- Datatables can now display dropdown lists of any type, not just hyperlinks\r\n","created_at":"2018-10-24T16:01:48Z","updated_at":"2018-10-30T11:10:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8403ec345c699ed089b0c1c6e3ef3a27209dc814","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/milestones/7","html_url":"https://github.com/EdinburghGenomics/Reporting-App/milestone/7","labels_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/milestones/7/labels","id":3666133,"node_id":"MDk6TWlsZXN0b25lMzY2NjEzMw==","number":7,"title":"v0.20","description":"","creator":{"login":"tcezard","id":650891,"node_id":"MDQ6VXNlcjY1MDg5MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/650891?v=4","gravatar_id":"","url":"https://api.github.com/users/tcezard","html_url":"https://github.com/tcezard","followers_url":"https://api.github.com/users/tcezard/followers","following_url":"https://api.github.com/users/tcezard/following{/other_user}","gists_url":"https://api.github.com/users/tcezard/gists{/gist_id}","starred_url":"https://api.github.com/users/tcezard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcezard/subscriptions","organizations_url":"https://api.github.com/users/tcezard/orgs","repos_url":"https://api.github.com/users/tcezard/repos","events_url":"https://api.github.com/users/tcezard/events{/privacy}","received_events_url":"https://api.github.com/users/tcezard/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":1,"state":"open","created_at":"2018-09-18T13:13:26Z","updated_at":"2018-10-24T16:03:59Z","due_on":"2018-11-08T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/201/commits","review_comments_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/201/comments","review_comment_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues/201/comments","statuses_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/statuses/d6a377bcd6fffd663def906bb222d7ca53802bcb","head":{"label":"EdinburghGenomics:mwham_develop","ref":"mwham_develop","sha":"d6a377bcd6fffd663def906bb222d7ca53802bcb","user":{"login":"EdinburghGenomics","id":12951724,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTUxNzI0","avatar_url":"https://avatars0.githubusercontent.com/u/12951724?v=4","gravatar_id":"","url":"https://api.github.com/users/EdinburghGenomics","html_url":"https://github.com/EdinburghGenomics","followers_url":"https://api.github.com/users/EdinburghGenomics/followers","following_url":"https://api.github.com/users/EdinburghGenomics/following{/other_user}","gists_url":"https://api.github.com/users/EdinburghGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/EdinburghGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdinburghGenomics/subscriptions","organizations_url":"https://api.github.com/users/EdinburghGenomics/orgs","repos_url":"https://api.github.com/users/EdinburghGenomics/repos","events_url":"https://api.github.com/users/EdinburghGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/EdinburghGenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":45608433,"node_id":"MDEwOlJlcG9zaXRvcnk0NTYwODQzMw==","name":"Reporting-App","full_name":"EdinburghGenomics/Reporting-App","private":false,"owner":{"login":"EdinburghGenomics","id":12951724,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTUxNzI0","avatar_url":"https://avatars0.githubusercontent.com/u/12951724?v=4","gravatar_id":"","url":"https://api.github.com/users/EdinburghGenomics","html_url":"https://github.com/EdinburghGenomics","followers_url":"https://api.github.com/users/EdinburghGenomics/followers","following_url":"https://api.github.com/users/EdinburghGenomics/following{/other_user}","gists_url":"https://api.github.com/users/EdinburghGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/EdinburghGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdinburghGenomics/subscriptions","organizations_url":"https://api.github.com/users/EdinburghGenomics/orgs","repos_url":"https://api.github.com/users/EdinburghGenomics/repos","events_url":"https://api.github.com/users/EdinburghGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/EdinburghGenomics/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/EdinburghGenomics/Reporting-App","description":"A Flask web app for presenting bcl2fastq and variant calling performance reports from Analysis-Driver","fork":false,"url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App","forks_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/forks","keys_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/teams","hooks_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/hooks","issue_events_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues/events{/number}","events_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/events","assignees_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/assignees{/user}","branches_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/branches{/branch}","tags_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/tags","blobs_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/refs{/sha}","trees_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/statuses/{sha}","languages_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/languages","stargazers_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/stargazers","contributors_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/contributors","subscribers_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/subscribers","subscription_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/subscription","commits_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/commits{/sha}","git_commits_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/commits{/sha}","comments_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/comments{/number}","issue_comment_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues/comments{/number}","contents_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/contents/{+path}","compare_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/merges","archive_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/downloads","issues_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues{/number}","pulls_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls{/number}","milestones_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/milestones{/number}","notifications_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/labels{/name}","releases_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/releases{/id}","deployments_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/deployments","created_at":"2015-11-05T11:58:25Z","updated_at":"2018-10-26T22:45:10Z","pushed_at":"2018-10-25T15:29:15Z","git_url":"git://github.com/EdinburghGenomics/Reporting-App.git","ssh_url":"git@github.com:EdinburghGenomics/Reporting-App.git","clone_url":"https://github.com/EdinburghGenomics/Reporting-App.git","svn_url":"https://github.com/EdinburghGenomics/Reporting-App","homepage":null,"size":4474,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":19,"watchers":3,"default_branch":"master"}},"base":{"label":"EdinburghGenomics:master","ref":"master","sha":"68abdb8627df34af30fdcc1b746499de059adfde","user":{"login":"EdinburghGenomics","id":12951724,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTUxNzI0","avatar_url":"https://avatars0.githubusercontent.com/u/12951724?v=4","gravatar_id":"","url":"https://api.github.com/users/EdinburghGenomics","html_url":"https://github.com/EdinburghGenomics","followers_url":"https://api.github.com/users/EdinburghGenomics/followers","following_url":"https://api.github.com/users/EdinburghGenomics/following{/other_user}","gists_url":"https://api.github.com/users/EdinburghGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/EdinburghGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdinburghGenomics/subscriptions","organizations_url":"https://api.github.com/users/EdinburghGenomics/orgs","repos_url":"https://api.github.com/users/EdinburghGenomics/repos","events_url":"https://api.github.com/users/EdinburghGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/EdinburghGenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":45608433,"node_id":"MDEwOlJlcG9zaXRvcnk0NTYwODQzMw==","name":"Reporting-App","full_name":"EdinburghGenomics/Reporting-App","private":false,"owner":{"login":"EdinburghGenomics","id":12951724,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTUxNzI0","avatar_url":"https://avatars0.githubusercontent.com/u/12951724?v=4","gravatar_id":"","url":"https://api.github.com/users/EdinburghGenomics","html_url":"https://github.com/EdinburghGenomics","followers_url":"https://api.github.com/users/EdinburghGenomics/followers","following_url":"https://api.github.com/users/EdinburghGenomics/following{/other_user}","gists_url":"https://api.github.com/users/EdinburghGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/EdinburghGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdinburghGenomics/subscriptions","organizations_url":"https://api.github.com/users/EdinburghGenomics/orgs","repos_url":"https://api.github.com/users/EdinburghGenomics/repos","events_url":"https://api.github.com/users/EdinburghGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/EdinburghGenomics/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/EdinburghGenomics/Reporting-App","description":"A Flask web app for presenting bcl2fastq and variant calling performance reports from Analysis-Driver","fork":false,"url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App","forks_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/forks","keys_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/teams","hooks_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/hooks","issue_events_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues/events{/number}","events_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/events","assignees_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/assignees{/user}","branches_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/branches{/branch}","tags_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/tags","blobs_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/refs{/sha}","trees_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/statuses/{sha}","languages_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/languages","stargazers_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/stargazers","contributors_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/contributors","subscribers_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/subscribers","subscription_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/subscription","commits_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/commits{/sha}","git_commits_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/git/commits{/sha}","comments_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/comments{/number}","issue_comment_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues/comments{/number}","contents_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/contents/{+path}","compare_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/merges","archive_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/downloads","issues_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues{/number}","pulls_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls{/number}","milestones_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/milestones{/number}","notifications_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/labels{/name}","releases_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/releases{/id}","deployments_url":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/deployments","created_at":"2015-11-05T11:58:25Z","updated_at":"2018-10-26T22:45:10Z","pushed_at":"2018-10-25T15:29:15Z","git_url":"git://github.com/EdinburghGenomics/Reporting-App.git","ssh_url":"git@github.com:EdinburghGenomics/Reporting-App.git","clone_url":"https://github.com/EdinburghGenomics/Reporting-App.git","svn_url":"https://github.com/EdinburghGenomics/Reporting-App","homepage":null,"size":4474,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":19,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/201"},"html":{"href":"https://github.com/EdinburghGenomics/Reporting-App/pull/201"},"issue":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues/201"},"comments":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/issues/201/comments"},"review_comments":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/201/comments"},"review_comment":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/pulls/201/commits"},"statuses":{"href":"https://api.github.com/repos/EdinburghGenomics/Reporting-App/statuses/d6a377bcd6fffd663def906bb222d7ca53802bcb"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tcezard"}}