From: tcofoegbu Date: Mon, 21 Nov 2016 13:03:40 +0000 (+0000) Subject: JAL-2332 bugfix to enable structure chooser opening for hen lysozyme X-Git-Tag: Release_2_10_1~11^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4ef66693f43e72b8f4cc9f8250f2c834421f192f;p=jalview.git JAL-2332 bugfix to enable structure chooser opening for hen lysozyme --- diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 3350f6c..21b6e4f 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -83,6 +83,8 @@ public class StructureChooser extends GStructureChooser implements private boolean cachedPDBExists; + private static int MAX_QLENGHT = 7820; + public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq, AlignmentPanel ap) { @@ -259,7 +261,8 @@ public class StructureChooser extends GStructureChooser implements StringBuilder queryBuilder = new StringBuilder(); Set seqRefs = new LinkedHashSet(); - if (seq.getAllPDBEntries() != null) + if (seq.getAllPDBEntries() != null + && queryBuilder.length() < MAX_QLENGHT) { for (PDBEntry entry : seq.getAllPDBEntries()) { @@ -268,7 +271,6 @@ public class StructureChooser extends GStructureChooser implements queryBuilder.append("pdb_id:") .append(entry.getId().toLowerCase()).append(" OR "); isPDBRefsFound = true; - // seqRefs.add(entry.getId()); } } } @@ -277,7 +279,8 @@ public class StructureChooser extends GStructureChooser implements { for (DBRefEntry dbRef : seq.getDBRefs()) { - if (isValidSeqName(getDBRefId(dbRef))) + if (isValidSeqName(getDBRefId(dbRef)) + && queryBuilder.length() < MAX_QLENGHT) { if (dbRef.getSource().equalsIgnoreCase(DBRefSource.UNIPROT)) {