bioutils.cytobands module

./sbin/ucsc-cytoband-to-json cytoband-hg38.txt.gz | gzip -c >bioutils/_data/cytobands/ucsc-hg38.json.gz

bioutils.cytobands.get_cytoband_map(name)[source]

Retrives a cytoband by name.

Parameters:

name (str) – The name of the cytoband to retrieve.

Returns:

A dictionary of the cytoband data.

Return type:

dict

Examples

>>> map = get_cytoband_map("ucsc-hg38")
>>> map["1"]["p32.2"]
[55600000, 58500000, 'gpos50']
bioutils.cytobands.get_cytoband_maps(names=[])[source]

Retrieves data from multiple cytobands.

If cytobands are not specified, retrieves data from all available ones.

Parameters:

names (list of str, optional) – The names of cytobands to retrieve data for.

Returns:

A dictionary of the form {cytoband_name, cytoband_data}.

Return type:

dict

Examples

>>> maps = get_cytoband_maps()
>>> maps["ucsc-hg38"]["1"]["p32.2"]
[55600000, 58500000, 'gpos50']
>>> maps["ucsc-hg19"]["1"]["p32.2"]
[56100000, 59000000, 'gpos50']
bioutils.cytobands.get_cytoband_names()[source]

Retrieves available cytobands from the _data/cytobands directory.

Returns:

The names of the available cytobands.

Return type:

list of str

Examples

>>> sorted(get_cytoband_names())
['ucsc-hg19', 'ucsc-hg38']