git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b52f1c3
)
JAL-3931 remove % and - from ids so Pymol doesn’t strip them out and truncate the...
author
Jim Procter
<j.procter@dundee.ac.uk>
Wed, 8 Dec 2021 15:45:51 +0000
(15:45 +0000)
committer
Jim Procter
<j.procter@dundee.ac.uk>
Wed, 8 Dec 2021 15:45:51 +0000
(15:45 +0000)
src/jalview/gui/PymolBindingModel.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/PymolBindingModel.java
b/src/jalview/gui/PymolBindingModel.java
index
538b101
..
719ca53
100644
(file)
--- a/
src/jalview/gui/PymolBindingModel.java
+++ b/
src/jalview/gui/PymolBindingModel.java
@@
-171,6
+171,21
@@
public class PymolBindingModel extends AAStructureBindingModel
* a second parameter sets the pdbid as the loaded PyMOL object name
*/
String pdbId = pe.getId();
* a second parameter sets the pdbid as the loaded PyMOL object name
*/
String pdbId = pe.getId();
+ try {
+ String safePDBId = java.net.URLEncoder.encode(pdbId,"UTF-8");
+ pdbId = safePDBId.replace('%', '_');
+ pdbId = pdbId.replace("-", "__");
+ char fc = pdbId.charAt(0);
+ // put an 's' before any numerics
+ if (fc>='0' && fc<='9')
+ {
+ pdbId = 's'+pdbId;
+ }
+// pdbId.replace('-', 0)
+ } catch (Exception x)
+ {
+ Cache.log.error("Unxpected encoding exception for '"+pdbId+"'",x);
+ }
cmd.addParameter(pdbId);
executeCommand(cmd, false);
cmd.addParameter(pdbId);
executeCommand(cmd, false);