Skip to content

Commit

Permalink
Removed unnescessary labels from similarity detail service.
Browse files Browse the repository at this point in the history
  • Loading branch information
balhoff committed Jul 2, 2015
1 parent 45a03c8 commit 7be10e7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/scala/org/phenoscape/kb/Similarity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object Similarity {
def evolutionaryProfilesSimilarToGene(gene: IRI, limit: Int = 20, offset: Int = 0): Future[Seq[SimilarityMatch]] =
App.executeSPARQLQuery(geneToTaxonProfileQuery(gene, limit, offset), constructMatchFor(gene))

def bestAnnotationsMatchesForComparison(gene: IRI, taxon: IRI): Future[Seq[AnnotationPair]] = {
def bestAnnotationsMatchesForComparison(gene: IRI, taxon: IRI): Future[Seq[UnlabelledAnnotationPair]] = {
val geneInd = Individual(gene)
val taxonInd = Individual(taxon)
(for {
Expand Down Expand Up @@ -79,7 +79,7 @@ object Similarity {
}
}).flatMap(identity)
}
}).flatMap(identity).map(_.take(20)).flatMap(addLabels)
}).flatMap(identity).map(_.take(20))
}

def addLabels(unlabelleds: Seq[UnlabelledAnnotationPair]): Future[Seq[AnnotationPair]] = {
Expand Down Expand Up @@ -247,7 +247,15 @@ object SimilarityMatch {
//
//}

case class UnlabelledAnnotationPair(queryAnnotation: IRI, corpusAnnotation: IRI, bestSubsumer: SubsumerWithDisparity)
case class UnlabelledAnnotationPair(queryAnnotation: IRI, corpusAnnotation: IRI, bestSubsumer: SubsumerWithDisparity) extends JSONResultItem {

def toJSON: JsObject = {
Map("query_annotation" -> Map("@id" -> queryAnnotation.toString).toJson,
"corpus_annotation" -> Map("@id" -> corpusAnnotation.toString).toJson,
"best_subsumer" -> bestSubsumer.toJSON).toJson.asJsObject
}

}

case class AnnotationPair(queryAnnotation: MinimalTerm, corpusAnnotation: MinimalTerm, bestSubsumer: SubsumerWithDisparity) extends JSONResultItem {

Expand Down

0 comments on commit 7be10e7

Please sign in to comment.