import java.util.List;
import java.util.Map;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;
import com.stevesoft.pat.Regex;
for (int i = 0; i < seqs.length; i++)
{
SequenceI s = seqs[i];
- Console.debug("******* sequences[" + i + "]='" + s.getName() + "'");
}
}
/* end debug */
}
if (sequence == null)
{
- Console.debug("***** Looking for sequence with id '" + seqId + "'");
-
SequenceI[] sequences = pdbAlignment.findSequenceMatch(seqId);
if (sequences == null || sequences.length < 1)
{
}
}
- List<Object> pae_obj = (List<Object>) Platform.parseJSON(pae_input);
- if (pae_obj == null)
+ Object paeJson = Platform.parseJSON(pae_input);
+ JSONObject paeDict = null;
+ if (paeJson instanceof JSONObject)
+ {
+ Console.debug("***** paeJson is a JSONObject");
+ paeDict = (JSONObject) paeJson;
+ }
+ else if (paeJson instanceof JSONArray)
+ {
+ JSONArray jsonArray = (JSONArray) paeJson;
+ if (jsonArray.size() > 0)
+ paeDict = (JSONObject) jsonArray.get(0);
+ }
+
+ if (paeDict == null)
{
Console.debug("JSON file did not parse properly.");
return false;
}
ContactMatrixI matrix = new PAEContactMatrix(sequence,
- (Map<String, Object>) pae_obj.get(0));
+ (Map<String, Object>) paeDict);
AlignmentAnnotation cmannot = sequence.addContactList(matrix);
pdbAlignment.addAnnotation(cmannot);
+
return true;
}