Skip to content

Commit

Permalink
0.3 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
samirelanduk committed May 28, 2021
1 parent 464c820 commit 1f71abc
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 4 deletions.
37 changes: 35 additions & 2 deletions README.rst
Expand Up @@ -26,9 +26,9 @@ Example
-------

>>> import pdbsearch
>>> codes = pdbsearch.search(limit=5)
>>> codes = pdbsearch.search(limit=5, ligand_name="CU")
>>> codes
['4CD7', '4CCW', '4CD8', '4CCX', '4CCY']
['3HW7', '2WKO', '2WOF', '2WOH', '2WO0']



Expand Down Expand Up @@ -117,13 +117,46 @@ You can sort by multiple criteria:
>>> pdbsearch.search(limit=5, sort=["-atoms", "released"])
['1ANP', '6UOU', '6UOW', '1Q7O', '6QTF']

Search Criteria
~~~~~~~~~~~~~~~

You can search by passing keywords to the search function:

>>> pdbsearch.search(limit=5, ligand_name="ZN")
['3HW7', '3I7I', '3I7G', '2WFX', '2WGT']

You can modify the operator used with double underscores:

>>> pdbsearch.search(limit=5, ligand_name__in=["ZN", "CU"])
['3HW7', '3I7I', '3I7G', '2WFX', '2WGT']
>>> pdbsearch.search(limit=5, resolution__lt=2)
['3HW3', '3I83', '3HVS', '3HW4', '3HW5']
>>> pdbsearch.search(limit=5, atoms__within=[200, 300])
['2WH9', '2WPY', '395D', '396D', '2X8Q']

These are some shorthands, but you can search by any of the terms in the above
linked list by replacing the dot with a double underscore:

>>> pdbsearch.search(limit=5, citation__rcsb_authors="Sula, A.")
['4CAH', '4CAI', '4X8A', '4X88', '4X89']

If you use more than one term, they will be combined with AND operators:

>>> pdbsearch.search(limit=5, ligand_name="ZN", atoms__within=[200, 300])
['3WUP', '3ZNF', '2YTA', '2YTB', '2YSV']

Changelog
---------

Release 0.3.0
~~~~~~~~~~~~~

`29 May 2021`

* Added search criteria.
* Added AND chaining for search criteria.


Release 0.2.0
~~~~~~~~~~~~~

Expand Down
9 changes: 9 additions & 0 deletions docs/source/changelog.rst
@@ -1,6 +1,15 @@
Changelog
---------

Release 0.3.0
~~~~~~~~~~~~~

`29 May 2021`

* Added search criteria.
* Added AND chaining for search criteria.


Release 0.2.0
~~~~~~~~~~~~~

Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Expand Up @@ -8,9 +8,9 @@ Example
-------

>>> import pdbsearch
>>> codes = pdbsearch.search(limit=5)
>>> codes = pdbsearch.search(limit=5, ligand_name="CU")
>>> codes
['4CD7', '4CCW', '4CD8', '4CCX', '4CCY']
['3HW7', '2WKO', '2WOF', '2WOH', '2WO0']

Table of Contents
-----------------
Expand Down
25 changes: 25 additions & 0 deletions docs/source/overview.rst
Expand Up @@ -39,5 +39,30 @@ You can sort by multiple criteria:
>>> pdbsearch.search(limit=5, sort=["-atoms", "released"])
['1ANP', '6UOU', '6UOW', '1Q7O', '6QTF']

Search Criteria
~~~~~~~~~~~~~~~

You can search by passing keywords to the search function:

>>> pdbsearch.search(limit=5, ligand_name="ZN")
['3HW7', '3I7I', '3I7G', '2WFX', '2WGT']

You can modify the operator used with double underscores:

>>> pdbsearch.search(limit=5, ligand_name__in=["ZN", "CU"])
['3HW7', '3I7I', '3I7G', '2WFX', '2WGT']
>>> pdbsearch.search(limit=5, resolution__lt=2)
['3HW3', '3I83', '3HVS', '3HW4', '3HW5']
>>> pdbsearch.search(limit=5, atoms__within=[200, 300])
['2WH9', '2WPY', '395D', '396D', '2X8Q']

These are some shorthands, but you can search by any of the terms in the above
linked list by replacing the dot with a double underscore:

>>> pdbsearch.search(limit=5, citation__rcsb_authors="Sula, A.")
['4CAH', '4CAI', '4X8A', '4X88', '4X89']

If you use more than one term, they will be combined with AND operators:

>>> pdbsearch.search(limit=5, ligand_name="ZN", atoms__within=[200, 300])
['3WUP', '3ZNF', '2YTA', '2YTB', '2YSV']

0 comments on commit 1f71abc

Please sign in to comment.