Hello Manuel, thank you very much for the code snippet. I had to put the metafunctions into namespace seqan, then it worked. Number of states is fix at compile time, so seqan fits to my code. Viele Grüße, Konstantin (not Klaus, not Mark ;) -------- Original-Nachricht -------- > Datum: Mon, 6 Sep 2010 00:59:44 +0200 > Von: Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de> > An: SeqAn Development <seqan-dev@lists.fu-berlin.de> > Betreff: Re: [Seqan-dev] HMM Demo with modified alphabet > Hi Konstantin (? or Klaus or Mark?) > > You might want to reconsider whether you want to use the > implementation SeqAn. Currently, the HMM specialization of the class > Graph assumes that the number of states is fixed at compile time and > changes to this would require major changes in the code and any code > that uses it. > > If you want to use this, however, you can simply define the alphabet > as a new Simple Type (analogue to TraceBack in module graph_align, for > example): > > struct _MyType; > typedef SimpleType<unsigned char, _MyType> MyType; // use unsigned > short for > 255 values > > For this type, you then at least have to specialize the ValueSize<> > and BitsPerValue Metafunctions: > > template <> struct ValueSize<MyType> { enum { VALUE = 128 }; }; > template <> struct BitsPerValue<MyType> { enum { VALUE = 7 }; }; // > must be ceil(log(value size)) > > Then, try to parametrize the HMM graph class with this alphabet and > add any missing functions, metafunctions and operators for your new > alphabet. However, deriving your new type from SimpleType, should > automagically use the code for SimpleType that the DNA and Amino Acid > alphabets use, too. > > Cheers, > Manuel > > Am 05.09.2010 um 22:43 schrieb Klaus Klapperon: > > > Hello again, > > > > I want to create a hidden markov model with an alphabet of (at > > least) 128 values (it has nothing to do with bioinformatics). I > > started with the hmm demo (graph_hmm.cpp). But how can I define this > > new alphabet type? > > Viele Grüße, > > > > > > Konstantin > > > > -- > > GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/ > > mtl.!* > > http://portal.gmx.net/de/go/dsl > > > > _______________________________________________ > > seqan-dev mailing list > > seqan-dev@lists.fu-berlin.de > > https://lists.fu-berlin.de/listinfo/seqan-dev > > > _______________________________________________ > seqan-dev mailing list > seqan-dev@lists.fu-berlin.de > https://lists.fu-berlin.de/listinfo/seqan-dev -- GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl