{"action":"created","comment":{"url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/comments/64503857","id":64503857,"diff_hunk":"@@ -576,32 +594,67 @@ class ADAMContext(@transient val sc: SparkContext) extends Serializable with Log\n     ))\n   }\n \n-  def loadVcf(filePath: String, sd: Option[SequenceDictionary]): RDD[VariantContext] = {\n+  /**\n+   * Loads a VCF file into an RDD.\n+   *\n+   * @param filePath The file to load.\n+   * @param sdOpt An optional sequence dictionary, in case the sequence info\n+   *              is not included in the VCF.\n+   * @return Returns a VariantContextRDD.\n+   */\n+  def loadVcf(filePath: String,\n+              sdOpt: Option[SequenceDictionary] = None): VariantContextRDD = {\n+\n+    // load vcf data\n     val job = HadoopUtil.newJob(sc)\n-    val vcc = new VariantContextConverter(sd)\n     job.getConfiguration().set(\"io.compression.codecs\", classOf[BGZFCodec].getCanonicalName())\n+    val vcc = new VariantContextConverter(sdOpt)\n     val records = sc.newAPIHadoopFile(\n       filePath,\n       classOf[VCFInputFormat], classOf[LongWritable], classOf[VariantContextWritable],\n       ContextUtil.getConfiguration(job)\n     )\n+\n+    // attach instrumentation\n     if (Metrics.isRecording) records.instrument() else records\n \n-    records.flatMap(p => vcc.convert(p._2.get))\n+    // load vcf metadata\n+    val (vcfSd, samples) = loadVcfMetadata(filePath)\n+\n+    // we can only replace the sequences header if the sequence info was missing on the vcf\n+    require(sdOpt.isEmpty || vcfSd.isEmpty,\n+      \"Only one of the provided or VCF sequence dictionary can be specified.\")\n+    val sd = sdOpt.getOrElse(vcfSd)\n+\n+    VariantContextRDD(records.flatMap(p => vcc.convert(p._2.get)),\n+      sd,\n+      samples)\n   }\n \n   def loadParquetGenotypes(\n     filePath: String,\n     predicate: Option[FilterPredicate] = None,\n-    projection: Option[Schema] = None): RDD[Genotype] = {\n-    loadParquet[Genotype](filePath, predicate, projection)\n+    projection: Option[Schema] = None): GenotypeRDD = {\n+    val rdd = loadParquet[Genotype](filePath, predicate, projection)\n+\n+    // load sequence info\n+    val sd = loadAvroSequences(filePath)\n+\n+    // load avro record group dictionary and convert to samples\n+    val rgd = loadAvroSampleMetadata(filePath)","path":"adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMContext.scala","position":125,"original_position":125,"commit_id":"4476c1ccdfd928326b4830bb7349567a36660728","original_commit_id":"4476c1ccdfd928326b4830bb7349567a36660728","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":"No, we should generate it from the VCF header","created_at":"2016-05-25T01:45:07Z","updated_at":"2016-05-25T01:45:07Z","html_url":"https://github.com/bigdatagenomics/adam/pull/1015#discussion_r64503857","pull_request_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1015","_links":{"self":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/comments/64503857"},"html":{"href":"https://github.com/bigdatagenomics/adam/pull/1015#discussion_r64503857"},"pull_request":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1015"}}},"pull_request":{"url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1015","id":67649857,"html_url":"https://github.com/bigdatagenomics/adam/pull/1015","diff_url":"https://github.com/bigdatagenomics/adam/pull/1015.diff","patch_url":"https://github.com/bigdatagenomics/adam/pull/1015.patch","issue_url":"https://api.github.com/repos/bigdatagenomics/adam/issues/1015","number":1015,"state":"open","locked":false,"title":"[ADAM-909] Refactoring variation RDDs.","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":"Resolves #909:\r\n\r\n* Refactors `org.bdgenomics.adam.rdd.variation` to add `GenomicRDD`s for `Genotype`, `Variant`, and `VariantContext`. These classes write sequence and sample metadata to disk.\r\n* Refactors `ADAMRDDFunctions` to an abstract class in preparation for further refactoring in #1011.\r\n* Added `AvroGenomicRDD` trait which consolidates Parquet + Avro metadata writing code across all Avro data models.","created_at":"2016-04-24T20:58:53Z","updated_at":"2016-05-25T01:45:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"854b02ce65cdd92d80afbf8b540b002e6281840e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1015/commits","review_comments_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1015/comments","review_comment_url":"https://api.github.com/repos/bigdatagenomics/adam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bigdatagenomics/adam/issues/1015/comments","statuses_url":"https://api.github.com/repos/bigdatagenomics/adam/statuses/4476c1ccdfd928326b4830bb7349567a36660728","head":{"label":"fnothaft:genotypes-rdd","ref":"genotypes-rdd","sha":"4476c1ccdfd928326b4830bb7349567a36660728","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-05-20T20:56:45Z","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":5672,"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":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"bigdatagenomics:master","ref":"master","sha":"65f2e05697c2341e2ea300c7eecfbd9c62ecb778","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-05-24T21:01:30Z","pushed_at":"2016-05-21T10:24:26Z","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":53405,"stargazers_count":442,"watchers_count":442,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":167,"mirror_url":null,"open_issues_count":133,"forks":167,"open_issues":133,"watchers":442,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1015"},"html":{"href":"https://github.com/bigdatagenomics/adam/pull/1015"},"issue":{"href":"https://api.github.com/repos/bigdatagenomics/adam/issues/1015"},"comments":{"href":"https://api.github.com/repos/bigdatagenomics/adam/issues/1015/comments"},"review_comments":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1015/comments"},"review_comment":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bigdatagenomics/adam/pulls/1015/commits"},"statuses":{"href":"https://api.github.com/repos/bigdatagenomics/adam/statuses/4476c1ccdfd928326b4830bb7349567a36660728"}}}}
{"actor":{"display_login":"heuermh"}}