Skip to main content

This is a python toolkit for the 4D Genome Browser project. It includes a client, algorithms and datastructures for accessing a 4DGenomeBrowser database.

Creating an instance of a client

The main way to interact with the database is to create a client, then make calls through the client to the database hosted at the server. The server is defined by its url and port.

    import gentk

    # provide the URL and port when creating an instance
    client = gentk.client.client("http://127.0.0.1", "8000")

    # set the project
    client.project = "test.00"

API

  • get_structure_arrays() Get a list of structure arrays from the server. The list is made of key, value pairs (see below).
  • get_sequence_arrays() Get a list of sequence arrays from the server. The list is made of key, value pairs (see below).
  • get_arrays(type) Get a list of all arrays from the server. The list is made of key, value pairs (see below).
    Example:
    arrays = client.get_arrays()

    return value has the following structure:
    [
        {
            'id': int,
            'name': string,
            'type': string
        },
        {
            'id': int,
            'name': string,
            'type': string
        },
        ,,,
    ]
  • set_array(array, metadata) Set a new array on the server. Returns the id of the new array (integer)
    Example:
    metadata = {
                    "name": "test array", 
                    "type": "structure", 
                    "datatype": "int", 
                    "datadim": 1
                 }
   id = client.set_array([0, 1, 2, 3, 4], metadata)
  • get_array(arrayID) Get an array from the server. Returns a json object.
    Example:

    result = client.get_array(id)

    return value has the following structure:
    {
        'name' : string,
        'type' : string,
        'version' : string (version of the array format)
        'data' {
            'type': string,
            'dim' : int,
            'values' : python data array
        }
    }

  • get_contactmap(mapID) Get a contact map data structure.
  • get_genes() Get the list of genes for a project.
  • get_genes_for_segment(structureID, segID) Get a list of genes for a structure's segment.
  • get_segments_for_gene(structureID, gene) Get a list of structure segments that a gene intersects.
  • get_segment_ids(structureID) Return a list of segment IDs for a structure.
  • get_structure(structureID) Get a structure. Return value is a list of segments.
    Example:

    structure = client.get_structure(id)

    return value has the following structure, which is a list of segments:
    [
        {
            'end'       : list of three floats,
            'length'    : int; length of segment,
            'segid'     : int,
            'start'     : list of three floats,
            'startid'   : int; start ID in the sequence
        },
        ...
    ]

Copyright (c) 2021 Los Alamos National Laboratory

Metadata

Release files for gentk 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 gentk 1.0.0
File Size Uploaded
gentk-1.0.0.tar.gz 5.1 kB Details

Release files / gentk-1.0.0.tar.gz

Download URL gentk-1.0.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
829e20544592539ee1afb30102cfde30e3495636fa6ae5a6efc6fcef070ba6d0
BLAKE2b-256 checksum
How to use checksums
d9d78cac8edc6e1567dbae2d7897d169541927380702d8cf5ab1696575a9ead2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.26.0 setuptools/56.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

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