Class GeneMention

  • All Implemented Interfaces:
    de.julielab.java.utilities.spanutils.Span

    public class GeneMention
    extends java.lang.Object
    implements de.julielab.java.utilities.spanutils.Span
    A basic "gene mention" that most of all contains the text of the mention. However, we might also need other information, i.e. offsets.
    Author:
    faessler
    • Field Detail

      • NOID

        public static final java.lang.String NOID
        Constant meaning that no ID is given for a GeneMention.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GeneMention

        public GeneMention()
      • GeneMention

        public GeneMention​(GeneMention gm)
        Makes a copy of the given GeneMention but NOT from its MentionMappingResult.
        Parameters:
        gm - The gene mention to copy.
      • GeneMention

        public GeneMention​(java.lang.String text)
      • GeneMention

        public GeneMention​(java.lang.String text,
                           TermNormalizer normalizer)
      • GeneMention

        public GeneMention​(java.lang.String text,
                           int begin,
                           int end)
    • Method Detail

      • getOriginalMappedObject

        public java.lang.Object getOriginalMappedObject()

        The original UIMA annotation that is mapped. Most likely a subclass of EntityMention.

        Returns:
        The original object to be mapped.
      • setOriginalMappedObject

        public void setOriginalMappedObject​(java.lang.Object originalMappedObject)
      • getGoldTaxonomyId

        public java.lang.String getGoldTaxonomyId()
      • setGoldTaxonomyId

        public void setGoldTaxonomyId​(java.lang.String goldTaxonomyId)
      • setTaxonomyScore

        public void setTaxonomyScore​(java.lang.String tax,
                                     double score)
      • getTaxonomyScore

        public double getTaxonomyScore​(java.lang.String taxonomyId)
      • getTaxonomyScores

        public java.util.Map<java.lang.String,​java.lang.Double> getTaxonomyScores()
      • setTaxonomyScores

        public void setTaxonomyScores​(java.util.Map<java.lang.String,​java.lang.Double> taxonomyScores)
      • setTaxonomyReliability

        public void setTaxonomyReliability​(GeneSpeciesOccurrence taxonomyReliability)
      • getTaggingModifiers

        public java.util.List<java.lang.String> getTaggingModifiers()
      • acceptHighestScoringTaxForBestMappingCandidate

        public void acceptHighestScoringTaxForBestMappingCandidate()
        Sets the currently highest-scoring taxonomy ID to the current bestcandidate of the mentionMappingResult, which also causes the bestcandidate to set the corresponding gene/protein ID as its ID.

        NOTE: If no gene name could be found by the taxonomy score assignment component that matched any of the taxonomy candidates, the taxonomy scores will be null. Consequently, no taxonomy ID will be set to the mention mapping result.

      • getTaxonomyId

        public java.lang.String getTaxonomyId()
      • setTaxonomyId

        public void setTaxonomyId​(java.lang.String taxonomyId)
      • getTaxonomyIds

        public java.util.Set<java.lang.String> getTaxonomyIds()
      • getTaxonomyCandidates

        public com.google.common.collect.Multimap<java.lang.String,​GeneSpeciesOccurrence> getTaxonomyCandidates()
      • setTaxonomyCandidates

        public void setTaxonomyCandidates​(com.google.common.collect.Multimap<java.lang.String,​GeneSpeciesOccurrence> taxonomyCandidates)
      • getDocumentContext

        public java.lang.String getDocumentContext()
      • setDocumentContext

        public void setDocumentContext​(java.lang.String documentContext)
      • getContextQuery

        public org.apache.lucene.search.Query getContextQuery()
      • setContextQuery

        public void setContextQuery​(org.apache.lucene.search.Query contextQuery)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getBegin

        public int getBegin()
        Specified by:
        getBegin in interface de.julielab.java.utilities.spanutils.Span
      • getDocId

        public java.lang.String getDocId()
      • setDocId

        public void setDocId​(java.lang.String docId)
      • getEnd

        public int getEnd()
        Specified by:
        getEnd in interface de.julielab.java.utilities.spanutils.Span
      • getGeneName

        public GeneName getGeneName()
      • getId

        public java.lang.String getId()
        The gene ID of this gene mention. This is mostly used for evaluation and might not be set in a variety of situations. During the mapping process the final mapped ID of this mention is determined by the mention mapping result, see getMentionMappingResult().
        Returns:
        The gene ID of this mention, if set.
      • setId

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

        public void setNormalizer​(TermNormalizer normalizer)
      • getOffsets

        public org.apache.commons.lang3.Range<java.lang.Integer> getOffsets()
        Specified by:
        getOffsets in interface de.julielab.java.utilities.spanutils.Span
      • setOffsets

        public void setOffsets​(org.apache.commons.lang3.Range<java.lang.Integer> offsets)
      • getText

        public java.lang.String getText()
      • setText

        public void setText​(java.lang.String text)
      • toString

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

        public java.lang.String getNormalizedText()
      • getNormalizedTextVariant

        public java.util.List<java.lang.String> getNormalizedTextVariant()
      • getMentionMappingResult

        public MentionMappingResult getMentionMappingResult()
        Returns:
        The object representing the result of the mapping process for this particular gene mention.
      • setMentionMappingResult

        public void setMentionMappingResult​(MentionMappingResult mentionMappingResult)
      • setGeneDocument

        public void setGeneDocument​(GeneDocument geneDocument)
      • getParent

        public GeneMention getParent()
        A parent GeneMention is a GeneMention that has been split into sub-mentions, most commonly due to conjunctions or enumerations within a GeneMention. Thus, when parent is not null, this GeneMention resulted from a split of another GeneMention.
        Returns:
        The GeneMention that has been split to produce this - and possibly other - GeneMention(s).
      • setParent

        public void setParent​(GeneMention parent)
      • addTaggingModifier

        public void addTaggingModifier​(java.lang.String modifier)
      • getPosTags

        public java.util.List<PosTag> getPosTags()
      • setPosTags

        public void setPosTags​(java.util.List<PosTag> posTags)
      • getFeatureVector

        public cc.mallet.types.FeatureVector getFeatureVector()
      • setFeatureVector

        public void setFeatureVector​(cc.mallet.types.FeatureVector featureVector)
      • getSpecificTypeConfidence

        public double getSpecificTypeConfidence()
      • setSpecificTypeConfidence

        public void setSpecificTypeConfidence​(double specificTypeConfidence)
      • getReducedNameForExactMatch

        public java.lang.String getReducedNameForExactMatch()
      • setReducedNameForExactMatch

        public void setReducedNameForExactMatch​(java.lang.String reducedNameForExactMatch)