{"action":"created","comment":{"url":"https://api.github.com/repos/acorg/dark-matter/pulls/comments/112903817","pull_request_review_id":34251304,"id":112903817,"diff_hunk":"@@ -172,16 +225,40 @@ def _title(self):\n         @return: A C{str} title.\n         \"\"\"\n         return (\n-            '%d virus%s found in %d sample%s' %\n-            (len(self.virusTitles), '' if len(self.virusTitles) == 1 else 'es',\n-             len(self.sampleNames), '' if len(self.sampleNames) == 1 else 's'))\n+            'Overall, proteins from %d virus%s were found in %d sample%s.' %\n+            (len(self.virusTitles),\n+             '' if len(self.virusTitles) == 1 else 'es',\n+             len(self.sampleNames),\n+             '' if len(self.sampleNames) == 1 else 's'))\n+\n+    def maxProteinFraction(self, virusTitle):\n+        \"\"\"\n+        Get the fraction of a virus' proteins matched by any sample that\n+        matches the virus.\n+\n+        @param virusTitle: A C{str} virus title.\n+        @return: The C{float} maximum fraction of a virus' proteins that is\n+            matched by any sample. If the number of proteins for the virus is\n+            unknown, return 1.0 (i.e., assume all proteins are matched).\n+        \"\"\"\n+\n+        proteinCount = self._virusProteinCount[virusTitle]\n+        if proteinCount:\n+            maxMatches = max(\n+                len(sample['proteins'])\n+                for sample in self.virusTitles[virusTitle].values())\n+            return maxMatches / proteinCount\n+        else:\n+            return 1.0\n \n     def addFile(self, filename, fp):\n         \"\"\"\n         Read and record protein information for a sample.\n \n         @param filename: A C{str} file name.\n         @param fp: An open file pointer to read the file's data from.\n+        @raise ValueError: If information for a virus/protein/sample\n+            combination is given more than once.\n         \"\"\"\n ","path":"dark/proteins.py","position":199,"original_position":199,"commit_id":"52888a68e48b2e63fd7dcdcb39816e603682191a","original_commit_id":"52888a68e48b2e63fd7dcdcb39816e603682191a","user":{"login":"bamueh","id":4854653,"avatar_url":"https://avatars2.githubusercontent.com/u/4854653?v=3","gravatar_id":"","url":"https://api.github.com/users/bamueh","html_url":"https://github.com/bamueh","followers_url":"https://api.github.com/users/bamueh/followers","following_url":"https://api.github.com/users/bamueh/following{/other_user}","gists_url":"https://api.github.com/users/bamueh/gists{/gist_id}","starred_url":"https://api.github.com/users/bamueh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bamueh/subscriptions","organizations_url":"https://api.github.com/users/bamueh/orgs","repos_url":"https://api.github.com/users/bamueh/repos","events_url":"https://api.github.com/users/bamueh/events{/privacy}","received_events_url":"https://api.github.com/users/bamueh/received_events","type":"User","site_admin":false},"body":"One line too much.","created_at":"2017-04-24T09:41:22Z","updated_at":"2017-04-24T09:41:22Z","html_url":"https://github.com/acorg/dark-matter/pull/507#discussion_r112903817","pull_request_url":"https://api.github.com/repos/acorg/dark-matter/pulls/507","_links":{"self":{"href":"https://api.github.com/repos/acorg/dark-matter/pulls/comments/112903817"},"html":{"href":"https://github.com/acorg/dark-matter/pull/507#discussion_r112903817"},"pull_request":{"href":"https://api.github.com/repos/acorg/dark-matter/pulls/507"}}},"pull_request":{"url":"https://api.github.com/repos/acorg/dark-matter/pulls/507","id":117018144,"html_url":"https://github.com/acorg/dark-matter/pull/507","diff_url":"https://github.com/acorg/dark-matter/pull/507.diff","patch_url":"https://github.com/acorg/dark-matter/pull/507.patch","issue_url":"https://api.github.com/repos/acorg/dark-matter/issues/507","number":507,"state":"open","locked":false,"title":"Added --proteinFastaFilename and --minProteinFraction args to proteins-to-viruses.py","user":{"login":"terrycojones","id":132978,"avatar_url":"https://avatars0.githubusercontent.com/u/132978?v=3","gravatar_id":"","url":"https://api.github.com/users/terrycojones","html_url":"https://github.com/terrycojones","followers_url":"https://api.github.com/users/terrycojones/followers","following_url":"https://api.github.com/users/terrycojones/following{/other_user}","gists_url":"https://api.github.com/users/terrycojones/gists{/gist_id}","starred_url":"https://api.github.com/users/terrycojones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrycojones/subscriptions","organizations_url":"https://api.github.com/users/terrycojones/orgs","repos_url":"https://api.github.com/users/terrycojones/repos","events_url":"https://api.github.com/users/terrycojones/events{/privacy}","received_events_url":"https://api.github.com/users/terrycojones/received_events","type":"User","site_admin":false},"body":"These can be used to limit what is displayed in the HTML output, based on the fraction of proteins matched in viruses.\r\n\r\nFixes #506.\r\n","created_at":"2017-04-21T16:06:41Z","updated_at":"2017-04-24T09:41:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2d28b1dad16c2059a2bf1405db63ba81974ea38","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/acorg/dark-matter/pulls/507/commits","review_comments_url":"https://api.github.com/repos/acorg/dark-matter/pulls/507/comments","review_comment_url":"https://api.github.com/repos/acorg/dark-matter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acorg/dark-matter/issues/507/comments","statuses_url":"https://api.github.com/repos/acorg/dark-matter/statuses/52888a68e48b2e63fd7dcdcb39816e603682191a","head":{"label":"terrycojones:virus-protein-count-506","ref":"virus-protein-count-506","sha":"52888a68e48b2e63fd7dcdcb39816e603682191a","user":{"login":"terrycojones","id":132978,"avatar_url":"https://avatars0.githubusercontent.com/u/132978?v=3","gravatar_id":"","url":"https://api.github.com/users/terrycojones","html_url":"https://github.com/terrycojones","followers_url":"https://api.github.com/users/terrycojones/followers","following_url":"https://api.github.com/users/terrycojones/following{/other_user}","gists_url":"https://api.github.com/users/terrycojones/gists{/gist_id}","starred_url":"https://api.github.com/users/terrycojones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrycojones/subscriptions","organizations_url":"https://api.github.com/users/terrycojones/orgs","repos_url":"https://api.github.com/users/terrycojones/repos","events_url":"https://api.github.com/users/terrycojones/events{/privacy}","received_events_url":"https://api.github.com/users/terrycojones/received_events","type":"User","site_admin":false},"repo":{"id":23939945,"name":"dark-matter","full_name":"terrycojones/dark-matter","owner":{"login":"terrycojones","id":132978,"avatar_url":"https://avatars0.githubusercontent.com/u/132978?v=3","gravatar_id":"","url":"https://api.github.com/users/terrycojones","html_url":"https://github.com/terrycojones","followers_url":"https://api.github.com/users/terrycojones/followers","following_url":"https://api.github.com/users/terrycojones/following{/other_user}","gists_url":"https://api.github.com/users/terrycojones/gists{/gist_id}","starred_url":"https://api.github.com/users/terrycojones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrycojones/subscriptions","organizations_url":"https://api.github.com/users/terrycojones/orgs","repos_url":"https://api.github.com/users/terrycojones/repos","events_url":"https://api.github.com/users/terrycojones/events{/privacy}","received_events_url":"https://api.github.com/users/terrycojones/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/terrycojones/dark-matter","description":"Virus discovery","fork":true,"url":"https://api.github.com/repos/terrycojones/dark-matter","forks_url":"https://api.github.com/repos/terrycojones/dark-matter/forks","keys_url":"https://api.github.com/repos/terrycojones/dark-matter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terrycojones/dark-matter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terrycojones/dark-matter/teams","hooks_url":"https://api.github.com/repos/terrycojones/dark-matter/hooks","issue_events_url":"https://api.github.com/repos/terrycojones/dark-matter/issues/events{/number}","events_url":"https://api.github.com/repos/terrycojones/dark-matter/events","assignees_url":"https://api.github.com/repos/terrycojones/dark-matter/assignees{/user}","branches_url":"https://api.github.com/repos/terrycojones/dark-matter/branches{/branch}","tags_url":"https://api.github.com/repos/terrycojones/dark-matter/tags","blobs_url":"https://api.github.com/repos/terrycojones/dark-matter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terrycojones/dark-matter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terrycojones/dark-matter/git/refs{/sha}","trees_url":"https://api.github.com/repos/terrycojones/dark-matter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terrycojones/dark-matter/statuses/{sha}","languages_url":"https://api.github.com/repos/terrycojones/dark-matter/languages","stargazers_url":"https://api.github.com/repos/terrycojones/dark-matter/stargazers","contributors_url":"https://api.github.com/repos/terrycojones/dark-matter/contributors","subscribers_url":"https://api.github.com/repos/terrycojones/dark-matter/subscribers","subscription_url":"https://api.github.com/repos/terrycojones/dark-matter/subscription","commits_url":"https://api.github.com/repos/terrycojones/dark-matter/commits{/sha}","git_commits_url":"https://api.github.com/repos/terrycojones/dark-matter/git/commits{/sha}","comments_url":"https://api.github.com/repos/terrycojones/dark-matter/comments{/number}","issue_comment_url":"https://api.github.com/repos/terrycojones/dark-matter/issues/comments{/number}","contents_url":"https://api.github.com/repos/terrycojones/dark-matter/contents/{+path}","compare_url":"https://api.github.com/repos/terrycojones/dark-matter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terrycojones/dark-matter/merges","archive_url":"https://api.github.com/repos/terrycojones/dark-matter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terrycojones/dark-matter/downloads","issues_url":"https://api.github.com/repos/terrycojones/dark-matter/issues{/number}","pulls_url":"https://api.github.com/repos/terrycojones/dark-matter/pulls{/number}","milestones_url":"https://api.github.com/repos/terrycojones/dark-matter/milestones{/number}","notifications_url":"https://api.github.com/repos/terrycojones/dark-matter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terrycojones/dark-matter/labels{/name}","releases_url":"https://api.github.com/repos/terrycojones/dark-matter/releases{/id}","deployments_url":"https://api.github.com/repos/terrycojones/dark-matter/deployments","created_at":"2014-09-11T23:44:49Z","updated_at":"2016-02-16T20:48:56Z","pushed_at":"2017-04-21T16:05:52Z","git_url":"git://github.com/terrycojones/dark-matter.git","ssh_url":"git@github.com:terrycojones/dark-matter.git","clone_url":"https://github.com/terrycojones/dark-matter.git","svn_url":"https://github.com/terrycojones/dark-matter","homepage":null,"size":4619,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"acorg:master","ref":"master","sha":"d260764de203211a905793c262db1095d5d4852b","user":{"login":"acorg","id":4853692,"avatar_url":"https://avatars0.githubusercontent.com/u/4853692?v=3","gravatar_id":"","url":"https://api.github.com/users/acorg","html_url":"https://github.com/acorg","followers_url":"https://api.github.com/users/acorg/followers","following_url":"https://api.github.com/users/acorg/following{/other_user}","gists_url":"https://api.github.com/users/acorg/gists{/gist_id}","starred_url":"https://api.github.com/users/acorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acorg/subscriptions","organizations_url":"https://api.github.com/users/acorg/orgs","repos_url":"https://api.github.com/users/acorg/repos","events_url":"https://api.github.com/users/acorg/events{/privacy}","received_events_url":"https://api.github.com/users/acorg/received_events","type":"Organization","site_admin":false},"repo":{"id":11003251,"name":"dark-matter","full_name":"acorg/dark-matter","owner":{"login":"acorg","id":4853692,"avatar_url":"https://avatars0.githubusercontent.com/u/4853692?v=3","gravatar_id":"","url":"https://api.github.com/users/acorg","html_url":"https://github.com/acorg","followers_url":"https://api.github.com/users/acorg/followers","following_url":"https://api.github.com/users/acorg/following{/other_user}","gists_url":"https://api.github.com/users/acorg/gists{/gist_id}","starred_url":"https://api.github.com/users/acorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acorg/subscriptions","organizations_url":"https://api.github.com/users/acorg/orgs","repos_url":"https://api.github.com/users/acorg/repos","events_url":"https://api.github.com/users/acorg/events{/privacy}","received_events_url":"https://api.github.com/users/acorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acorg/dark-matter","description":"Virus discovery","fork":false,"url":"https://api.github.com/repos/acorg/dark-matter","forks_url":"https://api.github.com/repos/acorg/dark-matter/forks","keys_url":"https://api.github.com/repos/acorg/dark-matter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acorg/dark-matter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acorg/dark-matter/teams","hooks_url":"https://api.github.com/repos/acorg/dark-matter/hooks","issue_events_url":"https://api.github.com/repos/acorg/dark-matter/issues/events{/number}","events_url":"https://api.github.com/repos/acorg/dark-matter/events","assignees_url":"https://api.github.com/repos/acorg/dark-matter/assignees{/user}","branches_url":"https://api.github.com/repos/acorg/dark-matter/branches{/branch}","tags_url":"https://api.github.com/repos/acorg/dark-matter/tags","blobs_url":"https://api.github.com/repos/acorg/dark-matter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acorg/dark-matter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acorg/dark-matter/git/refs{/sha}","trees_url":"https://api.github.com/repos/acorg/dark-matter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acorg/dark-matter/statuses/{sha}","languages_url":"https://api.github.com/repos/acorg/dark-matter/languages","stargazers_url":"https://api.github.com/repos/acorg/dark-matter/stargazers","contributors_url":"https://api.github.com/repos/acorg/dark-matter/contributors","subscribers_url":"https://api.github.com/repos/acorg/dark-matter/subscribers","subscription_url":"https://api.github.com/repos/acorg/dark-matter/subscription","commits_url":"https://api.github.com/repos/acorg/dark-matter/commits{/sha}","git_commits_url":"https://api.github.com/repos/acorg/dark-matter/git/commits{/sha}","comments_url":"https://api.github.com/repos/acorg/dark-matter/comments{/number}","issue_comment_url":"https://api.github.com/repos/acorg/dark-matter/issues/comments{/number}","contents_url":"https://api.github.com/repos/acorg/dark-matter/contents/{+path}","compare_url":"https://api.github.com/repos/acorg/dark-matter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acorg/dark-matter/merges","archive_url":"https://api.github.com/repos/acorg/dark-matter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acorg/dark-matter/downloads","issues_url":"https://api.github.com/repos/acorg/dark-matter/issues{/number}","pulls_url":"https://api.github.com/repos/acorg/dark-matter/pulls{/number}","milestones_url":"https://api.github.com/repos/acorg/dark-matter/milestones{/number}","notifications_url":"https://api.github.com/repos/acorg/dark-matter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acorg/dark-matter/labels{/name}","releases_url":"https://api.github.com/repos/acorg/dark-matter/releases{/id}","deployments_url":"https://api.github.com/repos/acorg/dark-matter/deployments","created_at":"2013-06-27T17:25:29Z","updated_at":"2016-10-24T09:20:05Z","pushed_at":"2017-04-21T16:06:41Z","git_url":"git://github.com/acorg/dark-matter.git","ssh_url":"git@github.com:acorg/dark-matter.git","clone_url":"https://github.com/acorg/dark-matter.git","svn_url":"https://github.com/acorg/dark-matter","homepage":null,"size":4606,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":24,"forks":5,"open_issues":24,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acorg/dark-matter/pulls/507"},"html":{"href":"https://github.com/acorg/dark-matter/pull/507"},"issue":{"href":"https://api.github.com/repos/acorg/dark-matter/issues/507"},"comments":{"href":"https://api.github.com/repos/acorg/dark-matter/issues/507/comments"},"review_comments":{"href":"https://api.github.com/repos/acorg/dark-matter/pulls/507/comments"},"review_comment":{"href":"https://api.github.com/repos/acorg/dark-matter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acorg/dark-matter/pulls/507/commits"},"statuses":{"href":"https://api.github.com/repos/acorg/dark-matter/statuses/52888a68e48b2e63fd7dcdcb39816e603682191a"}}}}
{"actor":{"display_login":"bamueh"}}