Skip to content

Commit

Permalink
fix: undo all excluded biotypes and chromosomes as it is not a api pr…
Browse files Browse the repository at this point in the history
…oblem but rather a pipeline one.
  • Loading branch information
mkarmona committed Mar 18, 2019
1 parent fe98972 commit 09bd5c2
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions app/models/Backend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ class Backend @Inject()(@NamedDatabase("default") protected val dbConfigProvider
config.get[Int]("ot.elasticsearch.port"))
val esQ = HttpClient(esUri)

val geneBiotypeExclusionList = config.get[Seq[String]]("ot.genes.biotype_exclude")
val geneChromExclusionList = config.get[Seq[String]]("ot.genes.chromosome_exclude")

def buildPheWASTable(variantID: String, pageIndex: Option[Int], pageSize: Option[Int]):
Future[Entities.PheWASTable] = {
val limitClause = parsePaginationTokens(pageIndex, pageSize)
Expand Down Expand Up @@ -290,9 +287,7 @@ class Backend @Inject()(@NamedDatabase("default") protected val dbConfigProvider

def getGenes(geneIds: Seq[String]): Future[Seq[Gene]] = {
if (geneIds.nonEmpty) {
val q = genes.filter(r => (r.id inSetBind geneIds) &&
!(r.bioType inSet geneBiotypeExclusionList) &&
!(r.chromosome inSet geneChromExclusionList))
val q = genes.filter(r => (r.id inSetBind geneIds))

db.run(q.result.asTry).map {
case Success(v) => v
Expand Down Expand Up @@ -497,9 +492,7 @@ class Backend @Inject()(@NamedDatabase("default") protected val dbConfigProvider
val geneIdsInLoci = genes.filter(r =>
(r.chromosome === chr) &&
((r.start >= start && r.start <= end) ||
(r.end >= start && r.end <= end)) &&
!(r.bioType inSet geneBiotypeExclusionList) &&
!(r.chromosome inSet geneChromExclusionList))
(r.end >= start && r.end <= end)))
.map(_.id)

val assocsQ = d2v2gScored.filter(r => (r.leadChromosome === chr) && (
Expand Down Expand Up @@ -557,9 +550,7 @@ class Backend @Inject()(@NamedDatabase("default") protected val dbConfigProvider

variant match {
case Right(v) =>
val geneIdsInLoci = genes.filter(r => (r.chromosome === v.chromosome) &&
!(r.bioType inSet geneBiotypeExclusionList) &&
!(r.chromosome inSet geneChromExclusionList))
val geneIdsInLoci = genes.filter(r => (r.chromosome === v.chromosome))
.map(_.id)

val filteredV2Gs = v2gs.filter(r => (r.chromosome === v.chromosome) &&
Expand Down

0 comments on commit 09bd5c2

Please sign in to comment.