JAL-2136 JAL-2137 Improvements: enable STRUCTMODEL annotation statement to be less... merge/JAL-2136_phyre2_integration
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 17 Mar 2017 15:41:01 +0000 (15:41 +0000)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 17 Mar 2017 15:41:01 +0000 (15:41 +0000)
examples/testdata/phyre2results/56da5616b4559c93/allhits.ann
examples/testdata/phyre2results/56da5616b4559c93/c1krhA_.16.pdb [moved from examples/testdata/phyre2results/56da5616b4559c93/c1krhA_.1.pdb with 100% similarity]
src/jalview/io/AnnotationFile.java
src/jalview/structure/StructureSelectionManager.java
src/jalview/ws/phyre2/Phyre2Client.java

index a9b64f1..4912c65 100644 (file)
@@ -1,22 +1,22 @@
 JALVIEW_ANNOTATION
 HIDE_INSERTIONS
-STRUCTMODEL    c4n58A_ c4n58A_.1.pdb   c4n58A_.1.fasta 1       54      48      143     <b>PDB Header: </b>Hyrolase<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Pectocin m2<br> <b>PDB Title: </b>Crystal structure of pectocin m2 at 1.86 amgtroms
-STRUCTMODEL    d1a70a_ d1a70a_.2.pdb   d1a70a_.2.fasta 1       71      48      144     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1offa_ d1offa_.3.pdb   d1offa_.3.fasta 1       73      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1frra_ d1frra_.4.pdb   d1frra_.4.fasta 0.999   62      49      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1pfda_ d1pfda_.5.pdb   d1pfda_.5.fasta 0.999   70      48      143     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1frda_ d1frda_.6.pdb   d1frda_.6.fasta 0.999   50      48      143     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1fxia_ d1fxia_.7.pdb   d1fxia_.7.fasta 0.999   62      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1gaqb_ d1gaqb_.8.pdb   d1gaqb_.8.fasta 0.999   71      48      144     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1iuea_ d1iuea_.9.pdb   d1iuea_.9.fasta 0.999   48      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1awda_ d1awda_.10.pdb  d1awda_.10.fasta        0.999   68      50      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1wria_ d1wria_.11.pdb  d1wria_.11.fasta        0.999   59      49      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d1czpa_ d1czpa_.12.pdb  d1czpa_.12.fasta        0.999   64      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d2cjoa_ d2cjoa_.13.pdb  d2cjoa_.13.fasta        0.999   63      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    d4fxca_ d4fxca_.14.pdb  d4fxca_.14.fasta        0.999   64      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
-STRUCTMODEL    c4itkA_ c4itkA_.15.pdb  c4itkA_.15.fasta        0.999   57      50      142     <b>PDB Header: </b>Electron transport<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Apoferredoxin <br><b>PDB Title: </b>The structure of c.reinhardtii ferredoxin 2
-STRUCTMODEL    c1krhA_ c1krhA_.16.pdb  c1krhA_.16.fasta        0.999   25      48      142     <b>PDB Header: </b>Oxidoreductase<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Benzoate 1,2-deoxygenase reductase <br> <b>PDB Title: </b>X-ray structure of benzoate deoxygenate reductase
-STRUCTMODEL    d1krha3 d1krha3.17.pdb  d1krha3.17.fasta        0.999   24      48      143     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin domains from multi domain proteins
-STRUCTMODEL    d1jq4a_ d1jq4a_.18.pdb  d1jq4a_.18.fasta        0.999   29      47      138     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin domains from multi domain proteins
-STRUCTMODEL    c4wqmA_ c4wqmA_.19.pdb  c4wqmA_.19.fasta        0.999   28      49      144     <b>PDB header: </b>Oxidoreductase<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Toluene-4-monooxygenase electron transfer component<br><b>PDB Title: </b>Structure of the toluene 4-monooxygenase nah oxidoreductase t4mof,2 k270s k271s variant
-STRUCTMODEL    c2piaA_ c2piaA_.20.pdb  c2piaA_.20.fasta        0.999   22      1       136     <b>PDB header: </b>Reductase<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Phthalate deoxygenase reductase<br><b>PDB Title: </b>Phthalate deoxygenate reductase: a modular structure for2 electron transfer from pyridine nucleotides to [2fe-2s]
\ No newline at end of file
+STRUCTMODEL    FER_CAPAN_1-144 c4n58A_ c4n58A_.1.pdb   c4n58A_.1.fasta 1       54      48      143     <b>PDB Header: </b>Hyrolase<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Pectocin m2<br> <b>PDB Title: </b>Crystal structure of pectocin m2 at 1.86 amgtroms
+STRUCTMODEL    FER_CAPAN_1-144 d1a70a_ d1a70a_.2.pdb   d1a70a_.2.fasta 1       71      48      144     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1offa_ d1offa_.3.pdb   d1offa_.3.fasta 1       73      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1frra_ d1frra_.4.pdb   d1frra_.4.fasta 0.999   62      49      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1pfda_ d1pfda_.5.pdb   d1pfda_.5.fasta 0.999   70      48      143     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1frda_ d1frda_.6.pdb   d1frda_.6.fasta 0.999   50      48      143     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1fxia_ d1fxia_.7.pdb   d1fxia_.7.fasta 0.999   62      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1gaqb_ d1gaqb_.8.pdb   d1gaqb_.8.fasta 0.999   71      48      144     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1iuea_ d1iuea_.9.pdb   d1iuea_.9.fasta 0.999   48      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1awda_ d1awda_.10.pdb  d1awda_.10.fasta        0.999   68      50      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1wria_ d1wria_.11.pdb  d1wria_.11.fasta        0.999   59      49      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d1czpa_ d1czpa_.12.pdb  d1czpa_.12.fasta        0.999   64      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d2cjoa_ d2cjoa_.13.pdb  d2cjoa_.13.fasta        0.999   63      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 d4fxca_ d4fxca_.14.pdb  d4fxca_.14.fasta        0.999   64      48      142     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin-related
+STRUCTMODEL    FER_CAPAN_1-144 c4itkA_ c4itkA_.15.pdb  c4itkA_.15.fasta        0.999   57      50      142     <b>PDB Header: </b>Electron transport<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Apoferredoxin <br><b>PDB Title: </b>The structure of c.reinhardtii ferredoxin 2
+STRUCTMODEL    FER_CAPAN_1-144 c1krhA_ c1krhA_.16.pdb  c1krhA_.16.fasta        0.999   25      48      142     <b>PDB Header: </b>Oxidoreductase<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Benzoate 1,2-deoxygenase reductase <br> <b>PDB Title: </b>X-ray structure of benzoate deoxygenate reductase
+STRUCTMODEL    FER_CAPAN_1-144 d1krha3 d1krha3.17.pdb  d1krha3.17.fasta        0.999   24      48      143     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin domains from multi domain proteins
+STRUCTMODEL    FER_CAPAN_1-144 d1jq4a_ d1jq4a_.18.pdb  d1jq4a_.18.fasta        0.999   29      47      138     <b>Fold: </b>Beta-Grasp (ubiquitin-like)<br><b>Superfamily: </b>2Fe-2S ferredoxin-like<br><b>Family: </b>2Fe-2S ferredoxin domains from multi domain proteins
+STRUCTMODEL    FER_CAPAN_1-144 c4wqmA_ c4wqmA_.19.pdb  c4wqmA_.19.fasta        0.999   28      49      144     <b>PDB header: </b>Oxidoreductase<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Toluene-4-monooxygenase electron transfer component<br><b>PDB Title: </b>Structure of the toluene 4-monooxygenase nah oxidoreductase t4mof,2 k270s k271s variant
+STRUCTMODEL    FER_CAPAN_1-144 c2piaA_ c2piaA_.20.pdb  c2piaA_.20.fasta        0.999   22      1       136     <b>PDB header: </b>Reductase<br><b>Chain: </b>A<br><b>PDB Molecule: </b>Phthalate deoxygenase reductase<br><b>PDB Title: </b>Phthalate deoxygenate reductase: a modular structure for2 electron transfer from pyridine nucleotides to [2fe-2s]
\ No newline at end of file
index 571ed79..01f6e6f 100755 (executable)
@@ -1017,9 +1017,11 @@ public class AnnotationFile
         {
           boolean failedtoadd = true;
           // expect
-          // STRUCTMODEL <TemplateSeqId> <ModelFile> <FastaMappingFile>
+          // STRUCTMODEL <Query> <TemplateSeqId> <ModelFile> <FastaMappingFile>
           // <Confidence> <%.I.D>
           // <MatchStart> <MatchEnd> <Coverage> [<Other Information>]
+          String querySeqId = !st.hasMoreTokens() ? "" : st.nextToken();
+          SequenceI querySeq = al.findName(querySeqId);
           if (st.hasMoreTokens()) {
             refSeq = al.findName(refSeqId = st.nextToken());
             if (refSeq == null)
@@ -1032,12 +1034,15 @@ public class AnnotationFile
             {
               String tempId = st.nextToken();
               String fastaMapping = st.nextToken();
-              String confidence = 100 * Double.valueOf(st.nextToken()) + "";
-              String pid = st.nextToken();
-              String alignRange = st.nextToken() + "-" + st.nextToken();
-              String otherInfo = st.hasMoreTokens() ? st.nextToken() : "";
+              String confidence = !st.hasMoreTokens() ? "" : 100
+                      * Double.valueOf(st.nextToken()) + "";
+              String pid = !st.hasMoreTokens() ? "" : st.nextToken();
+              String alignRange = !st.hasMoreTokens() ? "" : st.nextToken()
+                      + "-" + st.nextToken();
+              String otherInfo = !st.hasMoreTokens() ? "" : st.nextToken();
               String coverage = "";
-              if (add_structmodel(al, refSeq, tempId, fastaMapping,
+              if (add_structmodel(al, querySeq, refSeq, tempId,
+                      fastaMapping,
                       alignRange, coverage,
                       confidence, pid, otherInfo))
               {
@@ -1048,7 +1053,7 @@ public class AnnotationFile
           if (failedtoadd)
           {
             System.err
-                    .println("Need <TemplateSeqId> <ModelFile> <FastaMappingFile> <Confidence> <%.I.D> <MatchStart> <MatchEnd> <Coverage> [<Other Information>] as tab separated fields after"
+                    .println("Need <Query> <TemplateSeqId> <ModelFile> <FastaMappingFile> <Confidence> <%.I.D> <MatchStart> <MatchEnd> <Coverage> [<Other Information>] as tab separated fields after"
                             + STRUCTMODEL
                             + ".\nNote: other information could be provided in html format ");
           } else {
@@ -1265,7 +1270,8 @@ public class AnnotationFile
    * @param urlToPairwise
    * @return true if model and sequence was added
    */
-  private boolean add_structmodel(AlignmentI al, SequenceI refSeq,
+  private boolean add_structmodel(AlignmentI al, SequenceI querySequence,
+          SequenceI templateSeq,
           String modelFile, String fastaFile, String aRange,
           String coverage, String confidence,
           String pid, String otherInfo)
@@ -1274,15 +1280,20 @@ public class AnnotationFile
     boolean added = false;
     try {
       String structureModelFile = resolveAbsolute(modelFile);
-      String fastaMappingFile = resolveAbsolute(fastaFile);
-      // System.out.println("Model File >> " + fastaMappingFile);
-      // System.out.println("Fasta File >> " + structureModelFile);
+      String fastaMappingFile = resolveAbsolute(fastaFile.replaceAll(
+              ".fasta.jal", ".fasta"));
+      // System.out.println("Model File >> " + structureModelFile);
+      // System.out.println("Fasta File >> " + fastaMappingFile);
       PDBEntry phyre2PDBEntry = new PDBEntry(modelFile, null, Type.FILE,
               structureModelFile);
       String phyre2ModelDesc = generatePhyre2InfoHTMLTable(aRange,
               coverage, confidence, pid, otherInfo);
       phyre2PDBEntry.setProperty("PHYRE2_MODEL_INFO", phyre2ModelDesc);
-      refSeq.getDatasetSequence().addPDBId(phyre2PDBEntry);
+      templateSeq.getDatasetSequence().addPDBId(phyre2PDBEntry);
+      if (querySequence != null)
+      {
+        querySequence.getDatasetSequence().addPDBId(phyre2PDBEntry);
+      }
       StructureSelectionManager ssm = StructureSelectionManager
               .getStructureSelectionManager(Desktop.instance);
       ssm.registerPhyre2Template(structureModelFile, fastaMappingFile);
index 671c325..5ff2da4 100644 (file)
@@ -600,11 +600,15 @@ public class StructureSelectionManager
         setProgressBar(null);
         setProgressBar(MessageManager
                 .getString("status.obtaining_mapping_with_phyre2_template_alignment"));
+        String fastaFile = getPhyre2FastaFileFor(pdbFile);
         StructureMapping phyre2ModelMapping = new Phyre2Client(pdb)
-                .getStructureMapping(seq, pdbFile,
-                        getPhyre2FastaFileFor(pdbFile), " ");
-
+                .getStructureMapping(seq, pdbFile, fastaFile, " ");
         seqToStrucMapping.add(phyre2ModelMapping);
+        maxChain.makeExactMapping(maxAlignseq, seq);
+        maxChain.transferRESNUMFeatures(seq, null);
+        jalview.datamodel.Mapping sqmpping = maxAlignseq
+                .getMappingFromS1(false);
+        maxChain.transferResidueAnnotation(phyre2ModelMapping, sqmpping);
         ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
       }
       else
index a54c924..cea4a64 100644 (file)
@@ -3,6 +3,7 @@ package jalview.ws.phyre2;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
 import jalview.fts.core.DecimalFormatTableCellRenderer;
+import jalview.io.AppletFormatAdapter;
 import jalview.io.DataSourceType;
 import jalview.io.FileFormat;
 import jalview.io.FormatAdapter;
@@ -82,8 +83,11 @@ public class Phyre2Client extends StructureMappingClient
     AlignmentI seq2Phyre2ModelFastaMapping = null;
     try
     {
-      seq2Phyre2ModelFastaMapping = new FormatAdapter().readFile(
-              getFastaMappingFile(), DataSourceType.FILE, FileFormat.Fasta);
+      String fastaFile = getFastaMappingFile();
+      DataSourceType protocol = AppletFormatAdapter
+              .checkProtocol(fastaFile);
+      seq2Phyre2ModelFastaMapping = new FormatAdapter().readFile(fastaFile,
+              protocol, FileFormat.Fasta);
     } catch (IOException e1)
     {
       e1.printStackTrace();