001package org.biojava.bio.program.hmmer;
002
003import org.biojava.bio.Annotation;
004import org.biojava.bio.dist.Distribution;
005import org.biojava.bio.dp.SimpleEmissionState;
006import org.biojava.bio.symbol.IllegalSymbolException;
007import org.biojava.bio.symbol.Symbol;
008
009/**
010 * A state in a HMMer model.
011 */
012
013public class ProfileEmissionState extends SimpleEmissionState{
014        
015        public ProfileEmissionState(String str, Annotation ann, int[] adv, Distribution dis){
016          super(str, ann,adv, dis);
017        }
018        
019        public double logProb(Symbol sym) throws IllegalSymbolException{
020         return log2(getDistribution().getWeight(sym)); 
021        }
022        
023        protected static double log2(double x){
024                return Math.log(x)/Math.log(2);
025        }
026    
027}