crested.utils.parse_region

Contents

crested.utils.parse_region#

crested.utils.parse_region(region)#

Parse a region string or tuple, returning a consistent (chr, start, end, strand) tuple.

If strand is not provided, infers + to keep output consistent.

Parameters:

region (tuple[str, int, int] | tuple[str, int, int, str] | str) – A region tuple ((chrom, start, end) or (chrom, start, end, strand)), or a region strand.

Return type:

tuple[str, int, int, str]

Returns:

The region, as a consistent (chrom, start, end, strand) tuple.