[Biojava-l] Parsing SwissProt flat file through BioJava
Roy Park
RPark@lexgen.com
Tue, 25 Jun 2002 09:38:21 -0500
The following code should give you some ideas:
SequenceIterator seqIter = SeqIOTools.readSwissprot(br);
while (seqIter.hasNext()) {
Sequence thisSeq = seqIter.nextSequence();
Annotation thisAnnot = thisSeq.getAnnotation();
// Get species info..
String species = thisAnnot.getProperty("OS");
.
.
}
etc.
The Annotation.getProperty() call may end up returning an ArrayList of
Strings instead (of a String object), if there are multiple XX entries. i.e.
it could very well be:
String species = thisAnnot.getProperty("XXXXXX");
for SOME of the properties. Personally, I handle this by writing a utility
static method that can take either an ArrayList (of String) object or a
String object, and returns a String object.
Roy Park
Bioinformatics Data Analyst
Lexicon Genetics Incorporated
The Woodlands, TX
-----Original Message-----
From: Rahul Deshpande [mailto:rahul@molecularconnections.com]
Sent: Tuesday, June 25, 2002 1:21 AM
To: biojava-l@biojava.org
Cc: Santosh Kumar
Subject: [Biojava-l] Parsing SwissProt flat file through BioJava
Hello,
I am Rahul Deshpande. I work for a bio informatics company. Recently I came
across biojava.
I have a question about biojava.
How can we read the SwissProt flat files using biojava? The closest we could
come was org.biojava.bio.seq.io.EmblLikeFormat class which has methods to
return the two letter code and the remaining data in the line. Can we
retrieve the data for each protein in the SwissProt flat file instead of
reading each line by each line? Are there any methods like that?
Regards,
Rahul Deshpande
Molecularconnections Pvt. Ltd.
A203, Blue Cross Chambers,
Infantry Road Cross,
Bangalore 560001
Ph: +(91)-80-5598502, 5327919
_______________________________________________
Biojava-l mailing list - Biojava-l@biojava.org
http://biojava.org/mailman/listinfo/biojava-l
***************************************************************************
The contents of this communication are intended only for the addressee and
may contain confidential and/or privileged material. If you are not the
intended recipient, please do not read, copy, use or disclose this
communication and notify the sender. Opinions, conclusions and other
information in this communication that do not relate to the official
business of my company shall be understood as neither given nor endorsed by
it.
***************************************************************************