From f2d38aaebf121e49be29cb19ae01f1c6a36fe7e0 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 1 Sep 2016 10:16:48 +0100 Subject: [PATCH] =?utf8?q?JAL-1803=20JAL-2188=20experimental:=20Don=E2=80=99?= =?utf8?q?t=20go=20looking=20for=20new=20cross-references=20if=20we=20alread?= =?utf8?q?y=20have=20a=20mapping=20between=20a=20PDBEntry=20and=20a=20sequen?= =?utf8?q?ce=20-=20speeds=20up=20viewing=20already=20downloaded=20structure=20?= =?utf8?q?data.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/gui/StructureChooser.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index b2cc70f..33c7ff3 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -33,6 +33,7 @@ import jalview.fts.core.FTSRestRequest; import jalview.fts.core.FTSRestResponse; import jalview.fts.service.pdb.PDBFTSRestClient; import jalview.jbgui.GStructureChooser; +import jalview.structure.StructureMapping; import jalview.structure.StructureSelectionManager; import jalview.util.MessageManager; import jalview.ws.DBRefFetcher; @@ -865,8 +866,27 @@ public class StructureChooser extends GStructureChooser implements if (SiftsSettings.isMapWithSifts()) { ArrayList seqsWithoutSourceDBRef = new ArrayList(); + int p = 0; + // TODO: skip PDBEntry:Sequence pairs where PDBEntry doesn't look like a + // real PDB ID. For moment, we can also safely do this if there is already + // a known mapping between the PDBEntry and the sequence. for (SequenceI seq : sequences) { + PDBEntry pdbe = pdbEntriesToView[p++]; + if (pdbe != null && pdbe.getFile() != null) + { + StructureMapping[] smm = ssm.getMapping(pdbe.getFile()); + if (smm != null && smm.length > 0) + { + for (StructureMapping sm : smm) + { + if (sm.getSequence() == seq) + { + continue; + } + } + } + } if (seq.getPrimaryDBRefs().size() == 0) { seqsWithoutSourceDBRef.add(seq); -- 1.7.10.2