[Biojava-l] getting protein id

Mark Schreiber markjschreiber at gmail.com
Fri Sep 29 08:33:17 UTC 2006


Hi -

The GI should be returned by the getIdentifier() method. Is that not the case?

- Mark

On 9/29/06, Gautam S. Thakur <gautam.thakur at gmail.com> wrote:
> 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"
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>



More information about the Biojava-l mailing list