From 4ef66693f43e72b8f4cc9f8250f2c834421f192f Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Mon, 21 Nov 2016 13:03:40 +0000 Subject: [PATCH] JAL-2332 bugfix to enable structure chooser opening for hen lysozyme --- src/jalview/gui/StructureChooser.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)) { -- 1.7.10.2