[Biojava-l] Getting a base from an alignment (way to complex?)
George Waldon
gwaldon at geneinfinity.org
Fri Nov 9 18:45:10 UTC 2007
Tokens are associated with alphabets.
Get the tokenization from the alphabet using:
SymbolTokenization = Alphabet.getTokenization("token");
Get the token from the tokenization using:
String = SymbolTokenization.tokenizeSymbol(Symbol);
Also, check the tutotial and the cookbook on the biojava web site at www.biojava.org, which are often more informative than the javadoc.
Frankly speaking, I agree with you and we should have a method like
String = Symbol.getToken(Alphabet,"token");
to do these operations simply and without loosing our hairs!
Best luck,
George
> -----Original Message-----
> From: biojava-l-bounces at lists.open-bio.org [mailto:biojava-l-
> bounces at lists.open-bio.org] On Behalf Of Anthony Underwood
> Sent: Friday, November 09, 2007 9:56 AM
> To: BioJava
> Subject: [Biojava-l] Getting a base from an alignment (way to complex?)
>
> Hi All,
>
> I've generated an alignment and I am retrieving positions within the
> alignment using
>
> Symbol base = alignment.symbolAt(label, i);
>
> I am trying to get whether the base at this position is G, A, T or C
>
> However when I use base.getName() it returns strings such as "thymine"
>
> The documentation states that the method getToken should also be
> available, but this returns method undefined.
> http://www.biojava.org/docs/api15/org/biojava/bio/symbol/Symbol.html
>
> Is there a simple way of retrieving a one letter textual
> representation of the symbol?
>
>
> Many thanks
>
>
> Anthony
> _______________________________________________
> Biojava-l mailing list - Biojava-l at lists.open-bio.org
> http://lists
More information about the Biojava-l
mailing list