4D Genome Toolkit.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gentk-1.0.0.tar.gz
(5.1 kB
view details)
File details
Details for the file gentk-1.0.0.tar.gz
.
File metadata
- Download URL: gentk-1.0.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 829e20544592539ee1afb30102cfde30e3495636fa6ae5a6efc6fcef070ba6d0 |
|
MD5 | 0f06ceabe7449e674fe662ee7861c71e |
|
BLAKE2b-256 | d9d78cac8edc6e1567dbae2d7897d169541927380702d8cf5ab1696575a9ead2 |