{"action":"created","comment":{"url":"https://api.github.com/repos/samtools/htsjdk/pulls/comments/80895126","pull_request_review_id":1915137,"id":80895126,"diff_hunk":"@@ -91,24 +87,17 @@ public byte getReadBase() {\n     }\n \n     /**\n-     * @return the base quality according to <code>offset</code>.\n-     */\n-    public byte getBaseQuality() {\n-        return record.getBaseQualities()[offset];\n-    }\n-\n-    /**\n      * @return the length of alignment block represented by the object.\n      */\n     public int getLength() {\n-        return length;\n+        return 1;\n     }\n \n     /**\n      * @return the position in reference sequence, to which the start of alignment block is aligned.\n      */\n     public int getRefPos() {\n-        return refPos;\n+        return 0;","path":"src/main/java/htsjdk/samtools/util/AbstractRecordAndOffset.java","position":null,"original_position":87,"commit_id":"1f05490670cf316fc52071f83887d669e9f7b60f","original_commit_id":"322c85298495f1b16d8acede2c56cdb72662f427","user":{"login":"jabbarish","id":9678318,"avatar_url":"https://avatars.githubusercontent.com/u/9678318?v=3","gravatar_id":"","url":"https://api.github.com/users/jabbarish","html_url":"https://github.com/jabbarish","followers_url":"https://api.github.com/users/jabbarish/followers","following_url":"https://api.github.com/users/jabbarish/following{/other_user}","gists_url":"https://api.github.com/users/jabbarish/gists{/gist_id}","starred_url":"https://api.github.com/users/jabbarish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabbarish/subscriptions","organizations_url":"https://api.github.com/users/jabbarish/orgs","repos_url":"https://api.github.com/users/jabbarish/repos","events_url":"https://api.github.com/users/jabbarish/events{/privacy}","received_events_url":"https://api.github.com/users/jabbarish/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2016-09-28T11:28:48Z","updated_at":"2016-09-28T11:28:48Z","html_url":"https://github.com/samtools/htsjdk/pull/637#discussion_r80895126","pull_request_url":"https://api.github.com/repos/samtools/htsjdk/pulls/637","_links":{"self":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/comments/80895126"},"html":{"href":"https://github.com/samtools/htsjdk/pull/637#discussion_r80895126"},"pull_request":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/637"}}},"pull_request":{"url":"https://api.github.com/repos/samtools/htsjdk/pulls/637","id":72604210,"html_url":"https://github.com/samtools/htsjdk/pull/637","diff_url":"https://github.com/samtools/htsjdk/pull/637.diff","patch_url":"https://github.com/samtools/htsjdk/pull/637.patch","issue_url":"https://api.github.com/repos/samtools/htsjdk/issues/637","number":637,"state":"open","locked":false,"title":"new algorithm for locus iteration and Picard's CollectWgsMetrics","user":{"login":"jabbarish","id":9678318,"avatar_url":"https://avatars.githubusercontent.com/u/9678318?v=3","gravatar_id":"","url":"https://api.github.com/users/jabbarish","html_url":"https://github.com/jabbarish","followers_url":"https://api.github.com/users/jabbarish/followers","following_url":"https://api.github.com/users/jabbarish/following{/other_user}","gists_url":"https://api.github.com/users/jabbarish/gists{/gist_id}","starred_url":"https://api.github.com/users/jabbarish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabbarish/subscriptions","organizations_url":"https://api.github.com/users/jabbarish/orgs","repos_url":"https://api.github.com/users/jabbarish/repos","events_url":"https://api.github.com/users/jabbarish/events{/privacy}","received_events_url":"https://api.github.com/users/jabbarish/received_events","type":"User","site_admin":false},"body":"### Description\r\n\r\nWe propose the following changes to Htsjdk to optimize CollectWgsMetrics work  in Picard tools:\r\nSamLocusIterator traverses the input BAM file and creates for each reference locus position a list of aligned to this position bases. Each aligned read base is represented as one object, thus, if read has length of alignments blocks of L, then L objects will be created. All in all, for a BAM file holding N reads, O(N * L) objects will be created.\r\n\r\nOur idea is not to represent each aligned read base as a single object, but to create objects only for the start and the end of each aligned block of a read. In this way, number of created objects is reduced to O(N * M) (N = number of reads, M = number of alignment blocks of a read). Usually M is much smaller (~ 1 – 5 per read), than length of aligned blocks.\r\n\r\nIn order to implement this approach we made some refactoring:\r\n1.\tAbstract class AbstractLcusIterator was extracted from SamLocusIterator to provide common interface and opportunity to override SAMRecord accumulation.\r\n2.\tClasses AbstractLocusInfo and AbstractRecordAndOffset also were extracted from inner classes of SamLocusIterator to allow their extending\r\n3.\tClass SamLocusIterator still represents the default algorithm for methods accumulateSamRecord() and accumulateIndels()\r\n4.\tClasses ReadEndsIterator and TypedRecordAndOffset implement our new approach. \r\n\r\nThese changes are backward compatible: all classes, that use SamLocusIterator and its inner classes SamLocusIterator.RecordAndOffset and SamLocusIterator.LocusInfo will work the same without any adaptation. \r\n\r\n### Checklist\r\n\r\n- [X] Code compiles correctly\r\n- [X] New tests covering changes and new functionality\r\n- [X] All tests passing\r\n- [ ] Extended the README / documentation, if necessary\r\n- [ ] Is not backward compatible (breaks binary or source compatibility)\r\n\r\n","created_at":"2016-06-04T14:48:39Z","updated_at":"2016-09-28T11:28:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ffaf54ae9cb23064f2029dbc4e424b296c244880","assignee":{"login":"yfarjoun","id":2745554,"avatar_url":"https://avatars.githubusercontent.com/u/2745554?v=3","gravatar_id":"","url":"https://api.github.com/users/yfarjoun","html_url":"https://github.com/yfarjoun","followers_url":"https://api.github.com/users/yfarjoun/followers","following_url":"https://api.github.com/users/yfarjoun/following{/other_user}","gists_url":"https://api.github.com/users/yfarjoun/gists{/gist_id}","starred_url":"https://api.github.com/users/yfarjoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yfarjoun/subscriptions","organizations_url":"https://api.github.com/users/yfarjoun/orgs","repos_url":"https://api.github.com/users/yfarjoun/repos","events_url":"https://api.github.com/users/yfarjoun/events{/privacy}","received_events_url":"https://api.github.com/users/yfarjoun/received_events","type":"User","site_admin":false},"assignees":[{"login":"yfarjoun","id":2745554,"avatar_url":"https://avatars.githubusercontent.com/u/2745554?v=3","gravatar_id":"","url":"https://api.github.com/users/yfarjoun","html_url":"https://github.com/yfarjoun","followers_url":"https://api.github.com/users/yfarjoun/followers","following_url":"https://api.github.com/users/yfarjoun/following{/other_user}","gists_url":"https://api.github.com/users/yfarjoun/gists{/gist_id}","starred_url":"https://api.github.com/users/yfarjoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yfarjoun/subscriptions","organizations_url":"https://api.github.com/users/yfarjoun/orgs","repos_url":"https://api.github.com/users/yfarjoun/repos","events_url":"https://api.github.com/users/yfarjoun/events{/privacy}","received_events_url":"https://api.github.com/users/yfarjoun/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/samtools/htsjdk/pulls/637/commits","review_comments_url":"https://api.github.com/repos/samtools/htsjdk/pulls/637/comments","review_comment_url":"https://api.github.com/repos/samtools/htsjdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/samtools/htsjdk/issues/637/comments","statuses_url":"https://api.github.com/repos/samtools/htsjdk/statuses/1f05490670cf316fc52071f83887d669e9f7b60f","head":{"label":"jabbarish:zl_refactor_SamLocusIterator_for_wgs","ref":"zl_refactor_SamLocusIterator_for_wgs","sha":"1f05490670cf316fc52071f83887d669e9f7b60f","user":{"login":"jabbarish","id":9678318,"avatar_url":"https://avatars.githubusercontent.com/u/9678318?v=3","gravatar_id":"","url":"https://api.github.com/users/jabbarish","html_url":"https://github.com/jabbarish","followers_url":"https://api.github.com/users/jabbarish/followers","following_url":"https://api.github.com/users/jabbarish/following{/other_user}","gists_url":"https://api.github.com/users/jabbarish/gists{/gist_id}","starred_url":"https://api.github.com/users/jabbarish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabbarish/subscriptions","organizations_url":"https://api.github.com/users/jabbarish/orgs","repos_url":"https://api.github.com/users/jabbarish/repos","events_url":"https://api.github.com/users/jabbarish/events{/privacy}","received_events_url":"https://api.github.com/users/jabbarish/received_events","type":"User","site_admin":false},"repo":{"id":46128958,"name":"htsjdk","full_name":"jabbarish/htsjdk","owner":{"login":"jabbarish","id":9678318,"avatar_url":"https://avatars.githubusercontent.com/u/9678318?v=3","gravatar_id":"","url":"https://api.github.com/users/jabbarish","html_url":"https://github.com/jabbarish","followers_url":"https://api.github.com/users/jabbarish/followers","following_url":"https://api.github.com/users/jabbarish/following{/other_user}","gists_url":"https://api.github.com/users/jabbarish/gists{/gist_id}","starred_url":"https://api.github.com/users/jabbarish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabbarish/subscriptions","organizations_url":"https://api.github.com/users/jabbarish/orgs","repos_url":"https://api.github.com/users/jabbarish/repos","events_url":"https://api.github.com/users/jabbarish/events{/privacy}","received_events_url":"https://api.github.com/users/jabbarish/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jabbarish/htsjdk","description":"A Java API for high-throughput sequencing data (HTS) formats.","fork":true,"url":"https://api.github.com/repos/jabbarish/htsjdk","forks_url":"https://api.github.com/repos/jabbarish/htsjdk/forks","keys_url":"https://api.github.com/repos/jabbarish/htsjdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jabbarish/htsjdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jabbarish/htsjdk/teams","hooks_url":"https://api.github.com/repos/jabbarish/htsjdk/hooks","issue_events_url":"https://api.github.com/repos/jabbarish/htsjdk/issues/events{/number}","events_url":"https://api.github.com/repos/jabbarish/htsjdk/events","assignees_url":"https://api.github.com/repos/jabbarish/htsjdk/assignees{/user}","branches_url":"https://api.github.com/repos/jabbarish/htsjdk/branches{/branch}","tags_url":"https://api.github.com/repos/jabbarish/htsjdk/tags","blobs_url":"https://api.github.com/repos/jabbarish/htsjdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jabbarish/htsjdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jabbarish/htsjdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/jabbarish/htsjdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jabbarish/htsjdk/statuses/{sha}","languages_url":"https://api.github.com/repos/jabbarish/htsjdk/languages","stargazers_url":"https://api.github.com/repos/jabbarish/htsjdk/stargazers","contributors_url":"https://api.github.com/repos/jabbarish/htsjdk/contributors","subscribers_url":"https://api.github.com/repos/jabbarish/htsjdk/subscribers","subscription_url":"https://api.github.com/repos/jabbarish/htsjdk/subscription","commits_url":"https://api.github.com/repos/jabbarish/htsjdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/jabbarish/htsjdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/jabbarish/htsjdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/jabbarish/htsjdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/jabbarish/htsjdk/contents/{+path}","compare_url":"https://api.github.com/repos/jabbarish/htsjdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jabbarish/htsjdk/merges","archive_url":"https://api.github.com/repos/jabbarish/htsjdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jabbarish/htsjdk/downloads","issues_url":"https://api.github.com/repos/jabbarish/htsjdk/issues{/number}","pulls_url":"https://api.github.com/repos/jabbarish/htsjdk/pulls{/number}","milestones_url":"https://api.github.com/repos/jabbarish/htsjdk/milestones{/number}","notifications_url":"https://api.github.com/repos/jabbarish/htsjdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jabbarish/htsjdk/labels{/name}","releases_url":"https://api.github.com/repos/jabbarish/htsjdk/releases{/id}","deployments_url":"https://api.github.com/repos/jabbarish/htsjdk/deployments","created_at":"2015-11-13T15:12:07Z","updated_at":"2016-01-14T15:18:21Z","pushed_at":"2016-09-28T11:08:01Z","git_url":"git://github.com/jabbarish/htsjdk.git","ssh_url":"git@github.com:jabbarish/htsjdk.git","clone_url":"https://github.com/jabbarish/htsjdk.git","svn_url":"https://github.com/jabbarish/htsjdk","homepage":"http://samtools.github.io/htsjdk/","size":61119,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"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":"samtools:master","ref":"master","sha":"c3d5a884869d4f83b7b8eab37c7153c2576b2c63","user":{"login":"samtools","id":1518450,"avatar_url":"https://avatars.githubusercontent.com/u/1518450?v=3","gravatar_id":"","url":"https://api.github.com/users/samtools","html_url":"https://github.com/samtools","followers_url":"https://api.github.com/users/samtools/followers","following_url":"https://api.github.com/users/samtools/following{/other_user}","gists_url":"https://api.github.com/users/samtools/gists{/gist_id}","starred_url":"https://api.github.com/users/samtools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samtools/subscriptions","organizations_url":"https://api.github.com/users/samtools/orgs","repos_url":"https://api.github.com/users/samtools/repos","events_url":"https://api.github.com/users/samtools/events{/privacy}","received_events_url":"https://api.github.com/users/samtools/received_events","type":"Organization","site_admin":false},"repo":{"id":19272315,"name":"htsjdk","full_name":"samtools/htsjdk","owner":{"login":"samtools","id":1518450,"avatar_url":"https://avatars.githubusercontent.com/u/1518450?v=3","gravatar_id":"","url":"https://api.github.com/users/samtools","html_url":"https://github.com/samtools","followers_url":"https://api.github.com/users/samtools/followers","following_url":"https://api.github.com/users/samtools/following{/other_user}","gists_url":"https://api.github.com/users/samtools/gists{/gist_id}","starred_url":"https://api.github.com/users/samtools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samtools/subscriptions","organizations_url":"https://api.github.com/users/samtools/orgs","repos_url":"https://api.github.com/users/samtools/repos","events_url":"https://api.github.com/users/samtools/events{/privacy}","received_events_url":"https://api.github.com/users/samtools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/samtools/htsjdk","description":"A Java API for high-throughput sequencing data (HTS) formats.","fork":false,"url":"https://api.github.com/repos/samtools/htsjdk","forks_url":"https://api.github.com/repos/samtools/htsjdk/forks","keys_url":"https://api.github.com/repos/samtools/htsjdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samtools/htsjdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samtools/htsjdk/teams","hooks_url":"https://api.github.com/repos/samtools/htsjdk/hooks","issue_events_url":"https://api.github.com/repos/samtools/htsjdk/issues/events{/number}","events_url":"https://api.github.com/repos/samtools/htsjdk/events","assignees_url":"https://api.github.com/repos/samtools/htsjdk/assignees{/user}","branches_url":"https://api.github.com/repos/samtools/htsjdk/branches{/branch}","tags_url":"https://api.github.com/repos/samtools/htsjdk/tags","blobs_url":"https://api.github.com/repos/samtools/htsjdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samtools/htsjdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samtools/htsjdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/samtools/htsjdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samtools/htsjdk/statuses/{sha}","languages_url":"https://api.github.com/repos/samtools/htsjdk/languages","stargazers_url":"https://api.github.com/repos/samtools/htsjdk/stargazers","contributors_url":"https://api.github.com/repos/samtools/htsjdk/contributors","subscribers_url":"https://api.github.com/repos/samtools/htsjdk/subscribers","subscription_url":"https://api.github.com/repos/samtools/htsjdk/subscription","commits_url":"https://api.github.com/repos/samtools/htsjdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/samtools/htsjdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/samtools/htsjdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/samtools/htsjdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/samtools/htsjdk/contents/{+path}","compare_url":"https://api.github.com/repos/samtools/htsjdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samtools/htsjdk/merges","archive_url":"https://api.github.com/repos/samtools/htsjdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samtools/htsjdk/downloads","issues_url":"https://api.github.com/repos/samtools/htsjdk/issues{/number}","pulls_url":"https://api.github.com/repos/samtools/htsjdk/pulls{/number}","milestones_url":"https://api.github.com/repos/samtools/htsjdk/milestones{/number}","notifications_url":"https://api.github.com/repos/samtools/htsjdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samtools/htsjdk/labels{/name}","releases_url":"https://api.github.com/repos/samtools/htsjdk/releases{/id}","deployments_url":"https://api.github.com/repos/samtools/htsjdk/deployments","created_at":"2014-04-29T10:11:28Z","updated_at":"2016-09-21T21:54:23Z","pushed_at":"2016-09-28T11:19:21Z","git_url":"git://github.com/samtools/htsjdk.git","ssh_url":"git@github.com:samtools/htsjdk.git","clone_url":"https://github.com/samtools/htsjdk.git","svn_url":"https://github.com/samtools/htsjdk","homepage":"http://samtools.github.io/htsjdk/","size":70219,"stargazers_count":95,"watchers_count":95,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":130,"mirror_url":null,"open_issues_count":127,"forks":130,"open_issues":127,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/637"},"html":{"href":"https://github.com/samtools/htsjdk/pull/637"},"issue":{"href":"https://api.github.com/repos/samtools/htsjdk/issues/637"},"comments":{"href":"https://api.github.com/repos/samtools/htsjdk/issues/637/comments"},"review_comments":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/637/comments"},"review_comment":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/637/commits"},"statuses":{"href":"https://api.github.com/repos/samtools/htsjdk/statuses/1f05490670cf316fc52071f83887d669e9f7b60f"}}}}
{"actor":{"display_login":"jabbarish"}}