snapatac2.ex.export_bed#

snapatac2.ex.export_bed(adata, groupby, selections=None, ids=None, out_dir='./', prefix='', suffix='.bed.gz')[source]#

Export base-resolution TN5 insertion sites as BED format file.

Parameters:
  • adata (AnnData | AnnDataSet) – The (annotated) data matrix of shape n_obs x n_vars. Rows correspond to cells and columns to regions.

  • groupby (str | list[str]) – Group the cells. If a str, groups are obtained from .obs[groupby].

  • selections (Optional[list[str]]) – Export only the selected groups.

  • ids (Union[str, list[str], None]) – Cell ids add to the bed records. If None, .obs_names is used.

  • out_dir (Path) – Directory for saving the outputs.

  • prefix (str) – Text added to the output file name.

  • suffix (str) – Text added to the output file name.

Returns:

A dictionary contains (groupname, filename) pairs. The file names are formatted as {prefix}{groupname}{suffix}.

Return type:

dict[str, str]