@@ -60,25 +69,25 @@ Compact forms are available for several selection statements. For example, to se
.. code-block:: python
arg_and_asn=model.Select('rname=ARG or rname=ASN')
arg_and_asn = model.Select('rname=ARG or rname=ASN')
However, this is rather cumbersome as it requires the word `rname` to be typed twice. Since the only difference between the two parts of the selection is the argument that follows the word `rname`, the statement can also be written in an abbreviated form:
.. code-block:: python
arg_and_asn=model.Select('rname=ARG,ASN')
arg_and_asn = model.Select('rname=ARG,ASN')
Another example: to select residues with numbers in the range 130 to 200, one could use the following statement
.. code-block:: python
center=model.Select('rnum>=130 and rnum<=200')
center = model.Select('rnum>=130 and rnum<=200')
or alternatively use the much nicer syntax:
.. code-block:: python
center=model.Select('rnum=130:200')
center = model.Select('rnum=130:200')
This last statement is completely equivalent to the previous one. This syntax
can be used when the selection statement requires a range of integer values
...
...
@@ -91,25 +100,38 @@ The query
.. code-block:: python
around_center=model.Select('5 <> {0,0,0}')
around_center = model.Select('5 <> {0,0,0}')
selects all chains, residues and atoms that lie with 5 Å to the origin of the reference system ({0,0,0}). The `<>` operator is called the ‘within’ operator.
Instead of a point, the within statements can also be used to return a view containing all chains, residues and atoms within a radius of another selection statement applied to the same entity. Square brackets are used to delimit the inner query statement.
selects all chains, residues and atoms that lie with 5 Å to the origin of the
reference system ({0,0,0}). The `<>` operator is called the 'within' operator.
Instead of a point, the within statements can also be used to return a view
containing all chains, residues and atoms within a radius of another selection
statement applied to the same entity. Square brackets are used to delimit the
inner query statement.
.. code-block:: python
around_hem=model.Select('5 <> [rname=HEM]')
around_hem = model.Select('5 <> [rname=HEM]')
model.Select('5 <> [rname=HEM and ele=C] and rname!=HEM')
When an :class:`EntityView` is generated by a selection, it includes by default only bonds for which both connected atoms satisfy the query statement. This can be changed by passing the parameters `EXCLUSIVE_BONDS` or `NO_BONDS` when calling the Select method. `EXCLUSIVE_BONDS` adds bonds to the :class:`EntityView` when at least one of the two atoms falls within the boundary of the selection. `NO_BONDS` suppresses the bond inclusion step completely.
When an :class:`EntityView` is generated by a selection, it includes by default
only bonds for which both connected atoms satisfy the query statement. This can
be changed by passing the parameters `EXCLUSIVE_BONDS` or `NO_BONDS` when
calling the Select method. `EXCLUSIVE_BONDS` adds bonds to the
:class:`EntityView` when at least one of the two atoms falls within the boundary
of the selection. `NO_BONDS` suppresses the bond inclusion step completely.
If the parameter `MATCH_RESIDUES` is passed when the Select method is called, the resulting :class:`EntityView` will include whole residues for which at least one atom satisfies the query. This means that if at least one atom in the residue falls within the boundaries of the selection, all atoms of the residue will be included in the View.
If the parameter `MATCH_RESIDUES` is passed when the Select method is called,
the resulting :class:`EntityView` will include whole residues for which at least
one atom satisfies the query. This means that if at least one atom in the
residue falls within the boundaries of the selection, all atoms of the residue