au.csiro.variantspark.cli.args.LabelSourceArgs.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of variant-spark_2.11 Show documentation
Show all versions of variant-spark_2.11 Show documentation
Genomic variants interpretation toolkit
The newest version!
package au.csiro.variantspark.cli.args
import org.kohsuke.args4j.{Option => ArgsOption}
import au.csiro.variantspark.cmd.Echoable
import au.csiro.variantspark.input.CsvLabelSource
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.FileSystem
trait LabelSourceArgs extends SparkArgs with Echoable {
@ArgsOption(name = "-ff", required = false, usage = "Path to feature file",
aliases = Array("--feature-file"))
val featuresFile: String = null
@ArgsOption(name = "-fc", required = false, usage = "Name of the feature column",
aliases = Array("--feature-column"))
val featureColumn: String = null
lazy val labelSource: CsvLabelSource = {
implicit val hadoopConf: Configuration = sc.hadoopConfiguration
echo(s"Loading labels from: ${featuresFile}, column: ${featureColumn}")
new CsvLabelSource(featuresFile, featureColumn)
}
}