This is a read-only mirror of pymolwiki.org

Difference between revisions of "Ignore case"

From PyMOL Wiki
Jump to navigation Jump to search
(1.8 default)
m (2 revisions)
(No difference)

Revision as of 05:26, 8 February 2016

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 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.

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)

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.7.6)

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.