[Biojava-l] query in suffixtree
Richard Holland
dicknetherlands at gmail.com
Thu Jun 19 14:48:22 UTC 2008
Sorry for the delay in getting back to you.
2008/6/11 Hemant Katta <katta.hemant at gmail.com>:
> Sir,
>
> //Genrating a suffixtree.
>
> FiniteAlphabet alpha = DNATools.getDNA();
> SymbolList sml = DNATools.createDNA("atggtggtcct");
>
> SuffixTree suf = new SuffixTree(alpha);
> suf.addSymbols(sml,sml.length);
>
>
> now I have listed queries.
> 1. what is role of window size in addSymbols(SymbolList sml, int Window)
> function.
The window size equals the maximum motif length that will be counted
by the method. If you specify window=5, for instance, then motifs up
to but no longer than 5 bases in length will be counted.
> 2. why getFrequency(int i) always return the same value, whatever int i
> value have been passed but the result is always same.
> It should return the No. of motifs of int i length.
There is no getFrequency() - I assume you mean frequency()? The
function returns the number of motifs of the length specified as the
parameter. If you pass in 5, you will get back the number of motifs
that are 5 bases long. If you print out the suffix tree by walking
through it from the object returned by getRoot() you'll be able to see
what the tree looks like and therefore how the frequency value is
calculated.
> 3. How can i print Suffix whatever are made in my SuffixTree.
By calling getRoot() and iterating through the child nodes it gives you.
> 4. How can i search a suffix of given length.
Again, by calling getRoot() and walking through the results.
The JavaDocs for SuffixTree are quite helpful for working out what the
methods are supposed to be doing:
http://www.biojava.org/docs/api16/org/biojava/bio/symbol/SuffixTree.html
cheers,
Richard
More information about the Biojava-l
mailing list