From: tcofoegbu Date: Fri, 17 Mar 2017 15:41:01 +0000 (+0000) Subject: JAL-2136 JAL-2137 Improvements: enable STRUCTMODEL annotation statement to be less... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmerge%2FJAL-2136_phyre2_integration;hp=500bc57b2d6901ff09f6b1511289f85ba9dec823;p=jalview.git JAL-2136 JAL-2137 Improvements: enable STRUCTMODEL annotation statement to be less stringent and backwards compatible, Link query and template sequences, transfer annotation from model to template sequence --- diff --git a/examples/testdata/phyre2results/56da5616b4559c93/allhits.ann b/examples/testdata/phyre2results/56da5616b4559c93/allhits.ann index a9b64f1..4912c65 100644 --- a/examples/testdata/phyre2results/56da5616b4559c93/allhits.ann +++ b/examples/testdata/phyre2results/56da5616b4559c93/allhits.ann @@ -1,22 +1,22 @@ JALVIEW_ANNOTATION HIDE_INSERTIONS -STRUCTMODEL c4n58A_ c4n58A_.1.pdb c4n58A_.1.fasta 1 54 48 143 PDB Header: Hyrolase
Chain: A
PDB Molecule: Pectocin m2
PDB Title: Crystal structure of pectocin m2 at 1.86 amgtroms -STRUCTMODEL d1a70a_ d1a70a_.2.pdb d1a70a_.2.fasta 1 71 48 144 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1offa_ d1offa_.3.pdb d1offa_.3.fasta 1 73 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1frra_ d1frra_.4.pdb d1frra_.4.fasta 0.999 62 49 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1pfda_ d1pfda_.5.pdb d1pfda_.5.fasta 0.999 70 48 143 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1frda_ d1frda_.6.pdb d1frda_.6.fasta 0.999 50 48 143 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1fxia_ d1fxia_.7.pdb d1fxia_.7.fasta 0.999 62 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1gaqb_ d1gaqb_.8.pdb d1gaqb_.8.fasta 0.999 71 48 144 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1iuea_ d1iuea_.9.pdb d1iuea_.9.fasta 0.999 48 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1awda_ d1awda_.10.pdb d1awda_.10.fasta 0.999 68 50 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1wria_ d1wria_.11.pdb d1wria_.11.fasta 0.999 59 49 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d1czpa_ d1czpa_.12.pdb d1czpa_.12.fasta 0.999 64 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d2cjoa_ d2cjoa_.13.pdb d2cjoa_.13.fasta 0.999 63 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL d4fxca_ d4fxca_.14.pdb d4fxca_.14.fasta 0.999 64 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related -STRUCTMODEL c4itkA_ c4itkA_.15.pdb c4itkA_.15.fasta 0.999 57 50 142 PDB Header: Electron transport
Chain: A
PDB Molecule: Apoferredoxin
PDB Title: The structure of c.reinhardtii ferredoxin 2 -STRUCTMODEL c1krhA_ c1krhA_.16.pdb c1krhA_.16.fasta 0.999 25 48 142 PDB Header: Oxidoreductase
Chain: A
PDB Molecule: Benzoate 1,2-deoxygenase reductase
PDB Title: X-ray structure of benzoate deoxygenate reductase -STRUCTMODEL d1krha3 d1krha3.17.pdb d1krha3.17.fasta 0.999 24 48 143 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin domains from multi domain proteins -STRUCTMODEL d1jq4a_ d1jq4a_.18.pdb d1jq4a_.18.fasta 0.999 29 47 138 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin domains from multi domain proteins -STRUCTMODEL c4wqmA_ c4wqmA_.19.pdb c4wqmA_.19.fasta 0.999 28 49 144 PDB header: Oxidoreductase
Chain: A
PDB Molecule: Toluene-4-monooxygenase electron transfer component
PDB Title: 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 PDB header: Reductase
Chain: A
PDB Molecule: Phthalate deoxygenase reductase
PDB Title: 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 PDB Header: Hyrolase
Chain: A
PDB Molecule: Pectocin m2
PDB Title: 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 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1offa_ d1offa_.3.pdb d1offa_.3.fasta 1 73 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1frra_ d1frra_.4.pdb d1frra_.4.fasta 0.999 62 49 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1pfda_ d1pfda_.5.pdb d1pfda_.5.fasta 0.999 70 48 143 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1frda_ d1frda_.6.pdb d1frda_.6.fasta 0.999 50 48 143 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1fxia_ d1fxia_.7.pdb d1fxia_.7.fasta 0.999 62 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1gaqb_ d1gaqb_.8.pdb d1gaqb_.8.fasta 0.999 71 48 144 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1iuea_ d1iuea_.9.pdb d1iuea_.9.fasta 0.999 48 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1awda_ d1awda_.10.pdb d1awda_.10.fasta 0.999 68 50 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1wria_ d1wria_.11.pdb d1wria_.11.fasta 0.999 59 49 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d1czpa_ d1czpa_.12.pdb d1czpa_.12.fasta 0.999 64 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d2cjoa_ d2cjoa_.13.pdb d2cjoa_.13.fasta 0.999 63 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 d4fxca_ d4fxca_.14.pdb d4fxca_.14.fasta 0.999 64 48 142 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 2Fe-2S ferredoxin-related +STRUCTMODEL FER_CAPAN_1-144 c4itkA_ c4itkA_.15.pdb c4itkA_.15.fasta 0.999 57 50 142 PDB Header: Electron transport
Chain: A
PDB Molecule: Apoferredoxin
PDB Title: The structure of c.reinhardtii ferredoxin 2 +STRUCTMODEL FER_CAPAN_1-144 c1krhA_ c1krhA_.16.pdb c1krhA_.16.fasta 0.999 25 48 142 PDB Header: Oxidoreductase
Chain: A
PDB Molecule: Benzoate 1,2-deoxygenase reductase
PDB Title: X-ray structure of benzoate deoxygenate reductase +STRUCTMODEL FER_CAPAN_1-144 d1krha3 d1krha3.17.pdb d1krha3.17.fasta 0.999 24 48 143 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 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 Fold: Beta-Grasp (ubiquitin-like)
Superfamily: 2Fe-2S ferredoxin-like
Family: 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 PDB header: Oxidoreductase
Chain: A
PDB Molecule: Toluene-4-monooxygenase electron transfer component
PDB Title: 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 PDB header: Reductase
Chain: A
PDB Molecule: Phthalate deoxygenase reductase
PDB Title: Phthalate deoxygenate reductase: a modular structure for2 electron transfer from pyridine nucleotides to [2fe-2s] \ No newline at end of file diff --git a/examples/testdata/phyre2results/56da5616b4559c93/c1krhA_.1.pdb b/examples/testdata/phyre2results/56da5616b4559c93/c1krhA_.16.pdb similarity index 100% rename from examples/testdata/phyre2results/56da5616b4559c93/c1krhA_.1.pdb rename to examples/testdata/phyre2results/56da5616b4559c93/c1krhA_.16.pdb diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 571ed79..01f6e6f 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -1017,9 +1017,11 @@ public class AnnotationFile { boolean failedtoadd = true; // expect - // STRUCTMODEL + // STRUCTMODEL // <%.I.D> // [] + 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 <%.I.D> [] as tab separated fields after" + .println("Need <%.I.D> [] 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); diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 671c325..5ff2da4 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -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 diff --git a/src/jalview/ws/phyre2/Phyre2Client.java b/src/jalview/ws/phyre2/Phyre2Client.java index a54c924..cea4a64 100644 --- a/src/jalview/ws/phyre2/Phyre2Client.java +++ b/src/jalview/ws/phyre2/Phyre2Client.java @@ -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();