[Biojava-dev] Identifying EmissionStates

Schreiber, Mark mark.schreiber at agresearch.co.nz
Wed Jul 9 13:03:26 EDT 2003


Hi -

I was wondering what the recommended proceedure for identifying and
emission state in a StatePath is.

If I create two states:

    int[] adv = {1};
    Distribution biased =
OrderNDistributionFactory.DEFAULT.createDistribution(a);
    Distribution unbiased  = new UniformDistribution((FiniteAlphabet)a);

    SimpleEmissionState es1 = new
SimpleEmissionState("1",Annotation.EMPTY_ANNOTATION,
                                    adv, biased);
    SimpleEmissionState es2 = new
SimpleEmissionState("2",Annotation.EMPTY_ANNOTATION,
                                    adv, unbiased);

And then get the StatePath:

  StatePath sp = dp.viterbi(sla,ScoreType.PROBABILITY);

I seem to have no easy way to do either of the following:

    for(int i = 1; i <= sp.length(); i++){
      if(sp.symbolAt() == es1)
        //do something
    }

Or this:

    for(int i = 1; i <= sp.length(); i++){
      if(sp.symbolAt().equalrs(es1))
        //do something
    }

I can identify them using the name of the state but this is pretty
painful, there must be a better way??

- Mark
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================



More information about the biojava-dev mailing list