[Biojava-l] getting protein id

Gautam S. Thakur gautam.thakur at gmail.com
Fri Sep 29 07:37:51 UTC 2006


Hi,

As you know that every protein sequence has some unique header defined like
the below one

>gi|16127996|ref|NP_414543.1|bifunctional aspartokinase I/homeserine
dehydrogenase I [Escherichia coli K12]


I'm using biojava 1.5 API to read and extract the protein information.
However, I am not able to  get the Sequence ID (16127996) of the protein
that is after the "gi" string in above. Can anybody tell me how to get that?
Following code is correct and working but not giving the id as output, even
after checking all the related member function.

--------------------------------------------------------------------
try{
           BufferedReader br = new BufferedReader(
                   new FileReader("datafile"));
           //Getting the protein alphabet
           //Alphabet protein = AlphabetManager.alphabetForName("PROTEIN");
           org.biojavax.bio.seq.RichSequenceIterator richStream =
org.biojavax.bio.seq.RichSequence.IOTools.readFastaProtein(br, null);
//SeqIOTools.readFastaProtein(br);
           while(richStream.hasNext()){
               org.biojavax.bio.seq.RichSequence richSeq =
richStream.nextRichSequence();
               System.out.println(richSeq.getAccession());
               System.out.println(richSeq.getAlphabet());
               System.out.println(richSeq.getAnnotation());
               System.out.println(richSeq.getName());
               System.out.println(richSeq.getDescription());
               System.out.println(richSeq.getIdentifier());
               System.out.println(richSeq.seqString());
}                  }catch(Exception e) {
           //do nothing
       }
--------------------------------------------------------------------

Can any one help me out as to how to get the protein id?

Thanks and Regards,

-Gautam

-- 
"Destiny is no matter of chance.
It is a matter of choice.
It is not a thing to be waited for,
it is a thing to be achieved"



More information about the Biojava-l mailing list