X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=cd986c0550cecca569f19e213f22cd26e3aacbbc;hb=32d1b850ae63a01a6b3fae305d9577ac16552515;hp=0e4384164ecf18f494510a886eec5121bee80e85;hpb=1719c61073682fdfe66a63408bab498b6ca4234c;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 0e43841..cd986c0 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -285,7 +285,8 @@ public class StructureSelectionManager } /** - * Returns the file name for a mapped PDB id (or null if not mapped). + * Returns the filename the PDB id is already mapped to if known, or null if + * it is not mapped * * @param pdbid * @return @@ -294,7 +295,7 @@ public class StructureSelectionManager { for (StructureMapping sm : mappings) { - if (sm.getPdbId().equals(pdbid)) + if (sm.getPdbId().equalsIgnoreCase(pdbid)) { return sm.pdbfile; } @@ -397,8 +398,11 @@ public class StructureSelectionManager { // FIXME if sourceType is not null, we've lost data here sourceType = AppletFormatAdapter.checkProtocol(pdbFile); - pdb = new JmolParser(pdbFile, sourceType); - + pdb = new JmolParser(false, pdbFile, sourceType); + pdb.addSettings(parseSecStr && processSecondaryStructure, + parseSecStr && addTempFacAnnot, + parseSecStr && secStructServices); + pdb.doParse(); if (pdb.getId() != null && pdb.getId().trim().length() > 0 && DataSourceType.FILE == sourceType) { @@ -426,6 +430,7 @@ public class StructureSelectionManager { isMapUsingSIFTs = false; e.printStackTrace(); + siftsClient = null; } String targetChainId; @@ -571,6 +576,13 @@ public class StructureSelectionManager { System.err.println(e.getMessage()); } + catch (Exception e) + { + System.err + .println( + "Unexpected exception during SIFTS mapping - falling back to NW for this sequence/structure pair"); + System.err.println(e.getMessage()); + } } if (!foundSiftsMappings.isEmpty()) { @@ -604,7 +616,10 @@ public class StructureSelectionManager } if (forStructureView) { - mappings.addAll(seqToStrucMapping); + for (StructureMapping sm : seqToStrucMapping) + { + addStructureMapping(sm); // not addAll! + } } if (progress != null) { @@ -656,7 +671,10 @@ public class StructureSelectionManager public void addStructureMapping(StructureMapping sm) { - mappings.add(sm); + if (!mappings.contains(sm)) + { + mappings.add(sm); + } } /**