{"action":"created","comment":{"url":"https://api.github.com/repos/samtools/htsjdk/pulls/comments/79131269","id":79131269,"diff_hunk":"@@ -112,4 +117,45 @@ public void testCreateTabixIndexOnBlockCompressed() {\n                     \"Tabix indexed (bgzipped) VCF does not contain sequence: \" + samSequenceRecord.getSequenceName());\n         }\n     }\n+\n+    @Test\n+    public void testWriteIndex() throws Exception {\n+        // temp directory for this test\n+        final File tempDir = IOUtil.createTempDir(\"writeIndex\", null);\n+\n+        final OutputStream nullOutputStrem = new OutputStream() {\n+            @Override\n+            public void write(int b) throws IOException {\n+\n+            }\n+        };\n+\n+        // LINEAR INDEX\n+        final File inputFileVcf =\n+                new File(\"src/test/resources/htsjdk/tribble/tabix/testTabixIndex.vcf\");\n+        final LinearIndex linearIndex =\n+                IndexFactory.createLinearIndex(inputFileVcf, new VCFCodec());\n+        // write to a file\n+        final File tempLineraIndex = new File(tempDir, \"linearIndex.idx\");\n+        Assert.assertFalse(tempLineraIndex.exists());\n+        linearIndex.write(tempLineraIndex);\n+        Assert.assertTrue(tempLineraIndex.exists());\n+        // write to an stream does not thrown an error\n+        linearIndex.write(new LittleEndianOutputStream(nullOutputStrem));\n+\n+        // TABIX INDEX\n+        final File inputFileVcfGz =\n+                new File(\"src/test/resources/htsjdk/tribble/tabix/testTabixIndex.vcf.gz\");\n+        final TabixIndex tabixIndexVcfGz =\n+                IndexFactory\n+                        .createTabixIndex(inputFileVcfGz, new VCFCodec(), TabixFormat.VCF, null);\n+        // wirte to a file","path":"src/test/java/htsjdk/tribble/index/IndexFactoryTest.java","position":60,"original_position":60,"commit_id":"39a45ce452d405ee29b9a34eecab1f7fd0111ee1","original_commit_id":"39a45ce452d405ee29b9a34eecab1f7fd0111ee1","user":{"login":"magicDGS","id":7352559,"avatar_url":"https://avatars.githubusercontent.com/u/7352559?v=3","gravatar_id":"","url":"https://api.github.com/users/magicDGS","html_url":"https://github.com/magicDGS","followers_url":"https://api.github.com/users/magicDGS/followers","following_url":"https://api.github.com/users/magicDGS/following{/other_user}","gists_url":"https://api.github.com/users/magicDGS/gists{/gist_id}","starred_url":"https://api.github.com/users/magicDGS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicDGS/subscriptions","organizations_url":"https://api.github.com/users/magicDGS/orgs","repos_url":"https://api.github.com/users/magicDGS/repos","events_url":"https://api.github.com/users/magicDGS/events{/privacy}","received_events_url":"https://api.github.com/users/magicDGS/received_events","type":"User","site_admin":false},"body":"Changed in the new test.","created_at":"2016-09-16T09:03:07Z","updated_at":"2016-09-16T09:03:07Z","html_url":"https://github.com/samtools/htsjdk/pull/683#discussion_r79131269","pull_request_url":"https://api.github.com/repos/samtools/htsjdk/pulls/683","_links":{"self":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/comments/79131269"},"html":{"href":"https://github.com/samtools/htsjdk/pull/683#discussion_r79131269"},"pull_request":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/683"}}},"pull_request":{"url":"https://api.github.com/repos/samtools/htsjdk/pulls/683","id":81098423,"html_url":"https://github.com/samtools/htsjdk/pull/683","diff_url":"https://github.com/samtools/htsjdk/pull/683.diff","patch_url":"https://github.com/samtools/htsjdk/pull/683.patch","issue_url":"https://api.github.com/repos/samtools/htsjdk/issues/683","number":683,"state":"open","locked":false,"title":"Fix IndexFactory.writeIndex for tabix indexes","user":{"login":"magicDGS","id":7352559,"avatar_url":"https://avatars.githubusercontent.com/u/7352559?v=3","gravatar_id":"","url":"https://api.github.com/users/magicDGS","html_url":"https://github.com/magicDGS","followers_url":"https://api.github.com/users/magicDGS/followers","following_url":"https://api.github.com/users/magicDGS/following{/other_user}","gists_url":"https://api.github.com/users/magicDGS/gists{/gist_id}","starred_url":"https://api.github.com/users/magicDGS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicDGS/subscriptions","organizations_url":"https://api.github.com/users/magicDGS/orgs","repos_url":"https://api.github.com/users/magicDGS/repos","events_url":"https://api.github.com/users/magicDGS/events{/privacy}","received_events_url":"https://api.github.com/users/magicDGS/received_events","type":"User","site_admin":false},"body":"\r\n\r\n\r\n","created_at":"2016-08-12T10:28:56Z","updated_at":"2016-09-16T09:03:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a84f92d0db2aac8608ea801f3efea67d809a72c","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/683/commits","review_comments_url":"https://api.github.com/repos/samtools/htsjdk/pulls/683/comments","review_comment_url":"https://api.github.com/repos/samtools/htsjdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/samtools/htsjdk/issues/683/comments","statuses_url":"https://api.github.com/repos/samtools/htsjdk/statuses/39a45ce452d405ee29b9a34eecab1f7fd0111ee1","head":{"label":"magicDGS:dgs_issue_430","ref":"dgs_issue_430","sha":"39a45ce452d405ee29b9a34eecab1f7fd0111ee1","user":{"login":"magicDGS","id":7352559,"avatar_url":"https://avatars.githubusercontent.com/u/7352559?v=3","gravatar_id":"","url":"https://api.github.com/users/magicDGS","html_url":"https://github.com/magicDGS","followers_url":"https://api.github.com/users/magicDGS/followers","following_url":"https://api.github.com/users/magicDGS/following{/other_user}","gists_url":"https://api.github.com/users/magicDGS/gists{/gist_id}","starred_url":"https://api.github.com/users/magicDGS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicDGS/subscriptions","organizations_url":"https://api.github.com/users/magicDGS/orgs","repos_url":"https://api.github.com/users/magicDGS/repos","events_url":"https://api.github.com/users/magicDGS/events{/privacy}","received_events_url":"https://api.github.com/users/magicDGS/received_events","type":"User","site_admin":false},"repo":{"id":48030342,"name":"htsjdk","full_name":"magicDGS/htsjdk","owner":{"login":"magicDGS","id":7352559,"avatar_url":"https://avatars.githubusercontent.com/u/7352559?v=3","gravatar_id":"","url":"https://api.github.com/users/magicDGS","html_url":"https://github.com/magicDGS","followers_url":"https://api.github.com/users/magicDGS/followers","following_url":"https://api.github.com/users/magicDGS/following{/other_user}","gists_url":"https://api.github.com/users/magicDGS/gists{/gist_id}","starred_url":"https://api.github.com/users/magicDGS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicDGS/subscriptions","organizations_url":"https://api.github.com/users/magicDGS/orgs","repos_url":"https://api.github.com/users/magicDGS/repos","events_url":"https://api.github.com/users/magicDGS/events{/privacy}","received_events_url":"https://api.github.com/users/magicDGS/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/magicDGS/htsjdk","description":"A Java API for high-throughput sequencing data (HTS) formats.","fork":true,"url":"https://api.github.com/repos/magicDGS/htsjdk","forks_url":"https://api.github.com/repos/magicDGS/htsjdk/forks","keys_url":"https://api.github.com/repos/magicDGS/htsjdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magicDGS/htsjdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magicDGS/htsjdk/teams","hooks_url":"https://api.github.com/repos/magicDGS/htsjdk/hooks","issue_events_url":"https://api.github.com/repos/magicDGS/htsjdk/issues/events{/number}","events_url":"https://api.github.com/repos/magicDGS/htsjdk/events","assignees_url":"https://api.github.com/repos/magicDGS/htsjdk/assignees{/user}","branches_url":"https://api.github.com/repos/magicDGS/htsjdk/branches{/branch}","tags_url":"https://api.github.com/repos/magicDGS/htsjdk/tags","blobs_url":"https://api.github.com/repos/magicDGS/htsjdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magicDGS/htsjdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magicDGS/htsjdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/magicDGS/htsjdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magicDGS/htsjdk/statuses/{sha}","languages_url":"https://api.github.com/repos/magicDGS/htsjdk/languages","stargazers_url":"https://api.github.com/repos/magicDGS/htsjdk/stargazers","contributors_url":"https://api.github.com/repos/magicDGS/htsjdk/contributors","subscribers_url":"https://api.github.com/repos/magicDGS/htsjdk/subscribers","subscription_url":"https://api.github.com/repos/magicDGS/htsjdk/subscription","commits_url":"https://api.github.com/repos/magicDGS/htsjdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/magicDGS/htsjdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/magicDGS/htsjdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/magicDGS/htsjdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/magicDGS/htsjdk/contents/{+path}","compare_url":"https://api.github.com/repos/magicDGS/htsjdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magicDGS/htsjdk/merges","archive_url":"https://api.github.com/repos/magicDGS/htsjdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magicDGS/htsjdk/downloads","issues_url":"https://api.github.com/repos/magicDGS/htsjdk/issues{/number}","pulls_url":"https://api.github.com/repos/magicDGS/htsjdk/pulls{/number}","milestones_url":"https://api.github.com/repos/magicDGS/htsjdk/milestones{/number}","notifications_url":"https://api.github.com/repos/magicDGS/htsjdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magicDGS/htsjdk/labels{/name}","releases_url":"https://api.github.com/repos/magicDGS/htsjdk/releases{/id}","deployments_url":"https://api.github.com/repos/magicDGS/htsjdk/deployments","created_at":"2015-12-15T08:41:11Z","updated_at":"2016-04-15T11:54:20Z","pushed_at":"2016-09-15T16:25:52Z","git_url":"git://github.com/magicDGS/htsjdk.git","ssh_url":"git@github.com:magicDGS/htsjdk.git","clone_url":"https://github.com/magicDGS/htsjdk.git","svn_url":"https://github.com/magicDGS/htsjdk","homepage":"http://samtools.github.io/htsjdk/","size":62433,"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-14T06:35:04Z","pushed_at":"2016-09-15T16:13:12Z","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":70203,"stargazers_count":94,"watchers_count":94,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":130,"mirror_url":null,"open_issues_count":138,"forks":130,"open_issues":138,"watchers":94,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/683"},"html":{"href":"https://github.com/samtools/htsjdk/pull/683"},"issue":{"href":"https://api.github.com/repos/samtools/htsjdk/issues/683"},"comments":{"href":"https://api.github.com/repos/samtools/htsjdk/issues/683/comments"},"review_comments":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/683/comments"},"review_comment":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/683/commits"},"statuses":{"href":"https://api.github.com/repos/samtools/htsjdk/statuses/39a45ce452d405ee29b9a34eecab1f7fd0111ee1"}}}}
{"actor":{"display_login":"magicDGS"}}