Class SynHit
- java.lang.Object
-
- de.julielab.jules.ae.genemapping.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSynHit.CompareType
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SynHitclone()intcompareTo(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 chosenSynHit.CompareTypegetCompareType()java.util.stream.Stream<java.lang.String>getGeneIdsOfTaxId(java.lang.String taxId)java.lang.StringgetId()java.util.List<java.lang.String>getIds()GeneNamegetMappedGeneName()java.lang.StringgetMappedMention()The potentially normalized and/or transformed original entity text mention for which this candidate has been retrieved.doublegetMentionScore()doublegetOverallScore()java.util.List<java.lang.Number>getPrioritiesOfIds(java.lang.String[] idArray)java.util.List<java.lang.Number>getPrioritiesOfIds(java.util.stream.Stream<java.lang.String> idStream)doublegetSemanticScore()java.lang.StringgetSource()java.lang.DoublegetSpeciesMentionScore(java.lang.String taxId)java.util.Map<java.lang.String,java.lang.Double>getSpeciesMentionScores()java.lang.StringgetSynonym()java.util.List<java.lang.Number>getSynonymPriorities()intgetSynonymPriority()java.lang.StringgetTaxId()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.java.util.List<java.lang.String>getTaxIds()java.lang.String[]getTaxonomySpecificIds()booleanhasTaxId(java.lang.String taxId)booleanisAmbiguousInGeneral()Returns true if there is more than one gene ID associated with this synonym.booleanisDisambiguated()Returns true if a single gene or protein ID of this synonym has been determined.booleanisExactMatch()booleanisInterSpeciesAmbiguousInGeneral()Returns true if there are at least two distinct taxonomy IDs associated with this synonym.booleanisIntraSpeciesAmbiguousInGeneral()Returns true if at least one taxonomy ID associated with this synonym appears multiple times.voidrestrictToTaxId(java.lang.String taxId)voidsetCompareType(SynHit.CompareType type)voidsetId(java.lang.String id)voidsetIds(java.util.List<java.lang.String> ids)voidsetMappedGeneName(GeneName mappedGeneName)voidsetMappedMention(java.lang.String mappedSynonym)voidsetMentionScore(double score)voidsetOverallScore(double overallScore)voidsetSemanticScore(double score)voidsetSource(java.lang.String source)voidsetSpeciesMentionScore(java.lang.String taxId, double speciesMentionScore)voidsetSynonym(java.lang.String syn)voidsetSynonymPriorities(java.util.List<java.lang.Number> synonymPriorities)voidsetTaxId(java.lang.String taxId)Accepts the passed taxonomy ID as assigned to this synonym.voidsetTaxIds(java.util.List<java.lang.String> taxIds)java.lang.StringtoString()
-
-
-
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:
toStringin classjava.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:
compareToin interfacejava.lang.Comparable<SynHit>- Parameters:
o-- Returns:
- int
-
getSource
public java.lang.String getSource()
-
setSource
public void setSource(java.lang.String source)
-
getCompareType
public SynHit.CompareType getCompareType()
-
setCompareType
public void setCompareType(SynHit.CompareType type)
-
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:
clonein classjava.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
taxonomySpecificIdsfield to be set which can be retrieved usinggetTaxonomySpecificIds(). In case that the taxonomy ID assignment unique identifies a single gene/protein ID, this ID will be set to theidfield, 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)
-
-