From: Jim Procter Date: Thu, 1 Sep 2016 09:16:48 +0000 (+0100) Subject: JAL-1803 JAL-2188 experimental: X-Git-Tag: Release_2_10_0~47^2~4^2~21 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f2d38aaebf121e49be29cb19ae01f1c6a36fe7e0;p=jalview.git JAL-1803 JAL-2188 experimental: Don’t go looking for new cross-references if we already have a mapping between a PDBEntry and a sequence - speeds up viewing already downloaded structure data. --- 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);