how to calculate elment compostion of fasta protein file using biojava?
1
0
Entering edit mode
9.8 years ago
vaibhavt1000 ▴ 10

how to calculate elment compostion of fasta protein file using biojava?

sequence • 1.9k views
ADD COMMENT
1
Entering edit mode

I want atomic composition not amino acid composition

ADD REPLY
0
Entering edit mode
9.7 years ago
Dan D 7.4k

I'm not a Java programmer (I use its close cousin C#), but here's the step-by-step that you just need to translate into code:

1. Create a Map<string, int>variable to store the distinct elements and their associated counts.

2. Examine the structure of the AminoAcidComposition.xml file. Each <aminoacid> node has a schema akin to the following:

<aminoacid name="Alanine" shortname="Ala" symbol="A">
        <elements count="3" name="Carbon"/>
        <elements count="1" name="Nitrogen"/>
        <elements count="1" name="Oxygen"/>
        <isotopes count="5" name="Hydrogen"/>
</aminoacid>

3. Use the symbol attribute to identify the correct <aminoacid> node to use for each character in the FASTA sequence. Then cycle through the <elements> nodes, using the name attribute of the node as the key to your Map<string, int> variable, incrementing the value for that key by the value of the countattribute, which you'll probably need to coerce to an int since Java is strongly-typed.

ADD COMMENT

Login before adding your answer.

Traffic: 2440 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6