[Biojava-l] (no subject)

Ramana ramana@galainfotek.com
Fri, 17 Aug 2001 11:25:11 +0530


This is a multi-part message in MIME format.

------=_NextPart_000_001A_01C1270F.471A8E80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,
This is ramana from GalaInfotek
Now i am able to run the programmes.....
But i have another doubt .
 In Following code:
in this code we must pass the Protein fasta file ,if i send DNA fasta =
file
it  raise bioexception  b'cause we are calling
SeqIOTools.readFastaProtein().
My problem is  i want send a file wheather it is DNA fasta
or Protein fasta ,i want find the file type (DNA or Protein or GenBank) =
and
find the alphabet.
I found a method read(BufferedReader br) in AlignmentFormat if =
implementut
this interface  raises a error ,could u plz tell me which classes i want =
to
import and solution....
bye
RAMANA
GalaInfotek
------------------------
import java.io.*;
import org.biojava.bio.symbol.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.seq.io.*;
public class TestingSymbol
{
 public static void main(String[] args)
 {
  try
  {
    if (args.length !=3D 1)
    throw new Exception("usage: java GCContent filename.fa");
       String fileName =3D args[0];
       System.out.println("FileName"+fileName);
                BufferedReader br=3Dnew BufferedReader(new
FileReader(fileName));
                SequenceIterator str=3DSeqIOTools.readFastaProtein(br);
    System.out.println("after sequence iterator");
    while(str.hasNext())
    {System.out.println("inside while");
      Sequence seq=3Dstr.nextSequence();
      int at=3D0;
      for(int i=3D1;i<seq.length();i++)
     {
          System.out.println(seq.getAlphabet());

     }

    }
        }catch(Exception ee){System.out.println("Error"+ee);}
 }
}

--------------------------


------=_NextPart_000_001A_01C1270F.471A8E80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This is ramana from GalaInfotek<BR>Now =
i am able to=20
run the programmes.....<BR>But i have another doubt .<BR>&nbsp;In =
Following=20
code:<BR>in this code we must pass the Protein fasta file ,if i send DNA =
fasta=20
file<BR>it&nbsp; raise bioexception&nbsp; b'cause we are=20
calling<BR>SeqIOTools.readFastaProtein().<BR>My problem is&nbsp; i want =
send a=20
file wheather it is DNA fasta<BR>or Protein fasta ,i want find the file =
type=20
(DNA or Protein or GenBank) and<BR>find the alphabet.<BR>I found a =
method=20
read(BufferedReader br) in AlignmentFormat if implementut<BR>this=20
interface&nbsp; raises a error ,could u plz tell me which classes i want =

to<BR>import and=20
solution....<BR>bye<BR>RAMANA<BR>GalaInfotek<BR>------------------------<=
BR>import=20
java.io.*;<BR>import org.biojava.bio.symbol.*;<BR>import=20
org.biojava.bio.seq.*;<BR>import org.biojava.bio.seq.io.*;<BR>public =
class=20
TestingSymbol<BR>{<BR>&nbsp;public static void main(String[]=20
args)<BR>&nbsp;{<BR>&nbsp; try<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; if =
(args.length=20
!=3D 1)<BR>&nbsp;&nbsp;&nbsp; throw new Exception("usage: java GCContent =

filename.fa");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String fileName =
=3D=20
args[0];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
System.out.println("FileName"+fileName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
BufferedReader br=3Dnew=20
BufferedReader(new<BR>FileReader(fileName));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
SequenceIterator =
str=3DSeqIOTools.readFastaProtein(br);<BR>&nbsp;&nbsp;&nbsp;=20
System.out.println("after sequence iterator");<BR>&nbsp;&nbsp;&nbsp;=20
while(str.hasNext())<BR>&nbsp;&nbsp;&nbsp; {System.out.println("inside=20
while");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sequence=20
seq=3Dstr.nextSequence();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int=20
at=3D0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int=20
i=3D1;i&lt;seq.length();i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
System.out.println(seq.getAlphabet());<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR><BR>&nbsp;&nbsp;&nbsp; =
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}catch(Exception=20
ee){System.out.println("Error"+ee);}<BR>&nbsp;}<BR>}<BR><BR>-------------=
-------------<BR></DIV></FONT></BODY></HTML>

------=_NextPart_000_001A_01C1270F.471A8E80--