{"action":"created","comment":{"url":"https://api.github.com/repos/biopet/bamstats/pulls/comments/212614329","pull_request_review_id":149285886,"id":212614329,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjYxNDMyOQ==","diff_hunk":"@@ -0,0 +1,192 @@\n+/*\n+ * Copyright (c) 2014 Biopet\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\n+ * this software and associated documentation files (the \"Software\"), to deal in\n+ * the Software without restriction, including without limitation the rights to\n+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n+ * the Software, and to permit persons to whom the Software is furnished to do so,\n+ * subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in all\n+ * copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n+ */\n+\n+package nl.biopet.tools.bamstats\n+\n+import java.io.{File, PrintWriter}\n+import java.util.Locale\n+\n+import htsjdk.samtools.SAMRecord\n+import nl.biopet.utils.conversions\n+import play.api.libs.json.Json\n+\n+import scala.collection.mutable\n+import util.Properties.lineSeparator\n+\n+class FlagStats {\n+\n+  private val flagStats: mutable.Map[FlagMethods.Value, Long] =\n+    FlagMethods.emptyResult\n+  private val crossCounts\n+    : mutable.Map[FlagMethods.Value, mutable.Map[FlagMethods.Value, Long]] =\n+    FlagMethods.emptyCrossResult\n+\n+  def flagstatsSorted: List[(FlagMethods.Value, Long)] = {\n+    flagStats.toList.sortBy { case (method, _) => method.id }\n+  }\n+\n+  def crossCountsSorted\n+    : List[(FlagMethods.Value, List[(FlagMethods.Value, Long)])] = {\n+    crossCounts.toList.sortBy { case (method, _) => method.id }.map {\n+      case (method, countsMap) =>\n+        val sortedMap = countsMap.toList.sortBy {\n+          case (innerMethod, _) => innerMethod.id\n+        }\n+        (method, sortedMap)\n+    }\n+  }\n+  def loadRecord(record: SAMRecord): Unit = {\n+    flagStats.keys.foreach { method =>\n+      if (method.method(record)) {\n+        flagStats(method) += 1\n+        crossCounts(method).keys.foreach(cross => {\n+          if (cross.method(record)) crossCounts(method)(cross) += 1\n+        })\n+      }\n+    }\n+  }\n+\n+  def +=(other: FlagStats): Unit = {\n+    this.flagStats.keys.foreach { method =>\n+      this.flagStats(method) += other.flagStats(method)\n+      this.crossCounts(method).keys foreach (method2 => {\n+        this.crossCounts(method)(method2) += other.crossCounts(method)(method2)\n+      })\n+    }\n+  }\n+\n+  def ==(other: FlagStats): Boolean = {","path":"src/main/scala/nl/biopet/tools/bamstats/FlagStats.scala","position":76,"original_position":76,"commit_id":"a9edf391b6e001c035ad6cfa90bfc561063a6077","original_commit_id":"a9edf391b6e001c035ad6cfa90bfc561063a6077","user":{"login":"rhpvorderman","id":26142226,"node_id":"MDQ6VXNlcjI2MTQyMjI2","avatar_url":"https://avatars1.githubusercontent.com/u/26142226?v=4","gravatar_id":"","url":"https://api.github.com/users/rhpvorderman","html_url":"https://github.com/rhpvorderman","followers_url":"https://api.github.com/users/rhpvorderman/followers","following_url":"https://api.github.com/users/rhpvorderman/following{/other_user}","gists_url":"https://api.github.com/users/rhpvorderman/gists{/gist_id}","starred_url":"https://api.github.com/users/rhpvorderman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhpvorderman/subscriptions","organizations_url":"https://api.github.com/users/rhpvorderman/orgs","repos_url":"https://api.github.com/users/rhpvorderman/repos","events_url":"https://api.github.com/users/rhpvorderman/events{/privacy}","received_events_url":"https://api.github.com/users/rhpvorderman/received_events","type":"User","site_admin":false},"body":"No usages were found. Deleted it.\r\n","created_at":"2018-08-24T12:37:16Z","updated_at":"2018-08-24T12:37:16Z","html_url":"https://github.com/biopet/bamstats/pull/9#discussion_r212614329","pull_request_url":"https://api.github.com/repos/biopet/bamstats/pulls/9","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/biopet/bamstats/pulls/comments/212614329"},"html":{"href":"https://github.com/biopet/bamstats/pull/9#discussion_r212614329"},"pull_request":{"href":"https://api.github.com/repos/biopet/bamstats/pulls/9"}},"in_reply_to_id":212607608},"pull_request":{"url":"https://api.github.com/repos/biopet/bamstats/pulls/9","id":208568498,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NTY4NDk4","html_url":"https://github.com/biopet/bamstats/pull/9","diff_url":"https://github.com/biopet/bamstats/pull/9.diff","patch_url":"https://github.com/biopet/bamstats/pull/9.patch","issue_url":"https://api.github.com/repos/biopet/bamstats/issues/9","number":9,"state":"open","locked":false,"title":"Refactor flagstats.","user":{"login":"rhpvorderman","id":26142226,"node_id":"MDQ6VXNlcjI2MTQyMjI2","avatar_url":"https://avatars1.githubusercontent.com/u/26142226?v=4","gravatar_id":"","url":"https://api.github.com/users/rhpvorderman","html_url":"https://github.com/rhpvorderman","followers_url":"https://api.github.com/users/rhpvorderman/followers","following_url":"https://api.github.com/users/rhpvorderman/following{/other_user}","gists_url":"https://api.github.com/users/rhpvorderman/gists{/gist_id}","starred_url":"https://api.github.com/users/rhpvorderman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhpvorderman/subscriptions","organizations_url":"https://api.github.com/users/rhpvorderman/orgs","repos_url":"https://api.github.com/users/rhpvorderman/repos","events_url":"https://api.github.com/users/rhpvorderman/events{/privacy}","received_events_url":"https://api.github.com/users/rhpvorderman/received_events","type":"User","site_admin":false},"body":"### Description\r\n\r\n_Give your PR a **concise** yet **descriptive** title_\r\n\r\n----\r\n\r\n### Checklist (never delete this)\r\n\r\n- [ ] Each method/class/object/trait should have scaladocs\r\n- [ ] Added methods are unit tested\r\n- [ ] Test coverage may not drop\r\n- [ ] Documentation should be updated if required\r\n","created_at":"2018-08-15T13:52:00Z","updated_at":"2018-08-24T12:37:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"769f06f56f434f9a6a6e599ac155b44b18611cc2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/biopet/bamstats/pulls/9/commits","review_comments_url":"https://api.github.com/repos/biopet/bamstats/pulls/9/comments","review_comment_url":"https://api.github.com/repos/biopet/bamstats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biopet/bamstats/issues/9/comments","statuses_url":"https://api.github.com/repos/biopet/bamstats/statuses/a9edf391b6e001c035ad6cfa90bfc561063a6077","head":{"label":"biopet:BIOPET-1068","ref":"BIOPET-1068","sha":"a9edf391b6e001c035ad6cfa90bfc561063a6077","user":{"login":"biopet","id":12431254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDMxMjU0","avatar_url":"https://avatars1.githubusercontent.com/u/12431254?v=4","gravatar_id":"","url":"https://api.github.com/users/biopet","html_url":"https://github.com/biopet","followers_url":"https://api.github.com/users/biopet/followers","following_url":"https://api.github.com/users/biopet/following{/other_user}","gists_url":"https://api.github.com/users/biopet/gists{/gist_id}","starred_url":"https://api.github.com/users/biopet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biopet/subscriptions","organizations_url":"https://api.github.com/users/biopet/orgs","repos_url":"https://api.github.com/users/biopet/repos","events_url":"https://api.github.com/users/biopet/events{/privacy}","received_events_url":"https://api.github.com/users/biopet/received_events","type":"Organization","site_admin":false},"repo":{"id":106172440,"node_id":"MDEwOlJlcG9zaXRvcnkxMDYxNzI0NDA=","name":"bamstats","full_name":"biopet/bamstats","owner":{"login":"biopet","id":12431254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDMxMjU0","avatar_url":"https://avatars1.githubusercontent.com/u/12431254?v=4","gravatar_id":"","url":"https://api.github.com/users/biopet","html_url":"https://github.com/biopet","followers_url":"https://api.github.com/users/biopet/followers","following_url":"https://api.github.com/users/biopet/following{/other_user}","gists_url":"https://api.github.com/users/biopet/gists{/gist_id}","starred_url":"https://api.github.com/users/biopet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biopet/subscriptions","organizations_url":"https://api.github.com/users/biopet/orgs","repos_url":"https://api.github.com/users/biopet/repos","events_url":"https://api.github.com/users/biopet/events{/privacy}","received_events_url":"https://api.github.com/users/biopet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/biopet/bamstats","description":null,"fork":false,"url":"https://api.github.com/repos/biopet/bamstats","forks_url":"https://api.github.com/repos/biopet/bamstats/forks","keys_url":"https://api.github.com/repos/biopet/bamstats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biopet/bamstats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biopet/bamstats/teams","hooks_url":"https://api.github.com/repos/biopet/bamstats/hooks","issue_events_url":"https://api.github.com/repos/biopet/bamstats/issues/events{/number}","events_url":"https://api.github.com/repos/biopet/bamstats/events","assignees_url":"https://api.github.com/repos/biopet/bamstats/assignees{/user}","branches_url":"https://api.github.com/repos/biopet/bamstats/branches{/branch}","tags_url":"https://api.github.com/repos/biopet/bamstats/tags","blobs_url":"https://api.github.com/repos/biopet/bamstats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biopet/bamstats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biopet/bamstats/git/refs{/sha}","trees_url":"https://api.github.com/repos/biopet/bamstats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biopet/bamstats/statuses/{sha}","languages_url":"https://api.github.com/repos/biopet/bamstats/languages","stargazers_url":"https://api.github.com/repos/biopet/bamstats/stargazers","contributors_url":"https://api.github.com/repos/biopet/bamstats/contributors","subscribers_url":"https://api.github.com/repos/biopet/bamstats/subscribers","subscription_url":"https://api.github.com/repos/biopet/bamstats/subscription","commits_url":"https://api.github.com/repos/biopet/bamstats/commits{/sha}","git_commits_url":"https://api.github.com/repos/biopet/bamstats/git/commits{/sha}","comments_url":"https://api.github.com/repos/biopet/bamstats/comments{/number}","issue_comment_url":"https://api.github.com/repos/biopet/bamstats/issues/comments{/number}","contents_url":"https://api.github.com/repos/biopet/bamstats/contents/{+path}","compare_url":"https://api.github.com/repos/biopet/bamstats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biopet/bamstats/merges","archive_url":"https://api.github.com/repos/biopet/bamstats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biopet/bamstats/downloads","issues_url":"https://api.github.com/repos/biopet/bamstats/issues{/number}","pulls_url":"https://api.github.com/repos/biopet/bamstats/pulls{/number}","milestones_url":"https://api.github.com/repos/biopet/bamstats/milestones{/number}","notifications_url":"https://api.github.com/repos/biopet/bamstats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biopet/bamstats/labels{/name}","releases_url":"https://api.github.com/repos/biopet/bamstats/releases{/id}","deployments_url":"https://api.github.com/repos/biopet/bamstats/deployments","created_at":"2017-10-08T11:52:30Z","updated_at":"2018-07-16T11:22:47Z","pushed_at":"2018-08-24T11:56:33Z","git_url":"git://github.com/biopet/bamstats.git","ssh_url":"git@github.com:biopet/bamstats.git","clone_url":"https://github.com/biopet/bamstats.git","svn_url":"https://github.com/biopet/bamstats","homepage":null,"size":528,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"biopet:develop","ref":"develop","sha":"cfc5b0e95ad84817c5aa83ea8ee66048d702076d","user":{"login":"biopet","id":12431254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDMxMjU0","avatar_url":"https://avatars1.githubusercontent.com/u/12431254?v=4","gravatar_id":"","url":"https://api.github.com/users/biopet","html_url":"https://github.com/biopet","followers_url":"https://api.github.com/users/biopet/followers","following_url":"https://api.github.com/users/biopet/following{/other_user}","gists_url":"https://api.github.com/users/biopet/gists{/gist_id}","starred_url":"https://api.github.com/users/biopet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biopet/subscriptions","organizations_url":"https://api.github.com/users/biopet/orgs","repos_url":"https://api.github.com/users/biopet/repos","events_url":"https://api.github.com/users/biopet/events{/privacy}","received_events_url":"https://api.github.com/users/biopet/received_events","type":"Organization","site_admin":false},"repo":{"id":106172440,"node_id":"MDEwOlJlcG9zaXRvcnkxMDYxNzI0NDA=","name":"bamstats","full_name":"biopet/bamstats","owner":{"login":"biopet","id":12431254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDMxMjU0","avatar_url":"https://avatars1.githubusercontent.com/u/12431254?v=4","gravatar_id":"","url":"https://api.github.com/users/biopet","html_url":"https://github.com/biopet","followers_url":"https://api.github.com/users/biopet/followers","following_url":"https://api.github.com/users/biopet/following{/other_user}","gists_url":"https://api.github.com/users/biopet/gists{/gist_id}","starred_url":"https://api.github.com/users/biopet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biopet/subscriptions","organizations_url":"https://api.github.com/users/biopet/orgs","repos_url":"https://api.github.com/users/biopet/repos","events_url":"https://api.github.com/users/biopet/events{/privacy}","received_events_url":"https://api.github.com/users/biopet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/biopet/bamstats","description":null,"fork":false,"url":"https://api.github.com/repos/biopet/bamstats","forks_url":"https://api.github.com/repos/biopet/bamstats/forks","keys_url":"https://api.github.com/repos/biopet/bamstats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biopet/bamstats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biopet/bamstats/teams","hooks_url":"https://api.github.com/repos/biopet/bamstats/hooks","issue_events_url":"https://api.github.com/repos/biopet/bamstats/issues/events{/number}","events_url":"https://api.github.com/repos/biopet/bamstats/events","assignees_url":"https://api.github.com/repos/biopet/bamstats/assignees{/user}","branches_url":"https://api.github.com/repos/biopet/bamstats/branches{/branch}","tags_url":"https://api.github.com/repos/biopet/bamstats/tags","blobs_url":"https://api.github.com/repos/biopet/bamstats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biopet/bamstats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biopet/bamstats/git/refs{/sha}","trees_url":"https://api.github.com/repos/biopet/bamstats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biopet/bamstats/statuses/{sha}","languages_url":"https://api.github.com/repos/biopet/bamstats/languages","stargazers_url":"https://api.github.com/repos/biopet/bamstats/stargazers","contributors_url":"https://api.github.com/repos/biopet/bamstats/contributors","subscribers_url":"https://api.github.com/repos/biopet/bamstats/subscribers","subscription_url":"https://api.github.com/repos/biopet/bamstats/subscription","commits_url":"https://api.github.com/repos/biopet/bamstats/commits{/sha}","git_commits_url":"https://api.github.com/repos/biopet/bamstats/git/commits{/sha}","comments_url":"https://api.github.com/repos/biopet/bamstats/comments{/number}","issue_comment_url":"https://api.github.com/repos/biopet/bamstats/issues/comments{/number}","contents_url":"https://api.github.com/repos/biopet/bamstats/contents/{+path}","compare_url":"https://api.github.com/repos/biopet/bamstats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biopet/bamstats/merges","archive_url":"https://api.github.com/repos/biopet/bamstats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biopet/bamstats/downloads","issues_url":"https://api.github.com/repos/biopet/bamstats/issues{/number}","pulls_url":"https://api.github.com/repos/biopet/bamstats/pulls{/number}","milestones_url":"https://api.github.com/repos/biopet/bamstats/milestones{/number}","notifications_url":"https://api.github.com/repos/biopet/bamstats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biopet/bamstats/labels{/name}","releases_url":"https://api.github.com/repos/biopet/bamstats/releases{/id}","deployments_url":"https://api.github.com/repos/biopet/bamstats/deployments","created_at":"2017-10-08T11:52:30Z","updated_at":"2018-07-16T11:22:47Z","pushed_at":"2018-08-24T11:56:33Z","git_url":"git://github.com/biopet/bamstats.git","ssh_url":"git@github.com:biopet/bamstats.git","clone_url":"https://github.com/biopet/bamstats.git","svn_url":"https://github.com/biopet/bamstats","homepage":null,"size":528,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/biopet/bamstats/pulls/9"},"html":{"href":"https://github.com/biopet/bamstats/pull/9"},"issue":{"href":"https://api.github.com/repos/biopet/bamstats/issues/9"},"comments":{"href":"https://api.github.com/repos/biopet/bamstats/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/biopet/bamstats/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/biopet/bamstats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biopet/bamstats/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/biopet/bamstats/statuses/a9edf391b6e001c035ad6cfa90bfc561063a6077"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rhpvorderman"}}