Skip to content

Commit

Permalink
Merge 1e5450c into 4223f56
Browse files Browse the repository at this point in the history
  • Loading branch information
fnothaft committed Jan 16, 2018
2 parents 4223f56 + 1e5450c commit 5df7ca3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -1119,9 +1119,11 @@ class ADAMContext(@transient val sc: SparkContext) extends Serializable with Log
val files = getFsAndFilesWithFilter(pathName, new NoPrefixFileFilter("_"))

// load yonder the metadata
files.map(p => loadSingleVcfMetadata(p.toString)).reduce((p1, p2) => {
val (sequences, samples, headerLines) = files.map(p => loadSingleVcfMetadata(p.toString)).reduce((p1, p2) => {
(p1._1 ++ p2._1, p1._2 ++ p2._2, p1._3 ++ p2._3)
})

(sequences, samples.distinct, headerLines)
}

/**
Expand Down
Expand Up @@ -473,7 +473,13 @@ class ADAMContextSuite extends ADAMFunSuite {
sparkTest("load vcf with a glob") {
val path = testFile("bqsr1.vcf").replace("bqsr1", "*")

val variants = sc.loadVcf(path).toVariants
val vcs = sc.loadVcf(path)

assert(vcs.samples.size === 8)
assert(vcs.headerLines.size === 154)
assert(vcs.sequences.size === 31)

val variants = vcs.toVariants
assert(variants.rdd.count === 782)
}

Expand Down

0 comments on commit 5df7ca3

Please sign in to comment.