Hi all, hi Mark thanks for the fast Answer.
I looked at the code and perhaps solved the problem. During initialisation of the ProfileHMM ( bevore method connectModel() is called ) the transWeights are set with SimpleDistributions sd. These sd again are initialized with an empty Alphabet (no symbol). (*) These Distributions keeps an indexer Object which is used during the training process where the exception occurs. because of (*) the number of indexed symbols is 0 (indexer.symbols.length == 0) and the (FiniteAlphabet)indexer.alphaRef.get() has length 0 too. (Indexer is of type LinearAlphabetIndex) When connectModel() is called the Alphabets ( which are the same as indexer.alphaRef ) are filled with some symbols (EmissionState, DotState ...) (**) BUT the indexer.symbols.length will not be changed (***). This causes the following exception: In SimpleDistribution.Trainer.trainImpl is a method called getWeights(). This will return a double list of length indexer.getAlphabet() which is the same of indexer.alphaRef. Because of (**) this will have a length n>0. So that the for loop in this piece of code runs from 0 to n. Here the exception occurs. indexer.symbolForIndex(i) (0<=i<n) cause the error because of (***) indexer.symbols are empty. I think it must be changed the symbols of the indexer Object in the connectModel() method too. But I'm not really sure because I didn't worked with biojava so long. I'm sorry for my bad English but I hope that I could help a little. Many greetings Daniel > -----Ursprüngliche Nachricht----- > Von: "Mark Schreiber" <[EMAIL PROTECTED]> > Gesendet: 28.08.07 16:28:23 > An: "Daniel Rohrbach" <[EMAIL PROTECTED]> > CC: [email protected] > Betreff: Re: [Biojava-l] problems with the profilehmm demo > > Hi - > > This is a bug that has been submitted to bugzilla. Strangely it was > not an issue in the pre-releases of biojava. I was kind of hoping > someone else would fix it but I guess I will have to find time to take > a look. > > - Mark > > On 8/28/07, Daniel Rohrbach <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > i'm trying to run the "How do I make a ProfileHMM" example but it doesn't > > want to work. I copied the code to my program and when I start it I get > > the following exceptions: > > > > Exception in thread "main" java.lang.IndexOutOfBoundsException: Can't find > > symbol for index 0 > > at > > org.biojava.bio.symbol.LinearAlphabetIndex.symbolForIndex(LinearAlphabetIndex.java:106) > > at > > org.biojava.bio.dist.SimpleDistribution$Trainer.trainImpl(SimpleDistribution.java:332) > > at > > org.biojava.bio.dist.SimpleDistribution$Trainer.train(SimpleDistribution.java:306) > > at > > org.biojava.bio.dist.SimpleDistributionTrainerContext.train(SimpleDistributionTrainerContext.java:126) > > at biojavatests.HMMTest.main(HMMTest.java:71) > > > > The error occurs at mt.train(). It seems that there was no, wrong or empty > > alphabet set for the trainer that shall be used. > > > > here the link to the examplepage: > > http://biojava.org/wiki/BioJava:CookBook:DP:HMM > > any help on this topic? > > > > Thanks in advance > > __________________________________________________________________________ > > Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach! > > Mehr Infos unter http://produkte.web.de/club/?mc=021131 > > > > > > _______________________________________________ > > Biojava-l mailing list - [email protected] > > http://lists.open-bio.org/mailman/listinfo/biojava-l > > > _______________________________________________________________________ Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220 _______________________________________________ Biojava-l mailing list - [email protected] http://lists.open-bio.org/mailman/listinfo/biojava-l
