Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Python interface for the RCSB search API.
Currently the 'text search' part of the API has been implemented. See 'Supported features' below.
This package requires python 3.7 or later.
Here is a quick example of how the package is used. Two syntaxes are available for constructing queries: an "operator" API using python's comparators, and a "fluent" syntax where terms are chained together. Which to use is a matter of preference.
A runnable jupyter notebook with this example is available in notebooks/quickstart.ipynb, or can be run online using binder:
An additional example including a Covid-19 related example is in notebooks/covid.ipynb:
Here is an example from the RCSB Search API page, using the operator syntax. This query finds symmetric dimers having a twofold rotation with the DNA-binding domain of a heat-shock transcription factor.
from rcsbsearch import TextQuery
from rcsbsearch import rcsb_attributes as attrs
# Create terminals for each query
q1 = TextQuery('"heat-shock transcription factor"')
q2 = attrs.rcsb_struct_symmetry.symbol == "C2"
q3 = attrs.rcsb_struct_symmetry.kind == "Global Symmetry"
q4 = attrs.rcsb_entry_info.polymer_entity_count_DNA >= 1
# combined using bitwise operators (&, |, ~, etc)
query = q1 & q2 & q3 & q4 # AND of all queries
# Call the query to execute it
for assemblyid in query("assembly"):
print(assemblyid)
For a full list of attributes, please refer to the RCSB schema.
Here is the same example using the fluent syntax.
from rcsbsearch import TextQuery
# Start with a Attr or TextQuery, then add terms
results = TextQuery('"heat-shock transcription factor"') \
.and_("rcsb_struct_symmetry.symbol").exact_match("C2") \
.and_("rcsb_struct_symmetry.kind").exact_match("Global Symmetry") \
.and_("rcsb_entry_info.polymer_entity_count_DNA").greater_or_equal(1) \
.exec("assembly")
# Exec produces an iterator of IDs
for assemblyid in results:
print(assemblyid)
The following table lists the status of current and planned features.
contains
, in_
(fluent only)Contributions are welcome for unchecked items!
Get it from pypi:
pip install rcsbsearch
Or, download from github
Detailed documentation is at rcsbsearch.readthedocs.io
Code is licensed under the BSD 3-clause license. See LICENSE for details.
Please cite the rcsbsearch package by URL:
You should also cite the RCSB service this package utilizes:
Yana Rose, Jose M. Duarte, Robert Lowe, Joan Segura, Chunxiao Bi, Charmi Bhikadiya, Li Chen, Alexander S. Rose, Sebastian Bittrich, Stephen K. Burley, John D. Westbrook. RCSB Protein Data Bank: Architectural Advances Towards Integrated Searching and Efficient Access to Macromolecular Structure Data from the PDB Archive, Journal of Molecular Biology, 2020. DOI: 10.1016/j.jmb.2020.11.003
For information about building and developing rcsbsearch
, see
CONTRIBUTING.md
FAQs
Access the RCSB Search API
We found that rcsbsearch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.