The simple selection queries detailed above can be combined to create complex expressions. The simplest method of combination is a simple comma separating the two parts, which is treated as a logical ``and'', so the final selection must satisfy both parts of the expression. For example: bc=1,rn=(1,10),a=ca will color bonds 1 only for alpha carbons in residues 1-10. Instead of a comma, the C ``and'' operator ``&&'' may also be used to create logical ``and'' constructs. The C ``or'' operator ``||'' is also allowed to create expressions that match one component or the other, e.g. a=ca||a=cb selects atoms named ``CA'' or atoms named ``CB''. Finally, the English words ``and'' and ``or'' are also recognized. If you use the English words, however, they must be separated from the rest of the command by spaces, e.g. r=ala and a=ca. Evaluation of expressions is normally carried out in a left-to right fashion, but curly braces may be used to control the order of operations. The ``&&'' and ``||'' operators have the same precedence, so it is usually a good idea with complex expressions to specify the grouping explicitly.
Note that the innermost set of braces is evaluated first. Occasionally, when working with a long LIST of items, spock may complain that the list generates too long of an expression. This is because the LIST structure (rn=[1,3,5,7]) is internally translated into an ``OR'' based construct (rn=1||rn=3||rn=5||rn=7). This may occasionally generate a string that is too long for the internal buffers. A work-around for this is to simplify the part of the expression using a subset, and then include the subset as part of the selection scheme. Say the string above was part of a larger expression that proved to be too long. You could use a subdef=temp,rn=[1,3,5,7] and then replace that part of the expression with sub=temp. See § 6.8 for more details on subsets.