<jupyter_start><jupyter_text>rcsbsearchAccess the RCSB advanced search from python: [rcsbsearch.readthedocs.io](https://rcsbsearch.readthedocs.io)    pip install rcsbsearch     DemoWe are interested in how the antiviral drug boceprevir interacts with Covid-19. - Source Organism is "COVID-19"- Structure title contains "protease"- Bound to ligand "Boceprevir"[RCSB Query](http://www.rcsb.org/search?request=%7B%22query%22%3A%7B%22type%22%3A%22group%22%2C%22logical_operator%22%3A%22and%22%2C%22nodes%22%3A%5B%7B%22type%22%3A%22terminal%22%2C%22service%22%3A%22text%22%2C%22parameters%22%3A%7B%22attribute%22%3A%22rcsb_entity_source_organism.taxonomy_lineage.name%22%2C%22operator%22%3A%22exact_match%22%2C%22value%22%3A%22COVID-19%22%2C%22negation%22%3Afalse%7D%2C%22node_id%22%3A0%7D%2C%7B%22type%22%3A%22terminal%22%2C%22service%22%3A%22text%22%2C%22parameters%22%3A%7B%22value%22%3A%22protease%22%2C%22negation%22%3Afalse%7D%2C%22node_id%22%3A1%7D%2C%7B%22type%22%3A%22terminal%22%2C%22service%22%3A%22text%22%2C%22parameters%22%3A%7B%22attribute%22%3A%22chem_comp.name%22%2C%22operator%22%3A%22contains_words%22%2C%22value%22%3A%22Boceprevir%22%2C%22negation%22%3Afalse%7D%2C%22node_id%22%3A2%7D%5D%7D%2C%22return_type%22%3A%22entry%22%2C%22request_info%22%3A%7B%22query_id%22%3A%2270e677a6376b4c5eba8b4f2b73866c92%22%2C%22src%22%3A%22ui%22%7D%7D)<jupyter_code>from rcsbsearch import rcsb_attributes as attrs, TextQuery
import nglview<jupyter_output><empty_output><jupyter_text>Operator syntax- Uses python comparison operators for basic attributes (`==`, `<`, `<=`, etc)- Combine using set operators (`&`, `|`, `~`, etc)- Execute queries as functions<jupyter_code>q1 = attrs.rcsb_entity_source_organism.taxonomy_lineage.name == "COVID-19"
q2 = TextQuery("protease")
q3 = attrs.chem_comp.name.contains_words("Boceprevir")
q4 = attrs.rcsb_entry_info.resolution_combined > 1.5
query = q1 & q2 & q3 & ~q4

list(query())
nglview.show_pdbid('7brp')<jupyter_output><empty_output><jupyter_text>Fluent syntaxA second syntax is available with a [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface), similar to popular data science packages like tidyverse and Apache Spark. Function calls  are chained together.Here's an example around a second antiviral, remdesivir. The drug interferes with RNA polymerase, replacing an adenine and causing early chain termination. When integrated into RNA, the nucleotide formed from remdesivir has residue code F86.<jupyter_code>attrs.struct.title.contains_phrase("RNA polymerase")\
    .or_(attrs.struct.title).contains_words("RdRp")\
    .and_(attrs.rcsb_chem_comp_container_identifiers.comp_id).exact_match("F86")\
    .and_(attrs.rcsb_entity_source_organism.taxonomy_lineage.name).exact_match("COVID-19")\
    .exec()\
    .iquery()
view = nglview.show_pdbid('7B3C', default_representation=False)
#view.get_state()['_camera_orientation']
o = [6, 3, 23, 0, 23, 1, -6, 0, -2, 24, -2, 0, -84, -92, -109, 1]
view.control.orient(o)
view.add_surface(sele="protein", opacity=.8, color="electrostatic")
view.add_cartoon(sele="rna", color="cyan")
view.add_licorice(sele="rna", color="cyan")
view.add_spacefill(sele="F86")
view<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14518147684605756, 'fraction_numerical': 0.10700876095118898, 'mean_word_length': 9.413680781758957, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '594545', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1296, 'n_words': 174, 'path': 'notebooks/covid.ipynb', 'repo_name': 'tinchogb/rcsbsearch', 'size': '3196'}