biotite.database.rcsb.FieldQuery

class biotite.database.rcsb.FieldQuery(field, molecular_definition=False, case_sensitive=False, **kwargs)[source]

Bases: SingleQuery

A text query for searching for values in a given field using the given operator.

The operators are keyword arguments of this function and the search value is the value given to the respective parameter. The operators are mutually exclusive. If none is given, the search will return results where the given field exists.

A FieldQuery is negated using the ~ operator.

Parameters
fieldstr

The field to search in.

molecular_definitionbool, optional

If set true, this query searches in fields associated with molecular definitions. If false (default), this query searches in fields associated with PDB structures.

case_sensitivebool, optional

If set to true, searches are case sensitive. By default matching is case-insensitive.

exact_matchstr, optional

Operator for returning results whose field exactly matches the given value.

contains_words, contains_phrasestr, optional

Operator for returning results whose field matches individual words from the given value or the value as exact phrase, respectively.

greater, less, greater_or_equal, less_or_equal, equalsint or float or datetime, optional

Operator for returning results whose field values are larger, smaller or equal to the given value.

range, range_closedtuple(int, int) or tuple(float, float) or tuple(datetime, datetime), optional

Operator for returning results whose field matches values within the given range. range_closed includes the interval limits.

is_intuple of str or list of str, optional

Operator for returning results whose field matches any of the values in the given list.

Notes

A complete list of the available fields and its supported operators is documented at https://search.rcsb.org/structure-search-attributes.html and https://search.rcsb.org/chemical-search-attributes.html.

Examples

>>> query = FieldQuery("reflns.d_resolution_high", less_or_equal=0.6)
>>> print(sorted(search(query)))
['1EJG', '1I0T', '3NIR', '3P4J', '4JLJ', '5D8V', '5NW3', '7ATG', '7R0H']
get_content()

Get the query content, i.e. the data belonging to the 'query' attribute in the RCSB search API.

This content is converted into JSON by the search() and count() functions.

Returns
contentdict

The content dictionary for the 'query' attributes.