-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: Create class for returning union of features and covariates (#237)
- Loading branch information
1 parent
dfae3c2
commit 9733844
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/main/scala/au/csiro/variantspark/input/UnionedFeatureSource.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package au.csiro.variantspark.input | ||
|
||
import au.csiro.variantspark.data.Feature | ||
import org.apache.spark.rdd.RDD | ||
|
||
case class UnionedFeatureSource(featureSource: FeatureSource, covariateSource: FeatureSource) | ||
extends FeatureSource { | ||
def sampleNames: List[String] = featureSource.sampleNames | ||
|
||
def features: RDD[Feature] = { | ||
val features = featureSource.features | ||
val covariates = covariateSource.features | ||
features.union(covariates) | ||
} | ||
} |