This is a read-only mirror of pymolwiki.org

Difference between revisions of "Ignore case"

From PyMOL Wiki
Jump to navigation Jump to search
m (2 revisions)
(1.8.0.5)
Line 1: Line 1:
The [[ignore_case]] setting (default: '''off''' in PyMOL 1.8, '''on''' in previous versions) controls whether PyMOL does case sensitive matching of atomic identifiers and selection operators in the selection language. Most notably, it affects whether chain identifiers are matched case sensitive, which becomes relevant when using upper and lower case chain identifiers in a structure with more than 26 chains.
+
The [[ignore_case]] setting (default: '''on''', ''except in PyMOL 1.8.0.0 - 1.8.0.4'') controls whether PyMOL does case sensitive matching of atomic identifiers and selection operators in the selection language. Most notably, it affects whether chain identifiers are matched case sensitive, which becomes relevant when using upper and lower case chain identifiers in a structure with more than 26 chains.
  
''The default value was changed to '''off''' in PyMOL 1.8. With more and more "big" structures in the PDB, the old default was not practical anymore and led to confusion and unexpected results.''
+
<div style="padding: 10px 20px; border: 1px solid #c33; background-color: #fcc">
 +
The default value was changed to '''off''' in PyMOL 1.8.0.0. However, due to undesired side effects, the '''on''' default was restored in 1.8.0.5.
 +
 
 +
The next PyMOL version (expect 1.8.2) will introduce a new [[ignore_case_chain]] setting to address the issue of mixed case chain identifiers.
 +
 
 +
See also: https://sourceforge.net/p/pymol/mailman/message/34815599/
 +
</div>
  
 
== Example ==
 
== Example ==
Line 9: Line 15:
 
  PyMOL>fetch 1a00, async=0
 
  PyMOL>fetch 1a00, async=0
  
1) case insensitive selection language (default for PyMOL <= 1.7.6)
+
1) case insensitive selection language (default for PyMOL <= 1.7.6 and >= 1.8.0.5)
  
 
  PyMOL>set ignore_case
 
  PyMOL>set ignore_case
Line 18: Line 24:
 
   count_atoms: 1164 atoms
 
   count_atoms: 1164 atoms
  
2) case sensitive selection language (default for PyMOL > 1.7.6)
+
2) case sensitive selection language (default for PyMOL 1.8.0.0 - 1.8.0.4)
  
 
  PyMOL>set ignore_case, off
 
  PyMOL>set ignore_case, off

Revision as of 23:31, 8 February 2016

The ignore_case setting (default: on, except in PyMOL 1.8.0.0 - 1.8.0.4) controls whether PyMOL does case sensitive matching of atomic identifiers and selection operators in the selection language. Most notably, it affects whether chain identifiers are matched case sensitive, which becomes relevant when using upper and lower case chain identifiers in a structure with more than 26 chains.

The default value was changed to off in PyMOL 1.8.0.0. However, due to undesired side effects, the on default was restored in 1.8.0.5.

The next PyMOL version (expect 1.8.2) will introduce a new ignore_case_chain setting to address the issue of mixed case chain identifiers.

See also: https://sourceforge.net/p/pymol/mailman/message/34815599/

Example

Load 1a00 which has chains A, B, C, D

PyMOL>fetch 1a00, async=0

1) case insensitive selection language (default for PyMOL <= 1.7.6 and >= 1.8.0.5)

PyMOL>set ignore_case
 Setting: ignore_case set to on.
PyMOL>count_atoms chain A
 count_atoms: 1164 atoms
PyMOL>count_atoms chain a
 count_atoms: 1164 atoms

2) case sensitive selection language (default for PyMOL 1.8.0.0 - 1.8.0.4)

PyMOL>set ignore_case, off
 Setting: ignore_case set to off.
PyMOL>count_atoms chain A
 count_atoms: 1164 atoms
PyMOL>count_atoms chain a
 count_atoms: 0 atoms

Best Practice for Scripting

When writing scripts or plugins, all selection expressions should be strict about case (e.g. "name CA" and not "name ca") to not depend on the users setting of ignore_case.