@@ -57,7 +57,15 @@ public void handle(Element node) throws Exception {
57
57
private void ParseProteinGroupNode (Element protgroupnode ) throws XmlPullParserException , IOException , ClassNotFoundException , InterruptedException {
58
58
59
59
int groupindex = Integer .parseInt (protgroupnode .getAttributes ().getNamedItem ("group_number" ).getNodeValue ());
60
- float groupprob = Float .parseFloat (protgroupnode .getAttributes ().getNamedItem ("probability" ).getNodeValue ());
60
+
61
+ float groupprob =0f ;
62
+ if (protgroupnode .getAttributes ().getNamedItem ("probability" ) != null ) {
63
+ groupprob = Float .parseFloat (protgroupnode .getAttributes ().getNamedItem ("probability" ).getNodeValue ());
64
+ }
65
+ else if (protgroupnode .getAttributes ().getNamedItem ("probability" ) != null ) {
66
+ groupprob = Float .parseFloat (protgroupnode .getAttributes ().getNamedItem ("group_probability" ).getNodeValue ());
67
+ }
68
+
61
69
int alphabet = 1 ;
62
70
63
71
for (int j = 0 ; j < protgroupnode .getChildNodes ().getLength (); j ++) {
@@ -154,9 +162,16 @@ private void ParseProteinGroupNode(Element protgroupnode) throws XmlPullParserEx
154
162
} else {
155
163
PepIonID pepIonID = new PepIonID ();
156
164
pepIonID .Sequence = child .getAttributes ().getNamedItem ("peptide_sequence" ).getNodeValue ();
157
- pepIonID .MaxProbability = Float .parseFloat (child .getAttributes ().getNamedItem ("initial_probability" ).getNodeValue ());
158
- pepIonID .Is_NonDegenerate = "Y" .equals (child .getAttributes ().getNamedItem ("is_nondegenerate_evidence" ).getNodeValue ());
159
- pepIonID .Weight = Float .parseFloat (child .getAttributes ().getNamedItem ("weight" ).getNodeValue ());
165
+
166
+ if (child .getAttributes ().getNamedItem ("initial_probability" ) != null ) {
167
+ pepIonID .MaxProbability = Float .parseFloat (child .getAttributes ().getNamedItem ("initial_probability" ).getNodeValue ());
168
+ }
169
+ if (child .getAttributes ().getNamedItem ("is_nondegenerate_evidence" ) != null ) {
170
+ pepIonID .Is_NonDegenerate = "Y" .equals (child .getAttributes ().getNamedItem ("is_nondegenerate_evidence" ).getNodeValue ());
171
+ }
172
+ if (child .getAttributes ().getNamedItem ("weight" ) != null ) {
173
+ pepIonID .Weight = Float .parseFloat (child .getAttributes ().getNamedItem ("weight" ).getNodeValue ());
174
+ }
160
175
if (child .getAttributes ().getNamedItem ("group_weight" ) != null ) {
161
176
pepIonID .GroupWeight = Float .parseFloat (child .getAttributes ().getNamedItem ("group_weight" ).getNodeValue ());
162
177
}
0 commit comments