Provides objective functions for scoring motifs. The objective functions are organized in a two-level hierarchy: Scorer is the parent of all Scorers, and GroupScorer is a subclass of Scorer and the parent of all Scorers that maintain a notion of group and background. Scorer contains a defined group of core methods: All of these methods contain analogous methods for MotifLists. In principle, all a new Scorer needs to do is define calculateScore(Motif) and calculateScore(MotifList) . Of course, some scorers are sufficiently complicated to warrant some extra methods.

Scorers can be created dynamically using reflection by using the {@link edu.dartmouth.bglab.score.ScorerFactory} class. In order for a new scorer to work with this factory, it must implement the constructor:

    <ClassName>(MotifFinder, boolean, int)
This can usually be done by a simple call to super(MotifFinder, boolean, int) .

GroupScorers maintain a notion of group and genome, or background. At the top level, the only difference is in the constructor, which takes two Motif Finders, one for the group and one for the genome. Several of the utility methods are overridden by GroupScorer to use the group-based Motif Finder. For example, the phi score methods use the group Motif Finder to compute the phi score, and getMotifFinder() and setMotifFinder() work with the group Motif Finder. To compensate for this, methods exist to get and set the genomic Motif Finder.

A number of scorers have been written, but the two most commonly used are {@link edu.dartmouth.bglab.score.OccurrenceScorer}, which scores motifs on the likelihood of seeing a given number of occurrences in the group given the number of occurrences in the genome (the Sig value referred to in the papers), and {@link edu.dartmouth.bglab.score.OccurrenceKSScorer}, which combies OccurrenceScorer with {@link edu.dartmouth.bglab.score.KSGroupScorer} to provide a joint probability that a motif will be so over-represented and positionally restricted. This combination scorer utilizes {@link edu.dartmouth.bglab.score.CombinedScorer}, which provides a general framework for linearly combining scorers. Other combined scorers exist, and more can be easily created using CombinedScorer. Use OccurrenceKSScorer as a reference when writing new combined scorers.

Finally, {@link edu.dartmouth.bglab.score.MaximalMatcher} provides Phi scoring functionality. This is a rather archane class.

Next