au.csiro.variantspark.api.CommonPairwiseOperation.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.api
import au.csiro.variantspark.algo.metrics.ManhattanPairwiseMetric
import au.csiro.variantspark.algo.metrics.EuclideanPairwiseMetric
import au.csiro.variantspark.algo.{AggregablePairwiseOperation, PairwiseOperation}
import au.csiro.variantspark.algo.metrics.SharedAltAlleleCount
import au.csiro.variantspark.algo.metrics.AtLeastOneSharedAltAlleleCount
object CommonPairwiseOperation {
/**
* Mapping class for commong pairwise operations
*/
val mapping: Map[String, AggregablePairwiseOperation] = Map(
"manhattan" -> ManhattanPairwiseMetric, "euclidean" -> EuclideanPairwiseMetric,
"sharedAltAlleleCount" -> SharedAltAlleleCount,
"anySharedAltAlleleCount" -> AtLeastOneSharedAltAlleleCount)
/**
* Find a pairwise operation with give name.
*
* @param name: the name of the operation to return.
* @return returns a [[au.csiro.variantspark.algo.PairwiseOperation]] with specified name.
*/
def withName(name: String): PairwiseOperation = mapping(name)
}