next up previous contents index
Next: Double Quotes and Regular Up: VMD Atom Selection Language Previous: Short Circuiting

Quoting with Single Quotes

    VMD allows two types of quoting mechanisms, single and double quotes. Single quotes are used to include spaces and other non-alphanumeric characters. Believe it or not, there are some residue names with a space in them, so they can be referenced as, for example,

        resname 'A 1'

More importantly, ribose atoms can be given names like C5' or C5* (depending on the age of the PDB record). The lexer in VMD has been modified so that C5', O", and N'' can be used without quotes, but it cannot handle an unquoted asterisk (* conflicts with multiplication and the parser is not able to resolve the difference). Some examples are:

        name 'O5*'
        segname 'A *'
        name O5'

Quotes may also be used to get around a reserved selection word, like x. The selection command segname x will give an error because x is another keyword. Instead, use segname 'x'. There is an escape mechanism for including single quotes inside a single quoted string which uses a backslash ('\') before the single quote. This allows unusual names like C ' to be quoted as 'C \''.

        segname x      <---- error; conflicts with the 'x' keyword
        segname 'x'
        name 'O5\''

Also, double quotes (discussed in the next section) can be used, as in "C '" or "C \*".

Justin Gullingsrud
Tue Apr 6 09:22:39 CDT 1999