+
+ /**
+ * Resolve structural model to a reference sequence and register it to
+ * StructureSelectionManager
+ *
+ * @param al
+ * @param querySequence
+ * @param templateSeq
+ * @param structModelHeader
+ * @param structModelData
+ * @return true if model and sequence was added
+ */
+ static boolean processStructModel(AlignmentI al, SequenceI querySequence,
+ SequenceI templateSeq,
+ String[] structModelHeader,
+ String[] structModelData, String baseUri)
+ {
+ String warningMessage = null;
+ boolean added = false;
+ try {
+ String structureModelFile = resolveAbsolutePath(structModelData[2],
+ baseUri);
+ String fastaMappingFile = resolveAbsolutePath(structModelData[3],
+ baseUri);
+ // System.out.println("Model File >> " + structureModelFile);
+ // System.out.println("Fasta File >> " + fastaMappingFile);
+ String modelName = StructureFile.safeName(structureModelFile);
+ PDBEntry phyre2PDBEntry = new PDBEntry(modelName, " ",
+ Type.PDB,
+ structureModelFile);
+ List<DynamicData> phyreDD = generatePhyreDynamicDataList(
+ structModelHeader, structModelData);
+ phyre2PDBEntry.setProperty("DYNAMIC_DATA_PHYRE2", phyreDD);
+ templateSeq.getDatasetSequence().addPDBId(phyre2PDBEntry);
+ if (querySequence != null)
+ {
+ querySequence.getDatasetSequence().addPDBId(phyre2PDBEntry);
+ }
+ StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager();
+ ssm.registerPhyre2Template(structureModelFile, fastaMappingFile);
+ added = true;
+
+ } catch (Exception x)
+ {
+ warningMessage = x.toString();
+ } finally {
+ if (warningMessage !=null)
+ {
+ System.err.println("Warnings whilst processing STRUCTMODEL: "+warningMessage);
+ }
+ }
+ return added;
+ }
+
+ static List<DynamicData> generatePhyreDynamicDataList(
+ String[] headerArray,
+ String[] dataArray)