+
+ public static void validateContactMatrixFile(String fileName) throws FileFormatException,IOException
+ {
+ FileInputStream infile=null;
+ try {
+ infile = new FileInputStream(new File(fileName));
+ } catch (Throwable t)
+ {
+ new IOException("Couldn't open "+fileName,t);
+ }
+
+
+ JSONObject paeDict=null;
+ try {
+ paeDict = EBIAlfaFold.parseJSONtoPAEContactMatrix(infile);
+ } catch (Throwable t)
+ {
+ new FileFormatException("Couldn't parse "+fileName+" as a JSON dict or array containing a dict");
+ }
+
+ PAEContactMatrix matrix = new PAEContactMatrix(new SequenceDummy("Predicted"), (Map<String,Object>)paeDict);
+ if (matrix.getWidth()<=0)
+ {
+ throw new FileFormatException("No data in PAE matrix read from '"+fileName+"'");
+ }
+ }
+
+ @Override
+ protected PAEContactMatrix newMappableContactMatrix(
+ SequenceI newRefSeq, MapList newFromMapList)
+ {
+ PAEContactMatrix pae=new PAEContactMatrix(newRefSeq, newFromMapList,
+ elements, new GroupSet(grps));
+ return pae;
+ }