Class DypsisCandidateRanker
- java.lang.Object
-
- de.julielab.genemapper.mappingcores.DypsisCandidateRanker
-
public class DypsisCandidateRanker extends Object
Uses machine learning methods to create features for the mapping candidates of a gene mention.
Only prediction is handled directly in this class. Training is done by
HpoRoute.train(InstanceList, Parameters, String, int).This class requires the tax2originalCandidates map and populates the tax2lexicallyRerankedCandidates field of a gene's
MentionMappingResult.
-
-
Field Summary
Fields Modifier and Type Field Description static doubleavgDiffCorrectstatic doubleavgDiffWrongstatic doubleavgRatioCorrectstatic doubleavgRatioWrongstatic intcorrectstatic doublewrong
-
Constructor Summary
Constructors Constructor Description DypsisCandidateRanker(de.julielab.geneexpbase.configuration.Configuration configuration, CandidateRetrieval candidateRetrieval, de.julielab.geneexpbase.services.CacheService cacheService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Sets the internal state to null.de.julielab.geneexpbase.configuration.ParametersgetModelParameters()List<de.julielab.geneexpbase.candidateretrieval.SynHit>getOriginalExactMatches(de.julielab.geneexpbase.genemodel.GeneMention gm, de.julielab.geneexpbase.configuration.Parameters parameters, List<de.julielab.geneexpbase.candidateretrieval.SynHit> candidates4tax)voidloadModel(File modelSource)voidloadModel(InputStream modelIs)@NotNull de.julielab.geneexpbase.configuration.ParametersmergeParameters(de.julielab.geneexpbase.configuration.Parameters parameterMap)Merges the stored model parameters with the externally passed parameters.voidrankCandidates(de.julielab.geneexpbase.genemodel.GeneMention gm, AtomicInteger gmidCounter, de.julielab.geneexpbase.configuration.Parameters parameterMap)voidsaveModel(File modelDestination, de.julielab.geneexpbase.configuration.Parameters parameters)static voidsetGoldRelevanceScores(de.julielab.geneexpbase.genemodel.GeneMention gm, de.julielab.geneexpbase.genemodel.MentionMappingResult mmr)
-
-
-
Constructor Detail
-
DypsisCandidateRanker
@Inject public DypsisCandidateRanker(de.julielab.geneexpbase.configuration.Configuration configuration, CandidateRetrieval candidateRetrieval, de.julielab.geneexpbase.services.CacheService cacheService)
-
-
Method Detail
-
setGoldRelevanceScores
public static void setGoldRelevanceScores(de.julielab.geneexpbase.genemodel.GeneMention gm, de.julielab.geneexpbase.genemodel.MentionMappingResult mmr)
-
saveModel
public void saveModel(File modelDestination, de.julielab.geneexpbase.configuration.Parameters parameters)
-
loadModel
public void loadModel(File modelSource) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
mergeParameters
@NotNull public @NotNull de.julielab.geneexpbase.configuration.Parameters mergeParameters(de.julielab.geneexpbase.configuration.Parameters parameterMap)
Merges the stored model parameters with the externally passed parameters. This is especially important to set settings required by theDypsisContextRankerbut have been set differently in the training of this ranker because they just weren't needed.- Parameters:
parameterMap-- Returns:
-
rankCandidates
public void rankCandidates(de.julielab.geneexpbase.genemodel.GeneMention gm, AtomicInteger gmidCounter, de.julielab.geneexpbase.configuration.Parameters parameterMap)
-
getOriginalExactMatches
public List<de.julielab.geneexpbase.candidateretrieval.SynHit> getOriginalExactMatches(de.julielab.geneexpbase.genemodel.GeneMention gm, de.julielab.geneexpbase.configuration.Parameters parameters, List<de.julielab.geneexpbase.candidateretrieval.SynHit> candidates4tax)
-
clear
public void clear()
Sets the internal state to null. No trained classifiers or parameters will be available any more.
-
loadModel
public void loadModel(InputStream modelIs) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
getModelParameters
public de.julielab.geneexpbase.configuration.Parameters getModelParameters()
-
-