Skip to main content

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)
> 

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)

Source distribution for motif-broker-request 1.0.0
File Size Uploaded
motif-broker-request-1.0.0.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for motif-broker-request 1.0.0
File Interpreter ABI Platform
motif_broker_request-1.0.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page