GitHub PullRequestReviewCommentEvent at 2014-07-10 20:35:49
Repository: gamgee
Actor: MauricioCarneiro
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/gamgee/pulls/comments/14791506","id":14791506,"diff_hunk":"@@ -0,0 +1,77 @@\n+#include \"multiple_variant_iterator.h\"\n+\n+namespace gamgee {\n+\n+MultipleVariantIterator::MultipleVariantIterator() :\n+  m_queue {},\n+  m_variant_vector {}\n+{}\n+\n+MultipleVariantIterator::MultipleVariantIterator(const std::vector<vcfFile*> variant_files, const std::vector<const std::shared_ptr<bcf_hdr_t> > variant_headers) :\n+  m_queue {},\n+  m_variant_vector {}\n+{\n+  for (auto i = 0; i < variant_files.size(); i++) {\n+    m_queue.push(std::make_shared<VariantIterator>(variant_files[i], variant_headers[i]));\n+  }\n+  fetch_next_vector();\n+}\n+\n+MultipleVariantIterator::MultipleVariantIterator(MultipleVariantIterator&& original) :\n+  m_queue {std::move(original.m_queue)},\n+  m_variant_vector {std::move(original.m_variant_vector)}\n+{}\n+\n+std::vector<Variant>& MultipleVariantIterator::operator*() {\n+  return m_variant_vector;\n+}\n+\n+std::vector<Variant>& MultipleVariantIterator::operator++() {\n+  fetch_next_vector();\n+  return m_variant_vector;\n+}\n+\n+// NOTE: this method does the minimal work necessary to determine that we have reached the end of iteration\n+// it is NOT a valid general-purpose inequality method\n+bool MultipleVariantIterator::operator!=(const MultipleVariantIterator& rhs) {\n+  return !(m_variant_vector.empty() && rhs.m_variant_vector.empty());\n+}\n+\n+bool MultipleVariantIterator::Comparator::operator()(const shared_ptr<VariantIterator> left, const shared_ptr<VariantIterator> right) {\n+  if ((**left).chromosome() > (**right).chromosome())\n+    return true;\n+\n+  if ((**left).chromosome() < (**right).chromosome())\n+    return false;\n+\n+  return (**left).alignment_start() > (**right).alignment_start();\n+}\n+\n+void MultipleVariantIterator::fetch_next_vector() {\n+  m_variant_vector.clear();\n+  auto current_chrom = -1;\n+  auto current_start = -1;","path":"gamgee/multiple_variant_iterator.cpp","position":null,"original_position":53,"commit_id":"98caa1206e2809fe6ef87aa722d11ca18befaedc","original_commit_id":"b8f3d5fd59c4095c2621c6a00a9afb4ae077b866","user":{"login":"MauricioCarneiro","id":1843628,"avatar_url":"https://avatars.githubusercontent.com/u/1843628?","gravatar_id":"33e009132b1bc3c5bd7be7e0762d4c46","url":"https://api.github.com/users/MauricioCarneiro","html_url":"https://github.com/MauricioCarneiro","followers_url":"https://api.github.com/users/MauricioCarneiro/followers","following_url":"https://api.github.com/users/MauricioCarneiro/following{/other_user}","gists_url":"https://api.github.com/users/MauricioCarneiro/gists{/gist_id}","starred_url":"https://api.github.com/users/MauricioCarneiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MauricioCarneiro/subscriptions","organizations_url":"https://api.github.com/users/MauricioCarneiro/orgs","repos_url":"https://api.github.com/users/MauricioCarneiro/repos","events_url":"https://api.github.com/users/MauricioCarneiro/events{/privacy}","received_events_url":"https://api.github.com/users/MauricioCarneiro/received_events","type":"User","site_admin":false},"body":"shouldn't these be `uint32_t` to match the types of `chromosome()` and `alignment_start()` ?\r\n\r\n```\r\nauto current_chrom = 0u;\r\nauto current_start = 0u;\r\n```","created_at":"2014-07-10T20:35:49Z","updated_at":"2014-07-10T20:35:49Z","html_url":"https://github.com/broadinstitute/gamgee/pull/118#discussion_r14791506","pull_request_url":"https://api.github.com/repos/broadinstitute/gamgee/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/gamgee/pulls/comments/14791506"},"html":{"href":"https://github.com/broadinstitute/gamgee/pull/118#discussion_r14791506"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/gamgee/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/gamgee/pulls/118","id":18240912,"html_url":"https://github.com/broadinstitute/gamgee/pull/118","diff_url":"https://github.com/broadinstitute/gamgee/pull/118.diff","patch_url":"https://github.com/broadinstitute/gamgee/pull/118.patch","issue_url":"https://api.github.com/repos/broadinstitute/gamgee/issues/118","number":118,"state":"open","title":"MultipleVariantReader and MultipleVariantIterator","user":{"login":"jmthibault79","id":2701406,"avatar_url":"https://avatars.githubusercontent.com/u/2701406?","gravatar_id":"4f28b8eff56e587100c8917ec0ac5b03","url":"https://api.github.com/users/jmthibault79","html_url":"https://github.com/jmthibault79","followers_url":"https://api.github.com/users/jmthibault79/followers","following_url":"https://api.github.com/users/jmthibault79/following{/other_user}","gists_url":"https://api.github.com/users/jmthibault79/gists{/gist_id}","starred_url":"https://api.github.com/users/jmthibault79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmthibault79/subscriptions","organizations_url":"https://api.github.com/users/jmthibault79/orgs","repos_url":"https://api.github.com/users/jmthibault79/repos","events_url":"https://api.github.com/users/jmthibault79/events{/privacy}","received_events_url":"https://api.github.com/users/jmthibault79/received_events","type":"User","site_admin":false},"body":"Enables iteration over multiple input files, returning a vector of Variant objects per genomic location.\r\n\r\nThe vector is reused per location, so the caller must complete processing before continuing iteration, or make a copy.\r\n\r\nStrongly inspired by the example of VariantReader/VariantIterator.  Merging these Readers or Iterators may be appropriate.\r\n\r\nThis is an alternative solution to Issue #76 ","created_at":"2014-07-10T19:29:04Z","updated_at":"2014-07-10T20:35:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"090e5c8673455274863c4f2ea254281ec92e988e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/gamgee/pulls/118/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/gamgee/pulls/118/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/gamgee/pulls/comments/{number}","comments_url":"https://api.github.com/repos/broadinstitute/gamgee/issues/118/comments","statuses_url":"https://api.github.com/repos/broadinstitute/gamgee/statuses/98caa1206e2809fe6ef87aa722d11ca18befaedc","head":{"label":"broadinstitute:jt_pqueue","ref":"jt_pqueue","sha":"98caa1206e2809fe6ef87aa722d11ca18befaedc","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?","gravatar_id":"15796050d34835c57c1cf412d45b9c0c","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":17992711,"name":"gamgee","full_name":"broadinstitute/gamgee","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?","gravatar_id":"15796050d34835c57c1cf412d45b9c0c","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/gamgee","description":"A C++ interface for HTSLIB (samtools/htslib)","fork":false,"url":"https://api.github.com/repos/broadinstitute/gamgee","forks_url":"https://api.github.com/repos/broadinstitute/gamgee/forks","keys_url":"https://api.github.com/repos/broadinstitute/gamgee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/gamgee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/gamgee/teams","hooks_url":"https://api.github.com/repos/broadinstitute/gamgee/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/gamgee/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/gamgee/events","assignees_url":"https://api.github.com/repos/broadinstitute/gamgee/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/gamgee/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/gamgee/tags","blobs_url":"https://api.github.com/repos/broadinstitute/gamgee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/gamgee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/gamgee/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/gamgee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/gamgee/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/gamgee/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/gamgee/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/gamgee/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/gamgee/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/gamgee/subscription","commits_url":"https://api.github.com/repos/broadinstitute/gamgee/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/gamgee/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/gamgee/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/gamgee/issues/comments/{number}","contents_url":"https://api.github.com/repos/broadinstitute/gamgee/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/gamgee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/gamgee/merges","archive_url":"https://api.github.com/repos/broadinstitute/gamgee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/gamgee/downloads","issues_url":"https://api.github.com/repos/broadinstitute/gamgee/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/gamgee/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/gamgee/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/gamgee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/gamgee/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/gamgee/releases{/id}","created_at":"2014-03-21T20:04:04Z","updated_at":"2014-06-28T01:38:52Z","pushed_at":"2014-07-10T20:00:13Z","git_url":"git://github.com/broadinstitute/gamgee.git","ssh_url":"git@github.com:broadinstitute/gamgee.git","clone_url":"https://github.com/broadinstitute/gamgee.git","svn_url":"https://github.com/broadinstitute/gamgee","homepage":null,"size":23043,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":3,"mirror_url":null,"open_issues_count":32,"forks":3,"open_issues":32,"watchers":2,"default_branch":"master"}},"base":{"label":"broadinstitute:master","ref":"master","sha":"cdafadae4dab7ad937654b12cb1dca78667a1ef7","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?","gravatar_id":"15796050d34835c57c1cf412d45b9c0c","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":17992711,"name":"gamgee","full_name":"broadinstitute/gamgee","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?","gravatar_id":"15796050d34835c57c1cf412d45b9c0c","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/gamgee","description":"A C++ interface for HTSLIB (samtools/htslib)","fork":false,"url":"https://api.github.com/repos/broadinstitute/gamgee","forks_url":"https://api.github.com/repos/broadinstitute/gamgee/forks","keys_url":"https://api.github.com/repos/broadinstitute/gamgee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/gamgee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/gamgee/teams","hooks_url":"https://api.github.com/repos/broadinstitute/gamgee/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/gamgee/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/gamgee/events","assignees_url":"https://api.github.com/repos/broadinstitute/gamgee/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/gamgee/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/gamgee/tags","blobs_url":"https://api.github.com/repos/broadinstitute/gamgee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/gamgee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/gamgee/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/gamgee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/gamgee/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/gamgee/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/gamgee/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/gamgee/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/gamgee/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/gamgee/subscription","commits_url":"https://api.github.com/repos/broadinstitute/gamgee/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/gamgee/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/gamgee/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/gamgee/issues/comments/{number}","contents_url":"https://api.github.com/repos/broadinstitute/gamgee/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/gamgee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/gamgee/merges","archive_url":"https://api.github.com/repos/broadinstitute/gamgee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/gamgee/downloads","issues_url":"https://api.github.com/repos/broadinstitute/gamgee/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/gamgee/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/gamgee/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/gamgee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/gamgee/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/gamgee/releases{/id}","created_at":"2014-03-21T20:04:04Z","updated_at":"2014-06-28T01:38:52Z","pushed_at":"2014-07-10T20:00:13Z","git_url":"git://github.com/broadinstitute/gamgee.git","ssh_url":"git@github.com:broadinstitute/gamgee.git","clone_url":"https://github.com/broadinstitute/gamgee.git","svn_url":"https://github.com/broadinstitute/gamgee","homepage":null,"size":23043,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":3,"mirror_url":null,"open_issues_count":32,"forks":3,"open_issues":32,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/gamgee/pulls/118"},"html":{"href":"https://github.com/broadinstitute/gamgee/pull/118"},"issue":{"href":"https://api.github.com/repos/broadinstitute/gamgee/issues/118"},"comments":{"href":"https://api.github.com/repos/broadinstitute/gamgee/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/gamgee/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/gamgee/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/gamgee/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/gamgee/statuses/98caa1206e2809fe6ef87aa722d11ca18befaedc"}}}}