{"action":"created","comment":{"url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/comments/65995127","id":65995127,"diff_hunk":"@@ -1,102 +0,0 @@\n-/**\n- * Licensed to Big Data Genomics (BDG) under one\n- * or more contributor license agreements.  See the NOTICE file\n- * distributed with this work for additional information\n- * regarding copyright ownership.  The BDG licenses this file\n- * to you under the Apache License, Version 2.0 (the\n- * \"License\"); you may not use this file except in compliance\n- * with the License.  You may obtain a copy of the License at\n- *\n- *     http://www.apache.org/licenses/LICENSE-2.0\n- *\n- * Unless required by applicable law or agreed to in writing, software\n- * distributed under the License is distributed on an \"AS IS\" BASIS,\n- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n- * See the License for the specific language governing permissions and\n- * limitations under the License.\n- */\n-\n-package htsjdk.samtools\n-\n-import htsjdk.samtools.util.BlockCompressedFilePointerUtil\n-import java.io.File\n-import java.io.FileNotFoundException\n-import org.apache.hadoop.fs.{ FileSystem, Path }\n-import org.apache.hadoop.io.LongWritable\n-import org.apache.hadoop.mapreduce.JobContext\n-import org.apache.hadoop.mapreduce.RecordReader\n-import org.apache.hadoop.mapreduce.InputSplit\n-import org.apache.hadoop.mapreduce.TaskAttemptContext\n-import org.apache.hadoop.mapreduce.lib.input.FileSplit\n-import org.bdgenomics.adam.models.ReferenceRegion\n-import org.bdgenomics.adam.rdd.ADAMContext._\n-import org.bdgenomics.adam.io.BAMFilteredRecordReader\n-import org.seqdoop.hadoop_bam.BAMInputFormat\n-import org.seqdoop.hadoop_bam.FileVirtualSplit\n-import org.seqdoop.hadoop_bam.SAMRecordWritable\n-import scala.collection.mutable\n-\n-object IndexedBamInputFormat {\n-\n-  private var optFilePath: Option[Path] = None\n-  private var optIndexFilePath: Option[Path] = None\n-  private var optViewRegion: Option[ReferenceRegion] = None\n-  private var optDict: Option[SAMSequenceDictionary] = None\n-\n-  def setVars(filePath: Path, indexFilePath: Path, viewRegion: ReferenceRegion, dict: SAMSequenceDictionary) {\n-    optFilePath = Some(filePath)\n-    optIndexFilePath = Some(indexFilePath)\n-    optViewRegion = Some(viewRegion)\n-    optDict = Some(dict)\n-  }\n-\n-}\n-\n-class IndexedBamInputFormat extends BAMInputFormat {\n-\n-  override def createRecordReader(split: InputSplit, ctx: TaskAttemptContext): RecordReader[LongWritable, SAMRecordWritable] = {\n-    val rr: RecordReader[LongWritable, SAMRecordWritable] = new BAMFilteredRecordReader()\n-    assert(IndexedBamInputFormat.optViewRegion.isDefined)\n-    IndexedBamInputFormat.optViewRegion.foreach { (refReg) => BAMFilteredRecordReader.setRegion(refReg) }\n-    rr.initialize(split, ctx)\n-    rr\n-  }\n-\n-  override def getSplits(job: JobContext): java.util.List[InputSplit] = {\n-    assert(IndexedBamInputFormat.optIndexFilePath.isDefined &&\n-      IndexedBamInputFormat.optFilePath.isDefined &&\n-      IndexedBamInputFormat.optViewRegion.isDefined &&\n-      IndexedBamInputFormat.optDict.isDefined)\n-\n-    val indexFilePath = IndexedBamInputFormat.optIndexFilePath.get\n-\n-    val idxFile: File = new File(indexFilePath.toString)\n-    if (!idxFile.exists()) {\n-      throw new java.io.FileNotFoundException(\"Bam index file not provided\")\n-    } else {\n-      // Use index to get the chunks for a specific region, then use them to create InputSplits\n-      val filePath = IndexedBamInputFormat.optFilePath.get\n-      val viewRegion = IndexedBamInputFormat.optViewRegion.get\n-      val refName = viewRegion.referenceName\n-      val dict = IndexedBamInputFormat.optDict.get\n-      val start = viewRegion.start.toInt\n-      val end = viewRegion.end.toInt\n-      val dbbfi: DiskBasedBAMFileIndex = new DiskBasedBAMFileIndex(idxFile, dict)\n-      val referenceIndex: Int = dict.getSequenceIndex(refName)\n-      // Get the chunks in the region we want (chunks give start and end file pointers into a BAM file)\n-      var regions: List[Chunk] = dbbfi.getSpanOverlapping(referenceIndex, start, end).getChunks\n-\n-      var splits = new mutable.ListBuffer[FileVirtualSplit]()\n-      for (chunk <- regions) {\n-        // Create InputSplits from chunks in a given region\n-        val start: Long = chunk.getChunkStart()\n-        val end: Long = chunk.getChunkEnd()\n-        val locs = Array[String]()\n-        val newSplit = new FileVirtualSplit(filePath, start, end, locs)\n-        splits += newSplit\n-      }\n-      splits.toList\n-    }\n-  }\n-\n-}","path":"adam-core/src/main/java/org/bdgenomics/adam/io/IndexedBamInputFormat.scala","position":102,"original_position":102,"commit_id":"54517875d5e162c2d868f28d8856d3904c30697e","original_commit_id":"54517875d5e162c2d868f28d8856d3904c30697e","user":{"login":"heuermh","id":35293,"avatar_url":"https://avatars.githubusercontent.com/u/35293?v=3","gravatar_id":"","url":"https://api.github.com/users/heuermh","html_url":"https://github.com/heuermh","followers_url":"https://api.github.com/users/heuermh/followers","following_url":"https://api.github.com/users/heuermh/following{/other_user}","gists_url":"https://api.github.com/users/heuermh/gists{/gist_id}","starred_url":"https://api.github.com/users/heuermh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heuermh/subscriptions","organizations_url":"https://api.github.com/users/heuermh/orgs","repos_url":"https://api.github.com/users/heuermh/repos","events_url":"https://api.github.com/users/heuermh/events{/privacy}","received_events_url":"https://api.github.com/users/heuermh/received_events","type":"User","site_admin":false},"body":"oh how I like to see code being removed  :)","created_at":"2016-06-07T00:54:38Z","updated_at":"2016-06-07T00:54:38Z","html_url":"https://github.com/bigdatagenomics/adam/pull/1036#discussion_r65995127","pull_request_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1036","_links":{"self":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/comments/65995127"},"html":{"href":"https://github.com/bigdatagenomics/adam/pull/1036#discussion_r65995127"},"pull_request":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1036"}}},"pull_request":{"url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1036","id":70916305,"html_url":"https://github.com/bigdatagenomics/adam/pull/1036","diff_url":"https://github.com/bigdatagenomics/adam/pull/1036.diff","patch_url":"https://github.com/bigdatagenomics/adam/pull/1036.patch","issue_url":"https://api.github.com/repos/bigdatagenomics/adam/issues/1036","number":1036,"state":"open","locked":false,"title":"Changed loadIndexedBam to use hadoop-bam InputFormat","user":{"login":"fnothaft","id":3752466,"avatar_url":"https://avatars.githubusercontent.com/u/3752466?v=3","gravatar_id":"","url":"https://api.github.com/users/fnothaft","html_url":"https://github.com/fnothaft","followers_url":"https://api.github.com/users/fnothaft/followers","following_url":"https://api.github.com/users/fnothaft/following{/other_user}","gists_url":"https://api.github.com/users/fnothaft/gists{/gist_id}","starred_url":"https://api.github.com/users/fnothaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnothaft/subscriptions","organizations_url":"https://api.github.com/users/fnothaft/orgs","repos_url":"https://api.github.com/users/fnothaft/repos","events_url":"https://api.github.com/users/fnothaft/events{/privacy}","received_events_url":"https://api.github.com/users/fnothaft/received_events","type":"User","site_admin":false},"body":"A bit of cleanup on top of @andrewmchen's work in #953.","created_at":"2016-05-20T20:57:50Z","updated_at":"2016-06-07T00:54:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8b4a24d4618f59fc185a07fe66661006fdda8ac","assignee":null,"milestone":{"url":"https://api.github.com/repos/bigdatagenomics/adam/milestones/14","html_url":"https://github.com/bigdatagenomics/adam/milestones/0.20.0","labels_url":"https://api.github.com/repos/bigdatagenomics/adam/milestones/14/labels","id":1488918,"number":14,"title":"0.20.0","description":"","creator":{"login":"fnothaft","id":3752466,"avatar_url":"https://avatars.githubusercontent.com/u/3752466?v=3","gravatar_id":"","url":"https://api.github.com/users/fnothaft","html_url":"https://github.com/fnothaft","followers_url":"https://api.github.com/users/fnothaft/followers","following_url":"https://api.github.com/users/fnothaft/following{/other_user}","gists_url":"https://api.github.com/users/fnothaft/gists{/gist_id}","starred_url":"https://api.github.com/users/fnothaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnothaft/subscriptions","organizations_url":"https://api.github.com/users/fnothaft/orgs","repos_url":"https://api.github.com/users/fnothaft/repos","events_url":"https://api.github.com/users/fnothaft/events{/privacy}","received_events_url":"https://api.github.com/users/fnothaft/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":10,"state":"open","created_at":"2016-01-07T06:15:27Z","updated_at":"2016-06-06T19:02:35Z","due_on":"2016-05-31T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1036/commits","review_comments_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1036/comments","review_comment_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bigdatagenomics/adam/issues/1036/comments","statuses_url":"https://api.github.com/repos/bigdatagenomics/adam/statuses/54517875d5e162c2d868f28d8856d3904c30697e","head":{"label":"fnothaft:loadIndexedBam-hadoop-bam","ref":"loadIndexedBam-hadoop-bam","sha":"54517875d5e162c2d868f28d8856d3904c30697e","user":{"login":"fnothaft","id":3752466,"avatar_url":"https://avatars.githubusercontent.com/u/3752466?v=3","gravatar_id":"","url":"https://api.github.com/users/fnothaft","html_url":"https://github.com/fnothaft","followers_url":"https://api.github.com/users/fnothaft/followers","following_url":"https://api.github.com/users/fnothaft/following{/other_user}","gists_url":"https://api.github.com/users/fnothaft/gists{/gist_id}","starred_url":"https://api.github.com/users/fnothaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnothaft/subscriptions","organizations_url":"https://api.github.com/users/fnothaft/orgs","repos_url":"https://api.github.com/users/fnothaft/repos","events_url":"https://api.github.com/users/fnothaft/events{/privacy}","received_events_url":"https://api.github.com/users/fnothaft/received_events","type":"User","site_admin":false},"repo":{"id":16842658,"name":"adam","full_name":"fnothaft/adam","owner":{"login":"fnothaft","id":3752466,"avatar_url":"https://avatars.githubusercontent.com/u/3752466?v=3","gravatar_id":"","url":"https://api.github.com/users/fnothaft","html_url":"https://github.com/fnothaft","followers_url":"https://api.github.com/users/fnothaft/followers","following_url":"https://api.github.com/users/fnothaft/following{/other_user}","gists_url":"https://api.github.com/users/fnothaft/gists{/gist_id}","starred_url":"https://api.github.com/users/fnothaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnothaft/subscriptions","organizations_url":"https://api.github.com/users/fnothaft/orgs","repos_url":"https://api.github.com/users/fnothaft/repos","events_url":"https://api.github.com/users/fnothaft/events{/privacy}","received_events_url":"https://api.github.com/users/fnothaft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fnothaft/adam","description":"A genomics processing engine and specialized file format built using Apache Avro, Apache Spark and Parquet. Apache 2 licensed.","fork":true,"url":"https://api.github.com/repos/fnothaft/adam","forks_url":"https://api.github.com/repos/fnothaft/adam/forks","keys_url":"https://api.github.com/repos/fnothaft/adam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fnothaft/adam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fnothaft/adam/teams","hooks_url":"https://api.github.com/repos/fnothaft/adam/hooks","issue_events_url":"https://api.github.com/repos/fnothaft/adam/issues/events{/number}","events_url":"https://api.github.com/repos/fnothaft/adam/events","assignees_url":"https://api.github.com/repos/fnothaft/adam/assignees{/user}","branches_url":"https://api.github.com/repos/fnothaft/adam/branches{/branch}","tags_url":"https://api.github.com/repos/fnothaft/adam/tags","blobs_url":"https://api.github.com/repos/fnothaft/adam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fnothaft/adam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fnothaft/adam/git/refs{/sha}","trees_url":"https://api.github.com/repos/fnothaft/adam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fnothaft/adam/statuses/{sha}","languages_url":"https://api.github.com/repos/fnothaft/adam/languages","stargazers_url":"https://api.github.com/repos/fnothaft/adam/stargazers","contributors_url":"https://api.github.com/repos/fnothaft/adam/contributors","subscribers_url":"https://api.github.com/repos/fnothaft/adam/subscribers","subscription_url":"https://api.github.com/repos/fnothaft/adam/subscription","commits_url":"https://api.github.com/repos/fnothaft/adam/commits{/sha}","git_commits_url":"https://api.github.com/repos/fnothaft/adam/git/commits{/sha}","comments_url":"https://api.github.com/repos/fnothaft/adam/comments{/number}","issue_comment_url":"https://api.github.com/repos/fnothaft/adam/issues/comments{/number}","contents_url":"https://api.github.com/repos/fnothaft/adam/contents/{+path}","compare_url":"https://api.github.com/repos/fnothaft/adam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fnothaft/adam/merges","archive_url":"https://api.github.com/repos/fnothaft/adam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fnothaft/adam/downloads","issues_url":"https://api.github.com/repos/fnothaft/adam/issues{/number}","pulls_url":"https://api.github.com/repos/fnothaft/adam/pulls{/number}","milestones_url":"https://api.github.com/repos/fnothaft/adam/milestones{/number}","notifications_url":"https://api.github.com/repos/fnothaft/adam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fnothaft/adam/labels{/name}","releases_url":"https://api.github.com/repos/fnothaft/adam/releases{/id}","deployments_url":"https://api.github.com/repos/fnothaft/adam/deployments","created_at":"2014-02-14T16:25:30Z","updated_at":"2014-06-24T16:52:53Z","pushed_at":"2016-06-06T23:39:36Z","git_url":"git://github.com/fnothaft/adam.git","ssh_url":"git@github.com:fnothaft/adam.git","clone_url":"https://github.com/fnothaft/adam.git","svn_url":"https://github.com/fnothaft/adam","homepage":"","size":5711,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"bigdatagenomics:master","ref":"master","sha":"dbf0ec5803e91bcb8bbd5abf562811d712216181","user":{"login":"bigdatagenomics","id":5839438,"avatar_url":"https://avatars.githubusercontent.com/u/5839438?v=3","gravatar_id":"","url":"https://api.github.com/users/bigdatagenomics","html_url":"https://github.com/bigdatagenomics","followers_url":"https://api.github.com/users/bigdatagenomics/followers","following_url":"https://api.github.com/users/bigdatagenomics/following{/other_user}","gists_url":"https://api.github.com/users/bigdatagenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/bigdatagenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigdatagenomics/subscriptions","organizations_url":"https://api.github.com/users/bigdatagenomics/orgs","repos_url":"https://api.github.com/users/bigdatagenomics/repos","events_url":"https://api.github.com/users/bigdatagenomics/events{/privacy}","received_events_url":"https://api.github.com/users/bigdatagenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":14541530,"name":"adam","full_name":"bigdatagenomics/adam","owner":{"login":"bigdatagenomics","id":5839438,"avatar_url":"https://avatars.githubusercontent.com/u/5839438?v=3","gravatar_id":"","url":"https://api.github.com/users/bigdatagenomics","html_url":"https://github.com/bigdatagenomics","followers_url":"https://api.github.com/users/bigdatagenomics/followers","following_url":"https://api.github.com/users/bigdatagenomics/following{/other_user}","gists_url":"https://api.github.com/users/bigdatagenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/bigdatagenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigdatagenomics/subscriptions","organizations_url":"https://api.github.com/users/bigdatagenomics/orgs","repos_url":"https://api.github.com/users/bigdatagenomics/repos","events_url":"https://api.github.com/users/bigdatagenomics/events{/privacy}","received_events_url":"https://api.github.com/users/bigdatagenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bigdatagenomics/adam","description":"ADAM is a genomics analysis platform with specialized file formats built using Apache Avro, Apache Spark and Parquet. Apache 2 licensed.","fork":false,"url":"https://api.github.com/repos/bigdatagenomics/adam","forks_url":"https://api.github.com/repos/bigdatagenomics/adam/forks","keys_url":"https://api.github.com/repos/bigdatagenomics/adam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bigdatagenomics/adam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bigdatagenomics/adam/teams","hooks_url":"https://api.github.com/repos/bigdatagenomics/adam/hooks","issue_events_url":"https://api.github.com/repos/bigdatagenomics/adam/issues/events{/number}","events_url":"https://api.github.com/repos/bigdatagenomics/adam/events","assignees_url":"https://api.github.com/repos/bigdatagenomics/adam/assignees{/user}","branches_url":"https://api.github.com/repos/bigdatagenomics/adam/branches{/branch}","tags_url":"https://api.github.com/repos/bigdatagenomics/adam/tags","blobs_url":"https://api.github.com/repos/bigdatagenomics/adam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bigdatagenomics/adam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bigdatagenomics/adam/git/refs{/sha}","trees_url":"https://api.github.com/repos/bigdatagenomics/adam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bigdatagenomics/adam/statuses/{sha}","languages_url":"https://api.github.com/repos/bigdatagenomics/adam/languages","stargazers_url":"https://api.github.com/repos/bigdatagenomics/adam/stargazers","contributors_url":"https://api.github.com/repos/bigdatagenomics/adam/contributors","subscribers_url":"https://api.github.com/repos/bigdatagenomics/adam/subscribers","subscription_url":"https://api.github.com/repos/bigdatagenomics/adam/subscription","commits_url":"https://api.github.com/repos/bigdatagenomics/adam/commits{/sha}","git_commits_url":"https://api.github.com/repos/bigdatagenomics/adam/git/commits{/sha}","comments_url":"https://api.github.com/repos/bigdatagenomics/adam/comments{/number}","issue_comment_url":"https://api.github.com/repos/bigdatagenomics/adam/issues/comments{/number}","contents_url":"https://api.github.com/repos/bigdatagenomics/adam/contents/{+path}","compare_url":"https://api.github.com/repos/bigdatagenomics/adam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bigdatagenomics/adam/merges","archive_url":"https://api.github.com/repos/bigdatagenomics/adam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bigdatagenomics/adam/downloads","issues_url":"https://api.github.com/repos/bigdatagenomics/adam/issues{/number}","pulls_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls{/number}","milestones_url":"https://api.github.com/repos/bigdatagenomics/adam/milestones{/number}","notifications_url":"https://api.github.com/repos/bigdatagenomics/adam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bigdatagenomics/adam/labels{/name}","releases_url":"https://api.github.com/repos/bigdatagenomics/adam/releases{/id}","deployments_url":"https://api.github.com/repos/bigdatagenomics/adam/deployments","created_at":"2013-11-19T23:47:57Z","updated_at":"2016-06-06T10:43:41Z","pushed_at":"2016-06-06T23:39:37Z","git_url":"git://github.com/bigdatagenomics/adam.git","ssh_url":"git@github.com:bigdatagenomics/adam.git","clone_url":"https://github.com/bigdatagenomics/adam.git","svn_url":"https://github.com/bigdatagenomics/adam","homepage":"http://bdgenomics.org/","size":53409,"stargazers_count":448,"watchers_count":448,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":173,"mirror_url":null,"open_issues_count":136,"forks":173,"open_issues":136,"watchers":448,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1036"},"html":{"href":"https://github.com/bigdatagenomics/adam/pull/1036"},"issue":{"href":"https://api.github.com/repos/bigdatagenomics/adam/issues/1036"},"comments":{"href":"https://api.github.com/repos/bigdatagenomics/adam/issues/1036/comments"},"review_comments":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1036/comments"},"review_comment":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1036/commits"},"statuses":{"href":"https://api.github.com/repos/bigdatagenomics/adam/statuses/54517875d5e162c2d868f28d8856d3904c30697e"}}}}
{"actor":{"display_login":"heuermh"}}