[Biojava-l] opening unknown fasta file

Mark A Fortner m.fortner at sbcglobal.net
Thu Nov 11 23:06:59 EST 2004


Koen,
One thing you might try is to parse the file, grab the
accession from the first line, and use regular
expressions to identify the type of sequence.  

Hope this helps,

Mark Fortner



--- Koen van der Drift <kvddrift at earthlink.net> wrote:

> Hi,
> 
> The BioJava tutorial (in anger) suggests the
> following code to open a 
> fasta file:
> 
> [snip]
> 
>   // get the appropriate Alphabet
>     Alphabet alpha =
> AlphabetManager.alphabetForName(args[1]);
> 
>   // get a SequenceDB of all sequences in the file
>     SequenceDB db = SeqIOTools.readFasta(is, alpha);
> 
> 
> But what should I do when I don't know if the fasta
> file contains a 
> protein or dna sequence?
> 
> 
> thanks,
> 
> - Koen.
> 
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
> 



More information about the Biojava-l mailing list