motif-broker-request
Example in test/test.py
Configure motif-broker-request
import motif_broker_request.request as mb_request
mb_request.configure("http://localhost:5984") #Default is localhost:3282
You can also change bulk length
mb_request.set_bulk_length(10000) #Default is 50000
Request motif-broker
sgrnas = ["AAAAAAAAAAAAAAAAAAATGGG", "TCCAAAAAAAAACAGTGGATTGG", "CACTAAAAAAGAAGACCAAGCGG"] # sgRNAs you want to search
res = mb_request.get(sgrnas)
print(res)
>
Request motif-broker with some filter
You can write filter functions. This functions have to take motif_broker results as arguments and return the filtered version with same format
Example of function that just keep given genomes in results :
def filter_genomes(mb_res, **kwargs):
if not "genomes" in kwargs:
raise Exception("you must provide 'genomes' argument to get function for filter_genomes function")
genomes = kwargs["genomes"]
filtered_results = {}
for sgrna in mb_res:
added = False
for org in mb_res[sgrna]:
if org in genomes:
if added:
filtered_results[sgrna][org] = mb_res[sgrna][org]
else:
filtered_results[sgrna] = {org : mb_res[sgrna][org]}
return filtered_results
Applied this way to get results :
res = mb_request.get(sgrnas, filter_predicate=filter_genomes, genomes=["dd6cfb980c8a3659acffa4f002ea7404", "dd6cfb980c8a3659acffa4f0029ff84a"])
print(res)
>
Metadata
Release files for motif-broker-request 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| motif-broker-request-1.0.0.tar.gz | 2.7 kB | Without provenance | Details for motif-broker-request-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| motif_broker_request-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for motif_broker_request-1.0.0-py3-none-any.whl |
Total release size: 5.7 kB
Release files / motif-broker-request-1.0.0.tar.gz
| Download URL | motif-broker-request-1.0.0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72f10bd92ad8e1c614308a46d46ee312f68312546a21982c89c728292cc2e70b
|
|
BLAKE2b-256 checksum How to use checksums |
3970e2e21956219f0b61982a1aa51d6f50cb9a29235562b3b0863e699061e6f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1
|
Release files / motif_broker_request-1.0.0-py3-none-any.whl
| Download URL | motif_broker_request-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f1b9cba08038f41c66efe59708a5bc02209b4346097b39dbfe8c6aa3c0bb59d
|
|
BLAKE2b-256 checksum How to use checksums |
c348f5e341fe8a79ed18115453671618708f994b329d14ec62a6390fa6b1a3b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1
|
Security for motif-broker-request 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.