[Biojava-l] Getting a base from an alignment (way to complex?)

Anthony Underwood email2ants at gmail.com
Fri Nov 9 23:23:01 UTC 2007


Hi Alan,

Thanks for the suggestion. That was my first thought, but then I was  
thinking for amino acids this wouldn't work. I would have to use a  
hashmap to convert the amino acid to the appropriate single letter code.

Hi George, I'll try your suggestion. As you say I think this is too  
much for something that should be a one liner. Thanks for your advice.
Get the tokenization from the alphabet using:
SymbolTokenization = Alphabet.getTokenization("token");

Get the token from the tokenization using:
String = SymbolTokenization.tokenizeSymbol(Symbol);

Thanks to both of you

Anthony

On 9 Nov 2007, at 18:48, Zagato wrote:

> Try with:
> String s = alignment.symbolListForLabel( label ).subStr( i, i+1 );
>
> Bye...
>
> Alan Jairo Acosta
> Cali - Colombia
>
> On Nov 9, 2007 12:55 PM, Anthony Underwood < email2ants at gmail.com>  
> wrote:
> 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.open-bio.org/mailman/listinfo/biojava-l
>
>
>
> -- 
> Farewell.
> http://www.youtube.com/zagatogekko
> ruby << __EOF__
>  puts [ 111, 116, 97, 103, 97, 90 ].collect{|v| v.chr}.join.reverse
> __EOF__




More information about the Biojava-l mailing list