How to use the pycellbase.cbclient.CellBaseClient function in pycellbase

To help you get started, we’ve selected a few pycellbase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opencb / cellbase / clients / python / tools / cbtools.py View on Github external
)

    # Overriding config
    if args.config is not None:
        cc = ConfigClient(args.config)
    if args.species is not None:
        cc.species = args.species
    if args.api_version is not None:
        cc.version = args.api_version
    if args.host is not None:
        cc.host = args.host
    if args.assembly is not None:
        assembly = args.assembly
    else:
        assembly = _DEFAULT_ASSEMBLY
    cbc = CellBaseClient(cc)

    if args.which == 'xref':
        # Getting available databases
        databases = _get_databases_list(cbc, assembly)

        # Filtering databases with include and exclude
        include = args.include.split(',') if args.include is not None else None
        exclude = args.exclude.split(',') if args.exclude is not None else None
        databases = _filter_databases(databases, include=include,
                                      exclude=exclude)

        # Converting IDs
        convert_ids(input_fpath=args.input_fpath,
                    output_fpath=args.output_fpath,
                    cellbase_client=cbc,
                    assembly=assembly,
github opencb / cellbase / clients / python / tools / id_conversor.py View on Github external
# Overriding config
    if args.config is not None:
        cc = ConfigClient(args.config)
    if args.species is not None:
        cc.species = args.species
    if args.api_version is not None:
        cc.version = args.api_version
    if args.host is not None:
        cc.host = args.host
    if args.assembly is not None:
        assembly = args.assembly
    else:
        assembly = _DEFAULT_ASSEMBLY

    # Setting up pycellbase clients
    cbc = CellBaseClient(cc)
    xc = cbc.get_xref_client()

    # Printing available species and databases lists
    if args.list_species:
        for species in _get_species_list(cbc, assembly):
            print(species)
        return
    if args.list_databases:
        for database in _get_databases_list(xc, assembly):
            print(database)
        return

    # Getting available databases
    databases = _get_databases_list(xc, assembly)

    # Converting IDs
github opencb / cellbase / clients / python / tools / hgvs_calculator.py View on Github external
"rest": {"hosts": [_DEFAULT_HOST]}}
    )

    if args.config is not None:
        cc = ConfigClient(args.config)
    if args.species is not None:
        cc.species = args.species
    if args.api_version is not None:
        cc.version = args.api_version
    if args.host is not None:
        cc.host = args.host
    if args.assembly is not None:
        assembly = args.assembly
    else:
        assembly = _DEFAULT_ASSEMBLY
    cbc = CellBaseClient(cc)

    calculate_hgvs(args.input, args.output_fpath, cbc, args.ref_seq_type,
                   assembly)
github opencb / cellbase / cellbase-app / app / scripts / pycellbase / gene_query.py View on Github external
#!/usr/bin/python

# Loading CellBase and configuration clients
from pycellbase.cbconfig import ConfigClient
from pycellbase.cbclient import CellBaseClient

# Initializing CellBaseClient
cc = ConfigClient("../conf/client-configuration.yml")
cbc = CellBaseClient(cc)

# Initializing gene client
gc = cbc.get_gene_client()

# Retrieving transcription factor binding sites (TFBS) for a gene list
gene_list = ['BRCA1', 'BRCA2', 'LDLR']
tfbs_responses = gc.get_tfbs(gene_list, include='id')

# Printing the number of TFBS found for each gene
for response in tfbs_responses:
    print('Number of TFBS for "%s": %d' % (response['id'], len(response['result'])))