Skip to content

Commit

Permalink
Merge pull request #652 from erictu/master
Browse files Browse the repository at this point in the history
added filterByOverlappingRegion in GeneFeatureRDDFunctions
  • Loading branch information
fnothaft committed Apr 17, 2015
2 parents 3be1fb0 + 1a5178e commit 1b79e25
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -122,5 +122,13 @@ class GeneFeatureRDDFunctions(featureRDD: RDD[Feature]) extends Serializable wit

genes
}

def filterByOverlappingRegion(query: ReferenceRegion): RDD[Feature] = {
def overlapsQuery(rec: Feature): Boolean =
rec.getContig.getContigName.toString == query.referenceName &&
rec.getStart < query.end &&
rec.getEnd > query.start
featureRDD.filter(overlapsQuery)
}
}

0 comments on commit 1b79e25

Please sign in to comment.