[Biojava-l] Null Model

Thomas Down thomas at derkholm.net
Tue May 6 11:01:35 EDT 2003


Once upon a time, on a computer far far away, Ren, Zhen wrote:
> 
> The second part of the question is how to do this shown above using 
> BioJava API.  Notice although there is a null model behind this, 
> it is actually never used.  How would I use the null model here?

Well, it's easy to write some code which uses log odds.

     Distribution dist = ...
     Symbol sym = ...
     double logodds = Math.log(dist.getWeight(sym)) -
                      Math.log(dist.getNullModel().getWeight(sym));

I guess it wouldn't be a bad thing to have a utility
method on DistributionTools to do this.  I'll add it,
if nobody objects.

WeightMatrixAnnotator doesn't seem to support log odds.
I guess it's because it came from a DNA world, where using
odds scores often (although no always) makes very little
difference.  It should probably be more flexible.  A neat
way to do this, mirroring the way the dynamic programming
algorithms handle this issue, would be to use the ScoreType 
objects

Sound reasonable?

     Thomas.


More information about the Biojava-l mailing list