JAL-2136 JAL-2137 Improved STRUCTMODEL annotation syntax to reinstated fasta file...
[jalview.git] / src / jalview / ws / phyre2 / Phyre2Client.java
index e980a19..a54c924 100644 (file)
@@ -34,11 +34,20 @@ public class Phyre2Client extends StructureMappingClient
 
   private final static String PATH_SEPARATOR = File.separator;
 
+  private String fastaMappingFile;
+
   public Phyre2Client(StructureFile structureFile)
   {
     this.structureFile = structureFile;
   }
 
+  public StructureMapping getStructureMapping(SequenceI seq,
+          String pdbFile, String fMappingFile, String chain)
+  {
+    this.fastaMappingFile = fMappingFile;
+    return getStructureMapping(seq, pdbFile, chain);
+  }
+
   @Override
   public StructureMapping getStructureMapping(SequenceI seq,
           String pdbFile, String chain)
@@ -157,11 +166,7 @@ public class Phyre2Client extends StructureMappingClient
 
   private String getFastaMappingFile()
   {
-    File phyre2ModelFile = new File(structureFile.getDataName());
-    String phyre2ModelResultDir = phyre2ModelFile.getParent();
-    String modelId = structureFile.getId().substring(0,
-            structureFile.getId().lastIndexOf(".pdb"));
-    return phyre2ModelResultDir + PATH_SEPARATOR + modelId + ".fasta";
+    return fastaMappingFile;
   }
 
   @Override
@@ -279,10 +284,6 @@ public class Phyre2Client extends StructureMappingClient
       output.append(NEWLINE).append(NEWLINE);
     }
     float pid = (float) matchedSeqCount / seqRes.length() * 100;
-    // if (pid < SiftsSettings.getFailSafePIDThreshold())
-    // {
-    // throw new Exception(">>> Low PID detected for Phyre2 mapping...");
-    // }
     output.append("Length of alignment = " + seqRes.length()).append(
             NEWLINE);
     output.append(new Format("Percentage ID = %2.2f").form(pid));