stereo.tools.cell_correct.cell_correct#

stereo.tools.cell_correct.cell_correct(out_dir, threshold=20, gem_path=None, bgef_path=None, raw_cgef_path=None, mask_path=None, process_count=None, only_save_result=False, method='EDM', distance=10, **kwargs)[source]#
Correct cells using one of file conbinations as following:
  • GEM and mask

  • BGEF and mask

  • GEM and raw CGEF (not corrected)

  • BGEF and raw CGEF (not corrected)

Parameters:
  • out_dir (str) – the path to save intermediate result, like mask (if generated from ssDNA image), BGEF (generated from GEM), CGEF (generated from GEM and mask), etc. and final corrected result.

  • threshold (int) – threshold size, default to 20.

  • gem_path (Optional[str]) – the path to GEM file.

  • bgef_path (Optional[str]) – the path to BGEF file.

  • raw_cgef_path (Optional[str]) – the path to CGEF file which not has been corrected.

  • mask_path (Optional[str]) – the path to mask file.

  • process_count (Optional[int]) – the count of the processes or threads will be started when correct cells, defaults to None by default, it will be set to 10 when method is set to ‘GMM’ and will be set to 1 when method is set to ‘FAST’ or ‘EDM’. if it is set to -1, all of the cores will be used.

  • method (Literal['GMM', 'FAST', 'EDM']) – correct in different method if method is set, otherwise EDM.

  • distance (int) – outspread distance based on cellular contour of cell segmentation image, in pixels, only available for ‘EDM’ method.

Returns:

An StereoExpData object if only_save_result is set to False, otherwise the path of corrected CGEF file.