crested.pp.change_regions_width

crested.pp.change_regions_width#

crested.pp.change_regions_width(adata, width, chromsizes_file=None)#

Change the widths of all regions in the adata object.

The new region will have the same center as the original region. Modifies the adata.var and adata.var_names in place. This function is useful when you want to train on a wider/narrower region than the original consensus regions.

Parameters:
  • adata (AnnData) – The AnnData object containing the regions as ‘chr:start-end’ to be modified in the .var_names.

  • width (int) – The new width of the regions.

  • chromsizes_file (Optional[PathLike] (default: None)) – File path of the chromsizes file. Used for checking if the new regions are within the chromosome boundaries.

Return type:

None

Returns:

The AnnData object with the modified regions.

Example

>>> crested.pp.change_regions_width(adata, width=1000)