biotite.database.rcsb.FieldQuery

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

Bases: biotite.database.rcsb.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.

exact_matchstr, optional

Operator for returning results whose field exactly matches the given value. The matching is not case-sensitive.

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. The matching is not case-sensitive.

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', '2GLT', '3NIR', '3P4J', '4JLJ', '5D8V', '5NW3', '7ATG']
get_content()[source]

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() methods.