monkeybread.util.load_merscope

monkeybread.util.load_merscope(folder='.', use_cache=None, cell_bounds=None, transcript_locations=None, paths=None)

Loads data from MERSCOPE, in accordance to the folder structure of the FFPE data release.

Parameters
  • folder (Optional[str] (default: '.')) – A path from the current working directory to the folder containing the MERSCOPE data.

  • use_cache (Optional[str] (default: None)) – How to use a cached AnnData object. If None, does not use a cached object. If “all”, only reads from the cached object and does not read from other files. If “spatial”, reads from the cached object and adds spatial data in regards to cell boundaries and transcripts.

  • cell_bounds (Optional[bool] (default: None)) – Whether or not to include cell boundaries in a column in the resulting AnnData object. Default is to include if the folder exists.

  • transcript_locations (Optional[bool] (default: None)) – Whether or not to include transcript locations in .uns['transcripts'] in the resulting AnnData object. Default is to include if the file exists.

  • paths (Optional[Dict[str, str]] (default: None)) – Paths to each of the files output by MERSCOPE. Defaults are cache: 'adata.h5ad', counts: 'cell_by_gene.csv', coordinates: 'cell_metadata.csv', cell_bounds: 'cell_boundaries/', and transcripts: 'detected_transcripts.csv'. Default values will be filled in if an incomplete dictionary is provided.

Return type

AnnData

Returns

An annotated data matrix containing spatial data from MERSCOPE.