Segmentation.validate_segmentation#

classmethod Segmentation.validate_segmentation(source, segmentation, escalate_warning=False, cut_read=False)[source]#

Validate a segmentation from either a path to a csv, or a dataframe.

This could either be purely a segmentation, or data with a segmentation index.

Parameters:
  • source (Path | pd.DataFrame) – Either a path to a csv containing a segmentation or a dataframe containing a segmentation. If source is a dataframe the segmentation should not form the index.

  • segmentation (Segmentation) – The segmentation you expect ‘source’ to match.

  • escalate_warning (bool = False) – Whether to escalate warnings to errors.

  • cut_read (bool = False) – Whether to cut the read in Segmentation to the expected one.

Return type:

Segmentation class