Skip to content

Commit

Permalink
Cleaning up org.bdgenomics.adam.rdd.ADAMContext:
Browse files Browse the repository at this point in the history
* Made constructor private.
* Removed dead implicits.
* Made `loadParquet` package private.
* Broke long lines.
* Added scaladoc.
* Removed non-ideomatic uses of `Option`s.
* Removed unused overloaded `loadFeatures` definition.
* Removed `loadGenes` and `PrintGenes` command.
* Added support for .vcf.gz in `loadGenotypes` and `loadVariants`.
  • Loading branch information
fnothaft committed Sep 6, 2016
1 parent 08950d4 commit 480c1f4
Show file tree
Hide file tree
Showing 6 changed files with 318 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,13 @@ object JavaADAMContext {
implicit def toADAMContext(jac: JavaADAMContext): ADAMContext = jac.ac
}

class JavaADAMContext(val ac: ADAMContext) extends Serializable {
class JavaADAMContext private (val ac: ADAMContext) extends Serializable {

/**
* @return Returns the Java Spark Context associated with this Java ADAM Context.
*/
def getSparkContext: JavaSparkContext = new JavaSparkContext(ac.sc)

/**
* Builds this Java ADAM Context using an existing Java Spark Context.
*
* @param jsc Java Spark Context to use to build this ADAM Context.
* @return A new Java ADAM Context.
*/
def this(jsc: JavaSparkContext) = this(new ADAMContext(jsc))

/**
* Builds this Java ADAM Context using an existing Spark Context.
*
* @param sc Spark Context to use to build this ADAM Context.
* @return A new Java ADAM Context.
*/
def this(sc: SparkContext) = this(new ADAMContext(sc))

/**
* Loads in an ADAM read file. This method can load SAM, BAM, and ADAM files.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ object ADAMMain {
"PRINT",
List(
PrintADAM,
PrintGenes,
FlagStat,
ListDict,
AlleleCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class Features2ADAMArgs extends Args4jBase with ParquetSaveArgs {
var outputPath: String = null
@Args4jOption(required = false, name = "-num_partitions",
usage = "Number of partitions to load an interval file using.")
var numPartitions: Int = 10
var numPartitions: Int = _
}

class Features2ADAM(val args: Features2ADAMArgs)
extends BDGSparkCommand[Features2ADAMArgs] {
val companion = Features2ADAM

def run(sc: SparkContext) {
sc.loadFeatures(args.featuresFile, None, args.numPartitions).saveAsParquet(args)
sc.loadFeatures(args.featuresFile, None, Option(args.numPartitions)).saveAsParquet(args)
}
}
70 changes: 0 additions & 70 deletions adam-cli/src/main/scala/org/bdgenomics/adam/cli/PrintGenes.scala

This file was deleted.

Loading

0 comments on commit 480c1f4

Please sign in to comment.