[Biojava-l] How to read a protein clustal alignment?

Damian D'Onia dd3a@dc.uba.ar
Mon, 01 Oct 2001 12:54:02 -0300


Thomas,

         I'm using BioJava 1.10, without any update, but your second 
suggestion works fine and it's more cleaner.

Thanks.

Damián. //

At 16:23 01/10/01 +0100, you wrote:
>On Mon, Oct 01, 2001 at 12:15:37PM -0300, Damian D'Onia wrote:
> > Hi,
> >
> >          I'm trying to read a clustal file (.ALN) that contains protein
> > sequences. Now I have a subclass of DefaultHandler which can read DNA
> > sequences from .aln files, but I don't know how to fill a SymbolList from
> > String.
> >
> > But, ProteinTools don't have a method like createDNA.
>
>What version of BioJava are you using?  Certainly, the current
>CVS version has a method ProteinTools.createProtein(String), which
>seems to do what you want.
>
>However, it would seem cleaner to remove references to particular
>alphabets from your code completely.  You can do something like:
>
>   Alphabet alpha = DNATools.getDNA();
>   SymbolParser parser = alpha.getParser("token");
>   SymbolList sl = parser.parse(someString);
>
>This is effectively what's happening inside DNATools.createDNA,
>and means you can just parameterize your code with a particular
>Alphabet object.
>
>Hope this helps,
>
>    Thomas.

-----
Damian D'Onia (dd3a@dc.uba.ar)
Facultad de Ciencias Exactas y Naturales, UBA