+ public static boolean importPaeJSONAsContactMatrixToStructure(
+ StructureMapping[] smArray, InputStream paeInput)
+ throws IOException, ParseException
+ {
+ boolean someDone = false;
+ Console.debug("##### smArray.length=" + smArray.length);
+ for (StructureMapping sm : smArray)
+ {
+ Console.debug("##### sm[n]=" + sm.getPdbId());
+ boolean thisDone = importPaeJSONAsContactMatrixToStructure(sm,
+ paeInput);
+ Console.debug("##### thisDone = " + thisDone);
+ someDone |= thisDone;
+ }
+ return someDone;
+ }
+
+ public static boolean importPaeJSONAsContactMatrixToStructure(
+ StructureMapping sm, InputStream paeInput)
+ throws IOException, ParseException
+ {
+
+ List<Object> pae_obj = (List<Object>) Platform.parseJSON(paeInput);
+ if (pae_obj == null)
+ {
+ Console.debug("JSON file did not parse properly.");
+ return false;
+ }
+
+ ContactMatrixI matrix = new PAEContactMatrix(sm.getSequence(),
+ (Map<String, Object>) pae_obj.get(0));
+
+ AlignmentAnnotation cmannot = sm.getSequence().addContactList(matrix);
+ // sm.getSequence().addAlignmentAnnotation(cmannot);
+ sm.transfer(cmannot);
+ // return true;
+
+ StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager(Desktop.instance);
+ List<AlignedCodonFrame> acfList = ssm.getSequenceMappings();
+
+ return true;
+ }
+