diff --git a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/ADAMMain.scala b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/ADAMMain.scala index 642befbd19..b572137687 100644 --- a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/ADAMMain.scala +++ b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/ADAMMain.scala @@ -65,7 +65,7 @@ object ADAMMain extends Logging { printCommands() } else { commands.find(_.commandName == args(0)) match { - case None => printCommands() + case None => printCommands() case Some(cmd) => cmd.apply(args drop 1).run() } } diff --git a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/CompareADAM.scala b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/CompareADAM.scala index 8f231ed803..2fe601adff 100644 --- a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/CompareADAM.scala +++ b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/CompareADAM.scala @@ -68,11 +68,11 @@ object CompareADAM extends ADAMCommandCompanion with Serializable { * @see CompareADAMArgs.recurse1, CompareADAMArgs.recurse2 */ def setupTraversalEngine(sc: SparkContext, - input1Path: String, - recurse1: String, - input2Path: String, - recurse2: String, - generator: BucketComparisons[Any]): ComparisonTraversalEngine = { + input1Path: String, + recurse1: String, + input2Path: String, + recurse2: String, + generator: BucketComparisons[Any]): ComparisonTraversalEngine = { val schemas = Seq[FieldValue]( recordGroupId, @@ -88,7 +88,7 @@ object CompareADAM extends ADAMCommandCompanion with Serializable { def parseGenerators(nameList: String): Seq[BucketComparisons[Any]] = { nameList match { case null => DefaultComparisons.comparisons - case s => parseGenerators(s.split(",")) + case s => parseGenerators(s.split(",")) } } @@ -146,9 +146,9 @@ class CompareADAM(protected val args: CompareADAMArgs) extends ADAMSparkCommand[ * @param writer The PrintWriter to print the summary with. */ def printSummary(engine: ComparisonTraversalEngine, - generators: Seq[BucketComparisons[Any]], - aggregateds: Seq[Histogram[Any]], - writer: PrintWriter) { + generators: Seq[BucketComparisons[Any]], + aggregateds: Seq[Histogram[Any]], + writer: PrintWriter) { writer.println("%15s: %s".format("INPUT1", args.input1Path)) writer.println("\t%15s: %d".format("total-reads", engine.named1.count())) diff --git a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/MpileupCommand.scala b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/MpileupCommand.scala index 136b3216b1..ba313105aa 100644 --- a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/MpileupCommand.scala +++ b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/MpileupCommand.scala @@ -57,7 +57,7 @@ class MpileupCommand(protected val args: MpileupArgs) extends ADAMSparkCommand[M // The reference base pileup.referenceBase match { case Some(base) => print(base) - case None => print("?") + case None => print("?") } // The number of reads diff --git a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/PileupAggregator.scala b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/PileupAggregator.scala index fbab6d035a..dee7203b9e 100644 --- a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/PileupAggregator.scala +++ b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/PileupAggregator.scala @@ -43,7 +43,7 @@ class PileupAggregatorArgs extends Args4jBase with SparkArgs with ParquetArgs { } class PileupAggregator(protected val args: PileupAggregatorArgs) - extends ADAMSparkCommand[PileupAggregatorArgs] { + extends ADAMSparkCommand[PileupAggregatorArgs] { val companion = PileupAggregator diff --git a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/PluginExecutor.scala b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/PluginExecutor.scala index 4ca03d2974..9c1903841c 100644 --- a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/PluginExecutor.scala +++ b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/PluginExecutor.scala @@ -95,11 +95,11 @@ class PluginExecutor(protected val args: PluginExecutorArgs) extends ADAMSparkCo // see. This is related to Issue #62: Predicate to filter conversion. val filter = accessControl.predicate match { case None => plugin.predicate match { - case None => None + case None => None case Some(predicateFilter) => Some(predicateFilter) } case Some(accessControlPredicate) => plugin.predicate match { - case None => Some(accessControlPredicate) + case None => Some(accessControlPredicate) case Some(predicateFilter) => Some((value: ADAMRecord) => accessControlPredicate(value) && predicateFilter(value)) } } @@ -107,7 +107,7 @@ class PluginExecutor(protected val args: PluginExecutorArgs) extends ADAMSparkCo val firstRdd: RDD[ADAMRecord] = load[ADAMRecord](sc, args.input, plugin.projection) val input = filter match { - case None => firstRdd + case None => firstRdd case Some(filterFunc) => firstRdd.filter(filterFunc) } diff --git a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/SummarizeGenotypes.scala b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/SummarizeGenotypes.scala index 405105107b..ffd0cb0c6e 100644 --- a/adam-cli/src/main/scala/org/bdgenomics/adam/cli/SummarizeGenotypes.scala +++ b/adam-cli/src/main/scala/org/bdgenomics/adam/cli/SummarizeGenotypes.scala @@ -56,8 +56,8 @@ class SummarizeGenotypes(val args: SummarizeGenotypesArgs) extends ADAMSparkComm val stats = GenotypesSummary(adamGTs) val result = args.format match { case "human" => GenotypesSummaryFormatting.format_human_readable(stats) - case "csv" => GenotypesSummaryFormatting.format_csv(stats) - case _ => throw new IllegalArgumentException("Invalid -format: %s".format(args.format)) + case "csv" => GenotypesSummaryFormatting.format_csv(stats) + case _ => throw new IllegalArgumentException("Invalid -format: %s".format(args.format)) } if (args.out.isEmpty) { println(result) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/algorithms/smithwaterman/SmithWatermanConstantGapScoring.scala b/adam-core/src/main/scala/org/bdgenomics/adam/algorithms/smithwaterman/SmithWatermanConstantGapScoring.scala index 35ac99be9b..4e504efda1 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/algorithms/smithwaterman/SmithWatermanConstantGapScoring.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/algorithms/smithwaterman/SmithWatermanConstantGapScoring.scala @@ -33,10 +33,10 @@ object SmithWatermanConstantGapScoring { } abstract class SmithWatermanConstantGapScoring(xSequence: String, - ySequence: String, - wMatch: Double, - wMismatch: Double, - wInsert: Double, - wDelete: Double) - extends SmithWatermanGapScoringFromFn(xSequence, ySequence, SmithWatermanConstantGapScoring.constantGapFn(wMatch, wMismatch, wInsert, wDelete)) { + ySequence: String, + wMatch: Double, + wMismatch: Double, + wInsert: Double, + wDelete: Double) + extends SmithWatermanGapScoringFromFn(xSequence, ySequence, SmithWatermanConstantGapScoring.constantGapFn(wMatch, wMismatch, wInsert, wDelete)) { } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/algorithms/smithwaterman/SmithWatermanGapScoringFromFn.scala b/adam-core/src/main/scala/org/bdgenomics/adam/algorithms/smithwaterman/SmithWatermanGapScoringFromFn.scala index 2552acabff..6ee710b06c 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/algorithms/smithwaterman/SmithWatermanGapScoringFromFn.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/algorithms/smithwaterman/SmithWatermanGapScoringFromFn.scala @@ -17,9 +17,9 @@ package org.bdgenomics.adam.algorithms.smithwaterman abstract class SmithWatermanGapScoringFromFn(xSequence: String, - ySequence: String, - scoreFn: (Int, Int, Char, Char) => Double) - extends SmithWaterman(xSequence, ySequence) { + ySequence: String, + scoreFn: (Int, Int, Char, Char) => Double) + extends SmithWaterman(xSequence, ySequence) { def buildScoringMatrix(): Array[Array[Double]] = { diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/converters/FastaConverter.scala b/adam-core/src/main/scala/org/bdgenomics/adam/converters/FastaConverter.scala index 0089539a68..0a3feaf2e0 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/converters/FastaConverter.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/converters/FastaConverter.scala @@ -43,7 +43,7 @@ private[adam] object FastaConverter { * @return An RDD of ADAM FASTA data. */ def apply(rdd: RDD[(Int, String)], - maxFragmentLength: Long = 10000L): RDD[ADAMNucleotideContigFragment] = { + maxFragmentLength: Long = 10000L): RDD[ADAMNucleotideContigFragment] = { val filtered = rdd.map(kv => (kv._1, kv._2.trim())) .filter((kv: (Int, String)) => !kv._2.startsWith(";")) @@ -164,9 +164,9 @@ private[converters] class FastaConverter(fragmentLength: Long) extends Serializa * @return The converted ADAM FASTA contig. */ def convert(name: Option[String], - id: Int, - sequence: Seq[String], - description: Option[String]): Seq[ADAMNucleotideContigFragment] = { + id: Int, + sequence: Seq[String], + description: Option[String]): Seq[ADAMNucleotideContigFragment] = { // get sequence length val sequenceLength = sequence.map(_.length).reduce(_ + _) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/converters/GenotypesToVariantsConverter.scala b/adam-core/src/main/scala/org/bdgenomics/adam/converters/GenotypesToVariantsConverter.scala index ef92498799..d2df6092a6 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/converters/GenotypesToVariantsConverter.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/converters/GenotypesToVariantsConverter.scala @@ -19,7 +19,7 @@ import org.bdgenomics.adam.util._ import scala.math.{ pow, sqrt } private[adam] class GenotypesToVariantsConverter(validateSamples: Boolean = false, - failOnValidationError: Boolean = false) extends Serializable { + failOnValidationError: Boolean = false) extends Serializable { /** * Computes root mean squared (RMS) values for a series of doubles. diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/converters/SAMRecordConverter.scala b/adam-core/src/main/scala/org/bdgenomics/adam/converters/SAMRecordConverter.scala index e7c2279e25..f4096579cd 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/converters/SAMRecordConverter.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/converters/SAMRecordConverter.scala @@ -124,7 +124,7 @@ class SAMRecordConverter extends Serializable { if (recordGroup != null) { Option(recordGroup.getRunDate) match { case Some(date) => builder.setRecordGroupRunDateEpoch(date.getTime) - case None => + case None => } recordGroup.getId builder.setRecordGroupId(readGroups(recordGroup.getReadGroupId)) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantAnnotationConverter.scala b/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantAnnotationConverter.scala index d37534c56c..acaac79dc1 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantAnnotationConverter.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantAnnotationConverter.scala @@ -26,18 +26,18 @@ import org.bdgenomics.adam.util.ImplicitJavaConversions._ object VariantAnnotationConverter extends Serializable { private def attrAsInt(attr: Object): Object = attr match { - case a: String => java.lang.Integer.valueOf(a) + case a: String => java.lang.Integer.valueOf(a) case a: java.lang.Integer => a - case a: java.lang.Number => java.lang.Integer.valueOf(a.intValue) + case a: java.lang.Number => java.lang.Integer.valueOf(a.intValue) } private def attrAsLong(attr: Object): Object = attr match { - case a: String => java.lang.Long.valueOf(a) - case a: java.lang.Long => a + case a: String => java.lang.Long.valueOf(a) + case a: java.lang.Long => a case a: java.lang.Number => java.lang.Long.valueOf(a.longValue) } private def attrAsFloat(attr: Object): Object = attr match { - case a: String => java.lang.Float.valueOf(a) - case a: java.lang.Float => a + case a: String => java.lang.Float.valueOf(a) + case a: java.lang.Float => a case a: java.lang.Number => java.lang.Float.valueOf(a.floatValue) } private def attrAsString(attr: Object): Object = attr match { @@ -46,7 +46,7 @@ object VariantAnnotationConverter extends Serializable { private def attrAsBoolean(attr: Object): Object = attr match { case a: java.lang.Boolean => a - case a: String => java.lang.Boolean.valueOf(a) + case a: String => java.lang.Boolean.valueOf(a) } private case class AttrKey(adamKey: String, attrConverter: (Object => Object), hdrLine: VCFCompoundHeaderLine) { diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantContextConverter.scala b/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantContextConverter.scala index 67c5c44d3e..6b26c1143d 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantContextConverter.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantContextConverter.scala @@ -48,8 +48,8 @@ object VariantContextConverter { private def convertAlleles(g: ADAMGenotype): java.util.List[Allele] = { g.getAlleles.map(a => a match { case ADAMGenotypeAllele.NoCall => Allele.NO_CALL - case ADAMGenotypeAllele.Ref => Allele.create(g.getVariant.getReferenceAllele.toString, true) - case ADAMGenotypeAllele.Alt => Allele.create(g.getVariant.getVariantAllele.toString) + case ADAMGenotypeAllele.Ref => Allele.create(g.getVariant.getReferenceAllele.toString, true) + case ADAMGenotypeAllele.Alt => Allele.create(g.getVariant.getVariantAllele.toString) }) } } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/metrics/aggregators/Aggregator.scala b/adam-core/src/main/scala/org/bdgenomics/adam/metrics/aggregators/Aggregator.scala index 6f5d723e4b..2b5109419e 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/metrics/aggregators/Aggregator.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/metrics/aggregators/Aggregator.scala @@ -55,8 +55,8 @@ trait Aggregated[+T] extends Writable with Serializable { } class AggregatedCollection[T, U <: Aggregated[T]](val values: Seq[U]) - extends Aggregated[metrics.Collection[Seq[T]]] - with Serializable { + extends Aggregated[metrics.Collection[Seq[T]]] + with Serializable { def count(): Long = values.map(_.count()).reduce(_ + _) def countIdentical(): Long = @@ -72,7 +72,7 @@ object AggregatedCollection { } class CombinedAggregator[Single, Agg <: Aggregated[Single]](aggs: Seq[Aggregator[Single, Agg]]) - extends Aggregator[metrics.Collection[Seq[Single]], AggregatedCollection[Single, Agg]] { + extends Aggregator[metrics.Collection[Seq[Single]], AggregatedCollection[Single, Agg]] { def initialValue: AggregatedCollection[Single, Agg] = AggregatedCollection(aggs.map(_.initialValue)) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/models/ADAMVariantContext.scala b/adam-core/src/main/scala/org/bdgenomics/adam/models/ADAMVariantContext.scala index f7a4b72c7a..1e3188ac45 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/models/ADAMVariantContext.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/models/ADAMVariantContext.scala @@ -78,10 +78,10 @@ object ADAMVariantContext { } class ADAMVariantContext( - val position: ReferencePosition, - val variant: RichADAMVariant, - val genotypes: Seq[ADAMGenotype], - val databases: Option[ADAMDatabaseVariantAnnotation] = None) { + val position: ReferencePosition, + val variant: RichADAMVariant, + val genotypes: Seq[ADAMGenotype], + val databases: Option[ADAMDatabaseVariantAnnotation] = None) { def this(variant: RichADAMVariant, genotypes: Seq[ADAMGenotype], database: Option[ADAMDatabaseVariantAnnotation] = None) = { this(ReferencePosition(variant), variant, genotypes, database) } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/models/ReadBucket.scala b/adam-core/src/main/scala/org/bdgenomics/adam/models/ReadBucket.scala index 4cd4e43d59..6b9f7bc93c 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/models/ReadBucket.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/models/ReadBucket.scala @@ -29,12 +29,12 @@ import com.esotericsoftware.kryo.io.{ Input, Output } * This is useful as this will usually map a single read in any of the sequences. */ case class ReadBucket(unpairedPrimaryMappedReads: Seq[ADAMRecord] = Seq.empty, - pairedFirstPrimaryMappedReads: Seq[ADAMRecord] = Seq.empty, - pairedSecondPrimaryMappedReads: Seq[ADAMRecord] = Seq.empty, - unpairedSecondaryMappedReads: Seq[ADAMRecord] = Seq.empty, - pairedFirstSecondaryMappedReads: Seq[ADAMRecord] = Seq.empty, - pairedSecondSecondaryMappedReads: Seq[ADAMRecord] = Seq.empty, - unmappedReads: Seq[ADAMRecord] = Seq.empty) { + pairedFirstPrimaryMappedReads: Seq[ADAMRecord] = Seq.empty, + pairedSecondPrimaryMappedReads: Seq[ADAMRecord] = Seq.empty, + unpairedSecondaryMappedReads: Seq[ADAMRecord] = Seq.empty, + pairedFirstSecondaryMappedReads: Seq[ADAMRecord] = Seq.empty, + pairedSecondSecondaryMappedReads: Seq[ADAMRecord] = Seq.empty, + unmappedReads: Seq[ADAMRecord] = Seq.empty) { def allReads(): Seq[ADAMRecord] = unpairedPrimaryMappedReads ++ pairedFirstPrimaryMappedReads ++ diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePosition.scala b/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePosition.scala index 8a1ae20061..049e3b8306 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePosition.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePosition.scala @@ -43,7 +43,7 @@ object ReferencePositionWithOrientation { } case class ReferencePositionWithOrientation(refPos: Option[ReferencePosition], negativeStrand: Boolean) - extends Ordered[ReferencePositionWithOrientation] { + extends Ordered[ReferencePositionWithOrientation] { override def compare(that: ReferencePositionWithOrientation): Int = { val posCompare = refPos.compare(that.refPos) if (posCompare != 0) { diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePositionPair.scala b/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePositionPair.scala index 18cef3342c..f00a0082db 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePositionPair.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePositionPair.scala @@ -48,7 +48,7 @@ object ReferencePositionPair extends Logging { } case class ReferencePositionPair(read1refPos: Option[ReferencePositionWithOrientation], - read2refPos: Option[ReferencePositionWithOrientation]) + read2refPos: Option[ReferencePositionWithOrientation]) class ReferencePositionPairSerializer extends Serializer[ReferencePositionPair] { val rps = new ReferencePositionWithOrientationSerializer() diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferenceRegion.scala b/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferenceRegion.scala index bb3624058e..b8cbe14f23 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferenceRegion.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/models/ReferenceRegion.scala @@ -122,7 +122,7 @@ case class ReferenceRegion(refId: Int, start: Long, end: Long) extends Ordered[R */ def isAdjacent(region: ReferenceRegion): Boolean = distance(region) match { case Some(d) => d == 1 - case None => false + case None => false } /** diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/models/SequenceDictionary.scala b/adam-core/src/main/scala/org/bdgenomics/adam/models/SequenceDictionary.scala index b9736a3dcf..e79ffba7b0 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/models/SequenceDictionary.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/models/SequenceDictionary.scala @@ -208,7 +208,7 @@ class SequenceDictionary(val recordsIn: Array[SequenceRecord]) extends Serializa def records: Set[SequenceRecord] = recordIndices.values.toSet private[models] def cleanAndMerge(a1: Array[SequenceRecord], - a2: Array[SequenceRecord]): Array[SequenceRecord] = { + a2: Array[SequenceRecord]): Array[SequenceRecord] = { val a2filt = a2.filter(k => !a1.contains(k)) a1 ++ a2filt diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/models/SingleReadBucket.scala b/adam-core/src/main/scala/org/bdgenomics/adam/models/SingleReadBucket.scala index 6b793bd0d6..dc5d0ae9ce 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/models/SingleReadBucket.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/models/SingleReadBucket.scala @@ -36,8 +36,8 @@ object SingleReadBucket extends Logging { } case class SingleReadBucket(primaryMapped: Seq[ADAMRecord] = Seq.empty, - secondaryMapped: Seq[ADAMRecord] = Seq.empty, - unmapped: Seq[ADAMRecord] = Seq.empty) { + secondaryMapped: Seq[ADAMRecord] = Seq.empty, + unmapped: Seq[ADAMRecord] = Seq.empty) { // Note: not a val in order to save serialization/memory cost def allReads = { primaryMapped ++ secondaryMapped ++ unmapped diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMContext.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMContext.scala index 9845700c8b..2b1fdd7f90 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMContext.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMContext.scala @@ -113,12 +113,12 @@ object ADAMContext { * @return Returns a properly configured Spark Context. */ def createSparkContext(name: String, - master: String, - sparkHome: String, - sparkJars: Seq[String], - sparkEnvVars: Seq[String], - sparkAddStatsListener: Boolean = false, - sparkKryoBufferSize: Int = 4): SparkContext = { + master: String, + sparkHome: String, + sparkJars: Seq[String], + sparkEnvVars: Seq[String], + sparkAddStatsListener: Boolean = false, + sparkKryoBufferSize: Int = 4): SparkContext = { ADAMKryoProperties.setupContextProperties(sparkKryoBufferSize) val appName = "adam: " + name val environment: Map[String, String] = if (sparkEnvVars.isEmpty) { diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMRDDFunctions.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMRDDFunctions.scala index 86a6fe31f2..8962e989fa 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMRDDFunctions.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/ADAMRDDFunctions.scala @@ -52,8 +52,8 @@ import scala.math.{ min, max } class ADAMRDDFunctions[T <% SpecificRecord: Manifest](rdd: RDD[T]) extends Serializable { def adamSave(filePath: String, blockSize: Int = 128 * 1024 * 1024, - pageSize: Int = 1 * 1024 * 1024, compressCodec: CompressionCodecName = CompressionCodecName.GZIP, - disableDictionaryEncoding: Boolean = false): RDD[T] = { + pageSize: Int = 1 * 1024 * 1024, compressCodec: CompressionCodecName = CompressionCodecName.GZIP, + disableDictionaryEncoding: Boolean = false): RDD[T] = { val job = new Job(rdd.context.hadoopConfiguration) ParquetLogger.hadoopLoggerLevel(Level.SEVERE) ParquetOutputFormat.setWriteSupportClass(job, classOf[AvroWriteSupport]) @@ -131,7 +131,7 @@ abstract class ADAMSequenceDictionaryRDDAggregator[T](rdd: RDD[T]) extends Seria * @param rdd RDD over which aggregation is supported. */ class ADAMSpecificRecordSequenceDictionaryRDDAggregator[T <% SpecificRecord: Manifest](rdd: RDD[T]) - extends ADAMSequenceDictionaryRDDAggregator[T](rdd) { + extends ADAMSequenceDictionaryRDDAggregator[T](rdd) { def getSequenceRecordsFromElement(elem: T): Set[SequenceRecord] = { Set(SequenceRecord.fromSpecificRecord(elem)) @@ -223,7 +223,7 @@ class ADAMRecordRDDFunctions(rdd: RDD[ADAMRecord]) extends ADAMSequenceDictionar * @return RDD of ADAMRods. */ def adamRecords2Rods(bucketSize: Int = 1000, - secondaryAlignments: Boolean = false): RDD[ADAMRod] = { + secondaryAlignments: Boolean = false): RDD[ADAMRod] = { /** * Maps a read to one or two buckets. A read maps to a single bucket if both @@ -458,7 +458,7 @@ class ADAMNucleotideContigFragmentRDDFunctions(rdd: RDD[ADAMNucleotideContigFrag } def reducePairs(kv1: (ReferenceRegion, String), - kv2: (ReferenceRegion, String)): (ReferenceRegion, String) = { + kv2: (ReferenceRegion, String)): (ReferenceRegion, String) = { assert(kv1._1.isAdjacent(kv2._1), "Regions being joined must be adjacent. For: " + kv1 + ", " + kv2) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/FlagStat.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/FlagStat.scala index 0f2992a47e..c7aecda959 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/FlagStat.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/FlagStat.scala @@ -56,10 +56,10 @@ case class DuplicateMetrics(total: Long, bothMapped: Long, onlyReadMapped: Long, } case class FlagStatMetrics(total: Long, duplicatesPrimary: DuplicateMetrics, duplicatesSecondary: DuplicateMetrics, - mapped: Long, pairedInSequencing: Long, - read1: Long, read2: Long, properlyPaired: Long, withSelfAndMateMapped: Long, - singleton: Long, withMateMappedToDiffChromosome: Long, - withMateMappedToDiffChromosomeMapQ5: Long, failedQuality: Boolean) { + mapped: Long, pairedInSequencing: Long, + read1: Long, read2: Long, properlyPaired: Long, withSelfAndMateMapped: Long, + singleton: Long, withMateMappedToDiffChromosome: Long, + withMateMappedToDiffChromosomeMapQ5: Long, failedQuality: Boolean) { def +(that: FlagStatMetrics): FlagStatMetrics = { assert(failedQuality == that.failedQuality, "Can't reduce passedVendorQuality with different failedQuality values") new FlagStatMetrics(total + that.total, diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/GenomicRegionPartitioner.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/GenomicRegionPartitioner.scala index b401d19d03..eeb6b186e7 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/GenomicRegionPartitioner.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/GenomicRegionPartitioner.scala @@ -76,10 +76,10 @@ class GenomicRegionPartitioner(val numParts: Int, val seqLengths: Map[Int, Long] case ReferencePosition.UNMAPPED => parts // everything else gets assigned normally. - case refpos: ReferencePosition => getPart(refpos.refId, refpos.pos) + case refpos: ReferencePosition => getPart(refpos.refId, refpos.pos) // only ReferencePosition values are partitioned using this partitioner - case _ => throw new IllegalArgumentException("Only ReferencePosition values can be partitioned by GenomicRegionPartitioner") + case _ => throw new IllegalArgumentException("Only ReferencePosition values can be partitioned by GenomicRegionPartitioner") } } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/GenotypesSummary.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/GenotypesSummary.scala index c249d85fb5..4b98130c98 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/GenotypesSummary.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/GenotypesSummary.scala @@ -42,13 +42,13 @@ import org.bdgenomics.adam.rdd.GenotypesSummaryCounts.ReferenceAndAlternate * */ case class GenotypesSummaryCounts( - genotypesCounts: GenotypesSummaryCounts.GenotypeAlleleCounts, - singleNucleotideVariantCounts: GenotypesSummaryCounts.VariantCounts, - multipleNucleotideVariantCount: Long, - insertionCount: Long, - deletionCount: Long, - readCount: Option[Long], - phasedCount: Long) { + genotypesCounts: GenotypesSummaryCounts.GenotypeAlleleCounts, + singleNucleotideVariantCounts: GenotypesSummaryCounts.VariantCounts, + multipleNucleotideVariantCount: Long, + insertionCount: Long, + deletionCount: Long, + readCount: Option[Long], + phasedCount: Long) { lazy val genotypesCount: Long = genotypesCounts.values.sum lazy val variantGenotypesCount: Long = @@ -164,9 +164,9 @@ object GenotypesSummaryCounts { * */ case class GenotypesSummary( - perSampleStatistics: StatisticsMap, - singletonCount: Long, - distinctVariantCount: Long) { + perSampleStatistics: StatisticsMap, + singletonCount: Long, + distinctVariantCount: Long) { lazy val aggregateStatistics = perSampleStatistics.values.foldLeft(GenotypesSummaryCounts())(_.combine(_)).withDefaultZeroCounts } @@ -181,9 +181,9 @@ object GenotypesSummary { stats1.keySet.union(stats2.keySet).map(sample => { (stats1.get(sample), stats2.get(sample)) match { case (Some(statsA), Some(statsB)) => sample -> statsA.combine(statsB) - case (Some(stats), None) => sample -> stats - case (None, Some(stats)) => sample -> stats - case (None, None) => throw new AssertionError("Unreachable") + case (Some(stats), None) => sample -> stats + case (None, Some(stats)) => sample -> stats + case (None, None) => throw new AssertionError("Unreachable") } }).toMap } @@ -270,7 +270,7 @@ object GenotypesSummaryFormatting { } result ++= "\tAverage read depth at called variants: %s\n".format(stats.averageReadDepthAtVariants match { case Some(depth) => "%1.1f".format(depth) - case None => "[no variant calls, or read depth missing for one or more variant calls]" + case None => "[no variant calls, or read depth missing for one or more variant calls]" }) result ++= "\tPhased genotypes: %d / %d = %1.3f%%\n".format( stats.phasedCount, @@ -296,8 +296,8 @@ object GenotypesSummaryFormatting { private def sortedGenotypeAlleles(stats: GenotypesSummaryCounts): Seq[List[ADAMGenotypeAllele]] = { def genotypeSortOrder(genotype: List[ADAMGenotypeAllele]): Int = genotype.map({ - case ADAMGenotypeAllele.Ref => 0 - case ADAMGenotypeAllele.Alt => 1 + case ADAMGenotypeAllele.Ref => 0 + case ADAMGenotypeAllele.Alt => 1 case ADAMGenotypeAllele.NoCall => 10 // arbitrary large number so any genotype with a NoCall sorts last. }).sum stats.genotypesCounts.keySet.toList.sortBy(genotypeSortOrder(_)) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/Reads2PileupProcessor.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/Reads2PileupProcessor.scala index 763e24d374..6fa8a33df7 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/Reads2PileupProcessor.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/Reads2PileupProcessor.scala @@ -36,7 +36,7 @@ private[rdd] object Reads2PileupProcessor { * If false, we only process reads that are at their primary alignment. Default is false. */ private[rdd] class Reads2PileupProcessor(createSecondaryAlignments: Boolean = false) - extends Serializable with Logging { + extends Serializable with Logging { /** * Converts a single read into a list of pileups. @@ -77,7 +77,7 @@ private[rdd] class Reads2PileupProcessor(createSecondaryAlignments: Boolean = fa val end: Long = record.end match { case Some(o) => o.asInstanceOf[Long] - case None => -1L + case None => -1L } assert(end != -1L, "Read is mapped but has a null end position. Read:\n" + record) @@ -151,7 +151,7 @@ private[rdd] class Reads2PileupProcessor(createSecondaryAlignments: Boolean = fa } else { if (mdTag.isDefined) { mdTag.get.mismatchedBase(referencePos) match { - case None => throw new IllegalArgumentException("Cigar match has no MD (mis)match @" + referencePos + " " + record.getCigar + " " + record.getMismatchingPositions) fillInStackTrace () + case None => throw new IllegalArgumentException("Cigar match has no MD (mis)match @" + referencePos + " " + record.getCigar + " " + record.getMismatchingPositions) fillInStackTrace () case Some(read) => Some(Base.valueOf(read.toString)) } } else { @@ -242,7 +242,7 @@ private[rdd] class Reads2PileupProcessor(createSecondaryAlignments: Boolean = fa val referenceBase: Option[Base] = if (mdTag.isDefined) { mdTag.get.mismatchedBase(referencePos) match { - case None => throw new IllegalArgumentException("Cigar match has no MD (mis)match @" + referencePos + " " + record.getCigar + " " + record.getMismatchingPositions) fillInStackTrace () + case None => throw new IllegalArgumentException("Cigar match has no MD (mis)match @" + referencePos + " " + record.getCigar + " " + record.getMismatchingPositions) fillInStackTrace () case Some(read) => Some(Base.valueOf(read.toString)) } } else { diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/RealignIndels.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/RealignIndels.scala index 3ee3f97b3f..22428a67e8 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/RealignIndels.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/RealignIndels.scala @@ -67,7 +67,7 @@ private[rdd] object RealignIndels { * @see mapTargets */ @tailrec final def mapToTarget(read: RichADAMRecord, - targets: TreeSet[(IndelRealignmentTarget, Int)]): Int = { + targets: TreeSet[(IndelRealignmentTarget, Int)]): Int = { // Perform tail call recursive binary search if (targets.size == 1) { if (TargetOrdering.contains(targets.head._1, read)) { @@ -214,7 +214,7 @@ private[rdd] class RealignIndels extends Serializable with Logging { // try to generate a consensus alignment - if a consensus exists, add it to our list of consensuses to test consensus = Consensus.generateAlternateConsensus(newRead.getSequence, newRead.getStart, newRead.samtoolsCigar) match { case Some(o) => o :: consensus - case None => consensus + case None => consensus } } else { // if the read does not have mismatches, then we needn't process it further diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/RegionJoin.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/RegionJoin.scala index 0d063370d3..b75bd1374c 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/RegionJoin.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/RegionJoin.scala @@ -67,12 +67,12 @@ object RegionJoin { * corresponding to x overlaps the region corresponding to y. */ def partitionAndJoin[T, U](sc: SparkContext, - seqDict: SequenceDictionary, - baseRDD: RDD[T], - joinedRDD: RDD[U])(implicit tMapping: ReferenceMapping[T], - uMapping: ReferenceMapping[U], - tManifest: ClassManifest[T], - uManifest: ClassManifest[U]): RDD[(T, U)] = { + seqDict: SequenceDictionary, + baseRDD: RDD[T], + joinedRDD: RDD[U])(implicit tMapping: ReferenceMapping[T], + uMapping: ReferenceMapping[U], + tManifest: ClassManifest[T], + uManifest: ClassManifest[U]): RDD[(T, U)] = { /** * Original Join Design: @@ -148,10 +148,10 @@ object RegionJoin { * */ def cartesianFilter[T, U](baseRDD: RDD[T], - joinedRDD: RDD[U])(implicit tMapping: ReferenceMapping[T], - uMapping: ReferenceMapping[U], - tManifest: ClassManifest[T], - uManifest: ClassManifest[U]): RDD[(T, U)] = { + joinedRDD: RDD[U])(implicit tMapping: ReferenceMapping[T], + uMapping: ReferenceMapping[U], + tManifest: ClassManifest[T], + uManifest: ClassManifest[U]): RDD[(T, U)] = { baseRDD.cartesian(joinedRDD).filter({ case (t: T, u: U) => tMapping.getReferenceRegion(t).overlaps(uMapping.getReferenceRegion(u)) @@ -336,7 +336,7 @@ object NonoverlappingRegions { * all the x's must be valid refIds with respect to the sequence dictionary. */ class MultiContigNonoverlappingRegions(seqDict: SequenceDictionary, regions: Seq[(Int, Seq[ReferenceRegion])]) - extends Serializable { + extends Serializable { assert(regions != null, "Regions was set to null") @@ -349,13 +349,13 @@ class MultiContigNonoverlappingRegions(seqDict: SequenceDictionary, regions: Seq def regionsFor[U](regionable: U)(implicit mapping: ReferenceMapping[U]): Iterable[ReferenceRegion] = regionMap.get(mapping.getReferenceId(regionable)) match { - case None => Seq() + case None => Seq() case Some(nr) => nr.regionsFor(regionable) } def filter[U](value: U)(implicit mapping: ReferenceMapping[U]): Boolean = regionMap.get(mapping.getReferenceId(value)) match { - case None => false + case None => false case Some(nr) => nr.hasRegionsFor(value) } } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/comparisons/ComparisonTraversalEngine.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/comparisons/ComparisonTraversalEngine.scala index 87b2bc6aa9..6cfe6831a1 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/comparisons/ComparisonTraversalEngine.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/comparisons/ComparisonTraversalEngine.scala @@ -45,14 +45,14 @@ class ComparisonTraversalEngine(schema: Seq[FieldValue], input1: RDD[ADAMRecord] def uniqueToNamed1(): Long = { named1.leftOuterJoin(named2).filter { case (name, (bucket1, Some(bucket2))) => false - case (name, (bucket1, None)) => true + case (name, (bucket1, None)) => true }.count() } def uniqueToNamed2(): Long = { named2.leftOuterJoin(named1).filter { case (name, (bucket1, Some(bucket2))) => false - case (name, (bucket1, None)) => true + case (name, (bucket1, None)) => true }.count() } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/BaseQualityRecalibration.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/BaseQualityRecalibration.scala index de2d4f040a..9191f3ee61 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/BaseQualityRecalibration.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/BaseQualityRecalibration.scala @@ -42,7 +42,7 @@ import org.apache.spark.rdd.RDD class BaseQualityRecalibration( val reads: RDD[DecadentRead], val knownSnps: Broadcast[SnpTable]) - extends Serializable with Logging { + extends Serializable with Logging { // Additional covariates to use when computing the correction // TODO: parameterize diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/Covariate.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/Covariate.scala index 506fc045f7..8a28b6ae29 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/Covariate.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/Covariate.scala @@ -47,7 +47,7 @@ trait Covariate { // Format the provided Value to be compatible with GATK's CSV output def toCSV(option: Option[Value]): String = option match { - case None => "(none)" + case None => "(none)" case Some(value) => value.toString } @@ -66,9 +66,9 @@ abstract class AbstractCovariate[ValueT] extends Covariate with Serializable { * covariate valuess are in `extras`. */ class CovariateKey( - val readGroup: String, - val quality: QualityScore, - val extras: Seq[Option[Covariate#Value]]) extends Serializable { + val readGroup: String, + val quality: QualityScore, + val extras: Seq[Option[Covariate#Value]]) extends Serializable { def parts: Seq[Any] = Seq(readGroup, quality) ++ extras @@ -120,7 +120,7 @@ class CovariateSpace(val extras: IndexedSeq[Covariate]) extends Serializable { override def equals(other: Any): Boolean = other match { case that: CovariateSpace => this.extras == that.extras - case _ => false + case _ => false } override def hashCode = Util.hashCombine(0x48C35799, extras.hashCode) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/DinucCovariate.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/DinucCovariate.scala index 6ed5880dac..a4f4cd6b07 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/DinucCovariate.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/DinucCovariate.scala @@ -61,7 +61,7 @@ class DinucCovariate extends AbstractCovariate[(Char, Char)] { } override def toCSV(option: Option[Value]): String = option match { - case None => "NN" + case None => "NN" case Some(value) => "%s%s".format(value._1, value._2) } @@ -69,7 +69,7 @@ class DinucCovariate extends AbstractCovariate[(Char, Char)] { override def equals(other: Any) = other match { case that: DinucCovariate => true - case _ => false + case _ => false } override def hashCode = 0x9EAC50CB diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/ObservationTable.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/ObservationTable.scala index c8438eec8e..a6f398ece4 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/ObservationTable.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/ObservationTable.scala @@ -84,7 +84,7 @@ class Observation(val total: Long, val mismatches: Long) extends Serializable { override def equals(other: Any): Boolean = other match { case that: Observation => this.total == that.total && this.mismatches == that.mismatches - case _ => false + case _ => false } override def hashCode = Util.hashCombine(0x634DAED9, total.hashCode, mismatches.hashCode) @@ -97,10 +97,10 @@ object Observation { } class Aggregate private ( - total: Long, // number of total observations - mismatches: Long, // number of mismatches observed - val expectedMismatches: Double // expected number of mismatches based on reported quality scores - ) extends Observation(total, mismatches) { + total: Long, // number of total observations + mismatches: Long, // number of mismatches observed + val expectedMismatches: Double // expected number of mismatches based on reported quality scores + ) extends Observation(total, mismatches) { require(expectedMismatches <= total) @@ -124,8 +124,8 @@ object Aggregate { * Table containing the empirical frequency of mismatches for each set of covariate values. */ class ObservationTable( - val space: CovariateSpace, - val entries: Map[CovariateKey, Observation]) extends Serializable { + val space: CovariateSpace, + val entries: Map[CovariateKey, Observation]) extends Serializable { // `func' computes the aggregation key def aggregate[K](func: (CovariateKey, Observation) => K): Map[K, Aggregate] = { diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/Recalibrator.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/Recalibrator.scala index 171c14c6b3..ebbb8aa526 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/Recalibrator.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/recalibration/Recalibrator.scala @@ -26,7 +26,7 @@ import org.bdgenomics.adam.util.QualityScore import math.{ exp, log } class Recalibrator(val table: RecalibrationTable, val minAcceptableQuality: QualityScore) - extends (DecadentRead => ADAMRecord) with Serializable { + extends (DecadentRead => ADAMRecord) with Serializable { def apply(read: DecadentRead): ADAMRecord = { val record: ADAMRecord = read.record @@ -62,7 +62,7 @@ class RecalibrationTable( val qualityTable: Map[(String, QualityScore), Aggregate], // marginals for each optional covariate by read group and quality val extraTables: IndexedSeq[Map[(String, QualityScore, Option[Covariate#Value]), Aggregate]]) - extends (DecadentRead => Seq[QualityScore]) with Serializable { + extends (DecadentRead => Seq[QualityScore]) with Serializable { def apply(read: DecadentRead): Seq[QualityScore] = covariates(read).map(lookup) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/variation/ADAMVariationContext.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/variation/ADAMVariationContext.scala index 204be995b4..3f707322a1 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/variation/ADAMVariationContext.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/variation/ADAMVariationContext.scala @@ -35,7 +35,7 @@ private object ADAMVCFOutputFormat { def getHeader: VCFHeader = header match { case Some(h) => h - case None => setHeader(Seq()) + case None => setHeader(Seq()) } def setHeader(samples: Seq[String]): VCFHeader = { diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/variation/ADAMVariationRDDFunctions.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/variation/ADAMVariationRDDFunctions.scala index ac69f14fb4..f888dca244 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rdd/variation/ADAMVariationRDDFunctions.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rdd/variation/ADAMVariationRDDFunctions.scala @@ -88,7 +88,7 @@ class ADAMGenotypeRDDFunctions(rdd: RDD[ADAMGenotype]) extends Serializable with // Compute RDD[sample -> ConcordanceTable] across variants/samples val inTestPairs = inTest.map({ case ((_, sample), (l, Some(r))) => sample -> (l.getType, r.getType) - case ((_, sample), (l, None)) => sample -> (l.getType, ADAMGenotypeType.NO_CALL) + case ((_, sample), (l, None)) => sample -> (l.getType, ADAMGenotypeType.NO_CALL) }) val justInTruthPairs = justInTruth.map({ // "truth-only" entries case ((_, sample), r) => sample -> (ADAMGenotypeType.NO_CALL, r.getType) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rich/RichCigar.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rich/RichCigar.scala index cc0841abd3..6f2e58a394 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rich/RichCigar.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rich/RichCigar.scala @@ -39,7 +39,7 @@ class RichCigar(cigar: Cigar) { cigar.getCigarElements.map(element => { element.getOperator match { case CigarOperator.M => 1 - case _ => 0 + case _ => 0 } }).reduce(_ + _) } @@ -63,8 +63,8 @@ class RichCigar(cigar: Cigar) { * @return List of cigar elements with single element moved. */ @tailrec def moveCigarLeft(head: List[CigarElement], - index: Int, - cigarElements: List[CigarElement]): List[CigarElement] = { + index: Int, + cigarElements: List[CigarElement]): List[CigarElement] = { if (index == 1) { val elementToTrim = cigarElements.head val elementToMove: Option[CigarElement] = Some(cigarElements(1)) @@ -90,7 +90,7 @@ class RichCigar(cigar: Cigar) { // if there are elements afterwards, pad the first one val elementPadded = elementToPad match { case Some(o: CigarElement) => Some(new CigarElement(o.getLength + 1, o.getOperator)) - case _ => Some(new CigarElement(1, CigarOperator.M)) + case _ => Some(new CigarElement(1, CigarOperator.M)) } // flatmap to remove empty options diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/rich/RichRDDReferenceRecords.scala b/adam-core/src/main/scala/org/bdgenomics/adam/rich/RichRDDReferenceRecords.scala index 9ce64077fe..9a99db7544 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/rich/RichRDDReferenceRecords.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/rich/RichRDDReferenceRecords.scala @@ -24,8 +24,8 @@ import org.apache.spark.SparkContext import org.apache.avro.specific.SpecificRecord class RichRDDReferenceRecords[T <: SpecificRecord: ClassManifest](rdd: RDD[T], - mapping: ReferenceMapping[T]) - extends Serializable { + mapping: ReferenceMapping[T]) + extends Serializable { def remapReferenceId(map: Map[Int, Int])(implicit sc: SparkContext): RDD[T] = { // If the reference IDs match, we don't need to do any remapping, just return the previous RDD diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/util/ADAMVCFOutputFormat.scala b/adam-core/src/main/scala/org/bdgenomics/adam/util/ADAMVCFOutputFormat.scala index 11262292c1..dd802b7cb0 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/util/ADAMVCFOutputFormat.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/util/ADAMVCFOutputFormat.scala @@ -65,7 +65,7 @@ object ADAMVCFOutputFormat { } class ADAMVCFOutputFormat[K] - extends KeyIgnoringVCFOutputFormat[K](VCFFormat.valueOf("VCF")) { + extends KeyIgnoringVCFOutputFormat[K](VCFFormat.valueOf("VCF")) { setHeader(ADAMVCFOutputFormat.getHeader) } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/util/AttributeUtils.scala b/adam-core/src/main/scala/org/bdgenomics/adam/util/AttributeUtils.scala index 6770dbd417..36329b3e7c 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/util/AttributeUtils.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/util/AttributeUtils.scala @@ -29,11 +29,11 @@ object AttributeUtils { def convertSAMTagAndValue(attr: SAMTagAndValue): Attribute = { attr.value match { - case x: java.lang.Integer => Attribute(attr.tag, TagType.Integer, attr.value.asInstanceOf[Int]) + case x: java.lang.Integer => Attribute(attr.tag, TagType.Integer, attr.value.asInstanceOf[Int]) case x: java.lang.Character => Attribute(attr.tag, TagType.Character, attr.value.asInstanceOf[Char]) - case x: java.lang.Float => Attribute(attr.tag, TagType.Float, attr.value.asInstanceOf[Float]) - case x: java.lang.String => Attribute(attr.tag, TagType.String, attr.value.asInstanceOf[String]) - case Array(_*) => Attribute(attr.tag, TagType.ByteSequence, attr.value.asInstanceOf[Array[java.lang.Byte]]) + case x: java.lang.Float => Attribute(attr.tag, TagType.Float, attr.value.asInstanceOf[Float]) + case x: java.lang.String => Attribute(attr.tag, TagType.String, attr.value.asInstanceOf[String]) + case Array(_*) => Attribute(attr.tag, TagType.ByteSequence, attr.value.asInstanceOf[Array[java.lang.Byte]]) // It appears from the code, that 'H' is encoded as a String as well? I'm not sure // how to pull that out here. } @@ -86,10 +86,10 @@ object AttributeUtils { private def typedStringToValue(tagType: TagType.Value, valueStr: String): Any = { tagType match { - case TagType.Character => valueStr(0) - case TagType.Integer => Integer.valueOf(valueStr) - case TagType.Float => java.lang.Float.valueOf(valueStr) - case TagType.String => valueStr + case TagType.Character => valueStr(0) + case TagType.Integer => Integer.valueOf(valueStr) + case TagType.Float => java.lang.Float.valueOf(valueStr) + case TagType.String => valueStr case TagType.ByteSequence => valueStr.map(c => java.lang.Byte.valueOf("" + c)) case TagType.NumericSequence => valueStr.split(",").map(c => { if (c.contains(".")) java.lang.Float.valueOf(c) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/util/Histogram.scala b/adam-core/src/main/scala/org/bdgenomics/adam/util/Histogram.scala index efa485598a..9196730409 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/util/Histogram.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/util/Histogram.scala @@ -41,10 +41,10 @@ class Histogram[T](val valueToCount: Map[T, Int]) extends Aggregated[T] with Ser private def defaultFilter(x: Any): Boolean = { x match { case (x1: Any, x2: Any) => x1 == x2 - case i: Int => i == 0 - case l: Long => l == 0L - case b: Boolean => b - case _ => false + case i: Int => i == 0 + case l: Long => l == 0L + case b: Boolean => b + case _ => false } } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/util/IntervalListReader.scala b/adam-core/src/main/scala/org/bdgenomics/adam/util/IntervalListReader.scala index 882209ba93..d996f4e406 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/util/IntervalListReader.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/util/IntervalListReader.scala @@ -93,7 +93,7 @@ class IntervalListReader(file: File) extends Traversable[(ReferenceRegion, Strin case "SN" => name = arg case "UR" => url = arg case "LN" => length = arg.toLong - case _ => None + case _ => None } } } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/util/MapTools.scala b/adam-core/src/main/scala/org/bdgenomics/adam/util/MapTools.scala index 5f1e11fa7e..013789dc7a 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/util/MapTools.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/util/MapTools.scala @@ -39,7 +39,7 @@ object MapTools { * @return */ def add[KeyType, NumberType](map1: Map[KeyType, NumberType], - map2: Map[KeyType, NumberType])(implicit ops: Numeric[NumberType]): Map[KeyType, NumberType] = { + map2: Map[KeyType, NumberType])(implicit ops: Numeric[NumberType]): Map[KeyType, NumberType] = { (map1.keys ++ map2.keys.filter(!map1.contains(_))).map { (key: KeyType) => diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/util/MdTag.scala b/adam-core/src/main/scala/org/bdgenomics/adam/util/MdTag.scala index 7e408249b1..ca58bab9b2 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/util/MdTag.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/util/MdTag.scala @@ -234,9 +234,9 @@ object MdTag { } class MdTag( - private val matches: immutable.List[NumericRange[Long]], - private val mismatches: immutable.Map[Long, Char], - private val deletes: immutable.Map[Long, Char]) { + private val matches: immutable.List[NumericRange[Long]], + private val mismatches: immutable.Map[Long, Char], + private val deletes: immutable.Map[Long, Char]) { /** * Returns whether a base is a match against the reference. @@ -332,7 +332,7 @@ class MdTag( reference += { mismatches.get(referencePos) match { case Some(base) => base - case _ => throw new IllegalStateException("Could not find mismatching base at cigar offset" + i) + case _ => throw new IllegalStateException("Could not find mismatching base at cigar offset" + i) } } } else { @@ -349,7 +349,7 @@ class MdTag( reference += { deletes.get(referencePos) match { case Some(base) => base - case _ => throw new IllegalStateException("Could not find deleted base at cigar offset " + i) + case _ => throw new IllegalStateException("Could not find deleted base at cigar offset " + i) } } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/util/PileupTraversable.scala b/adam-core/src/main/scala/org/bdgenomics/adam/util/PileupTraversable.scala index 25817001fc..878df879f7 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/util/PileupTraversable.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/util/PileupTraversable.scala @@ -36,39 +36,39 @@ object Base extends Enumeration with Serializable { abstract class PileupEvent(readName: String) extends Serializable case class MatchEvent(readName: String, - isReverseStrand: Boolean, - eventOffset: Int, - eventLength: Int, - mapQ: Int, - qual: Int) extends PileupEvent(readName) + isReverseStrand: Boolean, + eventOffset: Int, + eventLength: Int, + mapQ: Int, + qual: Int) extends PileupEvent(readName) case class MismatchEvent(readName: String, - mismatchedBase: Base.Value, - isReverseStrand: Boolean, - eventOffset: Int, - eventLength: Int, - mapQ: Int, - qual: Int) extends PileupEvent(readName) + mismatchedBase: Base.Value, + isReverseStrand: Boolean, + eventOffset: Int, + eventLength: Int, + mapQ: Int, + qual: Int) extends PileupEvent(readName) case class InsertionEvent(readName: String, - insertedSequence: String, - mapQ: Int, - qual: Int) extends PileupEvent(readName) + insertedSequence: String, + mapQ: Int, + qual: Int) extends PileupEvent(readName) case class DeletionEvent(readName: String, - eventOffset: Int, - eventLength: Int, - mapQ: Int, - qual: Int) extends PileupEvent(readName) + eventOffset: Int, + eventLength: Int, + mapQ: Int, + qual: Int) extends PileupEvent(readName) class Pileup(val referenceId: Int, - val referencePosition: Long, - val referenceName: String, - val referenceBase: Option[Base.Value], - val matches: List[MatchEvent] = List.empty, - val mismatches: List[MismatchEvent] = List.empty, - val insertions: List[InsertionEvent] = List.empty, - val deletes: List[DeletionEvent] = List.empty) extends Serializable { + val referencePosition: Long, + val referenceName: String, + val referenceBase: Option[Base.Value], + val matches: List[MatchEvent] = List.empty, + val mismatches: List[MismatchEvent] = List.empty, + val insertions: List[InsertionEvent] = List.empty, + val deletes: List[DeletionEvent] = List.empty) extends Serializable { val numReads = matches.length + mismatches.length + insertions.length + deletes.length } diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/util/QualityScore.scala b/adam-core/src/main/scala/org/bdgenomics/adam/util/QualityScore.scala index 203c6cb800..4ef7bccec2 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/util/QualityScore.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/util/QualityScore.scala @@ -32,7 +32,7 @@ class QualityScore(val phred: Int) extends Ordered[QualityScore] with Serializab override def equals(other: Any): Boolean = other match { case that: QualityScore => this.phred == that.phred - case _ => false + case _ => false } override def hashCode: Int = Util.hashCombine(0x26C2E0BA, phred.hashCode) diff --git a/adam-core/src/test/scala/org/bdgenomics/adam/algorithms/realignmenttarget/IndelRealignmentTargetSuite.scala b/adam-core/src/test/scala/org/bdgenomics/adam/algorithms/realignmenttarget/IndelRealignmentTargetSuite.scala index 1ff2e38f50..11ff4da89c 100644 --- a/adam-core/src/test/scala/org/bdgenomics/adam/algorithms/realignmenttarget/IndelRealignmentTargetSuite.scala +++ b/adam-core/src/test/scala/org/bdgenomics/adam/algorithms/realignmenttarget/IndelRealignmentTargetSuite.scala @@ -236,12 +236,12 @@ class IndelRealignmentTargetSuite extends SparkFunSuite { def check_indel(target: IndelRealignmentTarget, read: ADAMRecord): Boolean = { val indelRange: NumericRange[Long] = target.indelSet.head.getIndelRange() read.start.toLong match { - case 5L => ((indelRange.start == 34) && (indelRange.end == 43)) + case 5L => ((indelRange.start == 34) && (indelRange.end == 43)) case 10L => ((indelRange.start == 54) && (indelRange.end == 63)) case 15L => ((indelRange.start == 34) && (indelRange.end == 43)) case 20L => ((indelRange.start == 54) && (indelRange.end == 63)) case 25L => ((indelRange.start == 34) && (indelRange.end == 43)) - case _ => false + case _ => false } } diff --git a/adam-core/src/test/scala/org/bdgenomics/adam/rdd/MarkDuplicatesSuite.scala b/adam-core/src/test/scala/org/bdgenomics/adam/rdd/MarkDuplicatesSuite.scala index 9d10369764..a84f7a546e 100644 --- a/adam-core/src/test/scala/org/bdgenomics/adam/rdd/MarkDuplicatesSuite.scala +++ b/adam-core/src/test/scala/org/bdgenomics/adam/rdd/MarkDuplicatesSuite.scala @@ -27,9 +27,9 @@ class MarkDuplicatesSuite extends SparkFunSuite { } def createMappedRead(referenceId: Int, position: Long, - readName: String = UUID.randomUUID().toString, avgPhredScore: Int = 20, - numClippedBases: Int = 0, isPrimaryAlignment: Boolean = true, - isNegativeStrand: Boolean = false) = { + readName: String = UUID.randomUUID().toString, avgPhredScore: Int = 20, + numClippedBases: Int = 0, isPrimaryAlignment: Boolean = true, + isNegativeStrand: Boolean = false) = { assert(avgPhredScore >= 10 && avgPhredScore <= 50) val qual = (for (i <- 0 until 100) yield (avgPhredScore + 33).toChar).toString() val cigar = if (numClippedBases > 0) "%dS%dM".format(numClippedBases, 100 - numClippedBases) else "100M" @@ -51,9 +51,9 @@ class MarkDuplicatesSuite extends SparkFunSuite { } def createPair(firstReferenceId: Int, firstPosition: Long, - secondReferenceId: Int, secondPosition: Long, - readName: String = UUID.randomUUID().toString, - avgPhredScore: Int = 20): Seq[ADAMRecord] = { + secondReferenceId: Int, secondPosition: Long, + readName: String = UUID.randomUUID().toString, + avgPhredScore: Int = 20): Seq[ADAMRecord] = { val firstOfPair = createMappedRead(firstReferenceId, firstPosition, readName = readName, avgPhredScore = avgPhredScore) firstOfPair.setFirstOfPair(true) diff --git a/adam-core/src/test/scala/org/bdgenomics/adam/rdd/RealignIndelsSuite.scala b/adam-core/src/test/scala/org/bdgenomics/adam/rdd/RealignIndelsSuite.scala index df8a7353c9..25a141dade 100644 --- a/adam-core/src/test/scala/org/bdgenomics/adam/rdd/RealignIndelsSuite.scala +++ b/adam-core/src/test/scala/org/bdgenomics/adam/rdd/RealignIndelsSuite.scala @@ -86,7 +86,7 @@ class RealignIndelsSuite extends SparkFunSuite { if (r.mdTag.get.hasMismatches) { consensus = Consensus.generateAlternateConsensus(r.getSequence, r.getStart, r.samtoolsCigar) match { case Some(o) => o :: consensus - case None => consensus + case None => consensus } } }) diff --git a/adam-core/src/test/scala/org/bdgenomics/adam/rdd/RegionJoinSuite.scala b/adam-core/src/test/scala/org/bdgenomics/adam/rdd/RegionJoinSuite.scala index c448d582e1..47037cc01b 100644 --- a/adam-core/src/test/scala/org/bdgenomics/adam/rdd/RegionJoinSuite.scala +++ b/adam-core/src/test/scala/org/bdgenomics/adam/rdd/RegionJoinSuite.scala @@ -269,7 +269,7 @@ class RegionJoinSuite extends SparkFunSuite { .filter({ case ((_: ADAMRecord, (cartesian: ADAMRecord, region: Option[ADAMRecord]))) => region match { - case None => false + case None => false case Some(record) => cartesian == record } })