From e0edbbd56a07a9ef4f8b50e3c616062aa013544c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 27 Jul 2021 13:35:40 +0100 Subject: [PATCH] JAL-3855 check if an alpha fold ID and retrieve using that source --- src/jalview/gui/AppJmol.java | 10 +++++++++- src/jalview/gui/StructureViewerBase.java | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 7cf10e7..d085117 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -51,6 +51,7 @@ import jalview.util.BrowserLauncher; import jalview.util.ImageMaker; import jalview.util.MessageManager; import jalview.util.Platform; +import jalview.ws.dbsources.EBIAlfaFold; import jalview.ws.dbsources.Pdb; public class AppJmol extends StructureViewerBase @@ -437,6 +438,8 @@ public class AppJmol extends StructureViewerBase // TODO: replace with reference fetching/transfer code (validate PDBentry // as a DBRef?) Pdb pdbclient = new Pdb(); + EBIAlfaFold afclient = new EBIAlfaFold(); + for (int pi = 0; pi < jmb.getPdbCount(); pi++) { String file = jmb.getPdbEntry(pi).getFile(); @@ -452,7 +455,12 @@ public class AppJmol extends StructureViewerBase { pdbid }), hdl); try { - pdbseq = pdbclient.getSequenceRecords(pdbid); + if (afclient.isValidReference(pdbid)) + { + pdbseq = afclient.getSequenceRecords(pdbid); + } else { + pdbseq = pdbclient.getSequenceRecords(pdbid); + } } catch (OutOfMemoryError oomerror) { new OOMWarning("Retrieving PDB id " + pdbid, oomerror); diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index a0b199b..b349559 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -63,6 +63,7 @@ import jalview.structure.StructureMapping; import jalview.structures.models.AAStructureBindingModel; import jalview.util.BrowserLauncher; import jalview.util.MessageManager; +import jalview.ws.dbsources.EBIAlfaFold; import jalview.ws.dbsources.Pdb; /** @@ -1121,6 +1122,7 @@ public abstract class StructureViewerBase extends GStructureViewer { String filePath = null; Pdb pdbclient = new Pdb(); + EBIAlfaFold afclient = new EBIAlfaFold(); AlignmentI pdbseq = null; String pdbid = processingEntry.getId(); long handle = System.currentTimeMillis() @@ -1138,7 +1140,12 @@ public abstract class StructureViewerBase extends GStructureViewer // { pdbid })); try { - pdbseq = pdbclient.getSequenceRecords(pdbid); + if (afclient.isValidReference(pdbid)) + { + pdbseq = afclient.getSequenceRecords(pdbid); + } else { + pdbseq = pdbclient.getSequenceRecords(pdbid); + } } catch (Exception e) { System.err.println( -- 1.7.10.2