biotite.database.rcsb.count

biotite.database.rcsb.count(query, return_type='entry', group_by=None, content_types=('experimental',))[source]

Count PDB entries that meet the given query requirements, via the RCSB search API.

This function requires an internet connection.

Parameters
queryQuery

The search query.

return_type{‘entry’, ‘assembly’, ‘polymer_entity’, ‘non_polymer_entity’, ‘polymer_instance’}, optional

The type of the counted identifiers:

  • 'entry': All macthing PDB entries are counted.

  • 'assembly': All matching assemblies are counted.

  • 'polymer_entity': All matching polymeric entities are counted.

  • 'non_polymer_entity': All matching non-polymeric entities are counted.

  • 'polymer_instance': All matching chains are counted.

group_byGrouping

If this parameter is set, the number of groups is returned instead.

content_typesiterable of {“experimental”, “computational”}, optional

Specify whether experimental and computational structures should be included. At least one of them needs to be specified. By default only experimental structures are included. Note, that identifiers for computational structures cannot be downloaded via biotite.database.rcsb.fetch() as they point to AlphaFold DB and ModelArchive.

Returns
countint

The total number of PDB IDs (or groups) that would be returned by calling search() using the same parameters.

Notes

If group_by is set, the number of results may be lower than in an ungrouped query, as grouping is not applicable to all structures. For example a DNA structure has no associated Uniprot accession and hence is omitted by UniprotGrouping.

Examples

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