Class SynHit

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<SynHit>
    Direct Known Subclasses:
    MentionMappingResult.RejectionSynHit

    public class SynHit
    extends java.lang.Object
    implements java.lang.Comparable<SynHit>, java.lang.Cloneable
    • Constructor Detail

      • SynHit

        public SynHit​(java.lang.String synonym,
                      double score,
                      java.util.List<java.lang.String> ids,
                      java.lang.String source,
                      java.util.List<java.lang.String> taxIds)
      • SynHit

        public SynHit​(java.lang.String syn,
                      double score,
                      java.lang.String xid,
                      java.lang.String source)
        Parameters:
        syn -
        score -
        xid -
        source -
    • Method Detail

      • getSpeciesMentionScores

        public java.util.Map<java.lang.String,​java.lang.Double> getSpeciesMentionScores()
      • getSpeciesMentionScore

        public java.lang.Double getSpeciesMentionScore​(java.lang.String taxId)
      • setSpeciesMentionScore

        public void setSpeciesMentionScore​(java.lang.String taxId,
                                           double speciesMentionScore)
      • restrictToTaxId

        public void restrictToTaxId​(java.lang.String taxId)
      • getMentionScore

        public double getMentionScore()
        Returns:
      • setMentionScore

        public void setMentionScore​(double score)
      • getSemanticScore

        public double getSemanticScore()
      • setSemanticScore

        public void setSemanticScore​(double score)
      • getSynonym

        public java.lang.String getSynonym()
      • setSynonym

        public void setSynonym​(java.lang.String syn)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(SynHit o)
        the comparator for two SynHits: order by score as set by setCompareType method TODO: find rule how to order if several SynHits have same score currently, random number is chosen
        Specified by:
        compareTo in interface java.lang.Comparable<SynHit>
        Parameters:
        o -
        Returns:
        int
      • getSource

        public java.lang.String getSource()
      • setSource

        public void setSource​(java.lang.String source)
      • getMappedMention

        public java.lang.String getMappedMention()
        The potentially normalized and/or transformed original entity text mention for which this candidate has been retrieved.
        Returns:
        The string-normalized entity name that this candidate was matched to.
      • setMappedMention

        public void setMappedMention​(java.lang.String mappedSynonym)
      • isExactMatch

        public boolean isExactMatch()
      • clone

        public SynHit clone()
                     throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • getIds

        public java.util.List<java.lang.String> getIds()
      • setIds

        public void setIds​(java.util.List<java.lang.String> ids)
      • isDisambiguated

        public boolean isDisambiguated()

        Returns true if a single gene or protein ID of this synonym has been determined.

        Returns:
        true if the final gene/protein ID of this synonym has been set, false otherwise.
      • isAmbiguousInGeneral

        public boolean isAmbiguousInGeneral()

        Returns true if there is more than one gene ID associated with this synonym.

        Returns:
        Whether there are multiple gene IDs for this synonym.
      • isIntraSpeciesAmbiguousInGeneral

        public boolean isIntraSpeciesAmbiguousInGeneral()

        Returns true if at least one taxonomy ID associated with this synonym appears multiple times.

        Returns:
        Whether this synonym exists for multiple different genes of the same species.
      • isInterSpeciesAmbiguousInGeneral

        public boolean isInterSpeciesAmbiguousInGeneral()

        Returns true if there are at least two distinct taxonomy IDs associated with this synonym.

        Returns:
        Whether there are multiple different species that have a gene with this synonym.
      • getId

        public java.lang.String getId()
      • setId

        public void setId​(java.lang.String id)
      • getTaxIds

        public java.util.List<java.lang.String> getTaxIds()
      • setTaxIds

        public void setTaxIds​(java.util.List<java.lang.String> taxIds)
      • getOverallScore

        public double getOverallScore()
      • setOverallScore

        public void setOverallScore​(double overallScore)
      • getMappedGeneName

        public GeneName getMappedGeneName()
      • setMappedGeneName

        public void setMappedGeneName​(GeneName mappedGeneName)
      • getTaxId

        public java.lang.String getTaxId()

        Returns this single accepted taxonomy ID for this synonym (depends on the document context and may be differ for different textual occurrences of this synonym) or null if not set.

        The taxonomy ID is set by setTaxId(String).

        Returns:
        The taxonomy ID associated with this synonym or null if it wasn't successfully set.
        See Also:
        setTaxId(String), getTaxIds()
      • setTaxId

        public void setTaxId​(java.lang.String taxId)

        Accepts the passed taxonomy ID as assigned to this synonym. This causes the taxonomySpecificIds field to be set which can be retrieved using getTaxonomySpecificIds(). In case that the taxonomy ID assignment unique identifies a single gene/protein ID, this ID will be set to the id field, marking this synonym as being disambiguated.

        Parameters:
        taxId - The taxonomy ID to assign this synonym.
        Throws:
        java.lang.IllegalArgumentException - If the given taxonomy ID cannot be set to this synonym because it does not exist for the given tax ID.
        See Also:
        getTaxonomySpecificIds(), getId(), isDisambiguated()
      • getTaxonomySpecificIds

        public java.lang.String[] getTaxonomySpecificIds()
      • getPrioritiesOfIds

        public java.util.List<java.lang.Number> getPrioritiesOfIds​(java.lang.String[] idArray)
      • getPrioritiesOfIds

        public java.util.List<java.lang.Number> getPrioritiesOfIds​(java.util.stream.Stream<java.lang.String> idStream)
      • hasTaxId

        public boolean hasTaxId​(java.lang.String taxId)
      • getSynonymPriorities

        public java.util.List<java.lang.Number> getSynonymPriorities()
      • setSynonymPriorities

        public void setSynonymPriorities​(java.util.List<java.lang.Number> synonymPriorities)
      • getSynonymPriority

        public int getSynonymPriority()
      • getGeneIdsOfTaxId

        public java.util.stream.Stream<java.lang.String> getGeneIdsOfTaxId​(java.lang.String taxId)