grelu.data.utils#

Dataset-related utility functions.

Functions#

_check_multiclass(→ bool)

Check whether a dataframe contains valid multiclass labels.

_create_task_data(→ pandas.DataFrame)

Check that task names are valid and create an empty dataframe with

get_chromosomes(→ List[str])

Return a list of chromosomes given shortcut names.

Module Contents#

grelu.data.utils._check_multiclass(df: pandas.DataFrame) bool[source]#

Check whether a dataframe contains valid multiclass labels.

grelu.data.utils._create_task_data(task_names: List[str]) pandas.DataFrame[source]#

Check that task names are valid and create an empty dataframe with task names as the index.

Parameters:

task_names – List of names

Returns:

Checked names as strings

grelu.data.utils.get_chromosomes(chroms: str | List[str]) List[str][source]#

Return a list of chromosomes given shortcut names.

Parameters:

chroms – The chromosome name(s) or shortcut name(s).

Returns:

A list of chromosome name(s).

Example

>>> get_chromosomes("autosomes")
['chr1', 'chr2', 'chr3', 'chr4', 'chr5', 'chr6', 'chr7', 'chr8', 'chr9', 'chr10',
'chr11', 'chr12', 'chr13', 'chr14', 'chr15', 'chr16', 'chr17', 'chr18', 'chr19',
'chr20', 'chr21', 'chr22']