This function reduces a SPATA2 object to a minimal version by removing analysis progress and other non-essential data.

reduceSpataObject(object)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

Value

The updated input object, containing the added, removed or computed results.

Details

The following components are removed or reduced:

  • @assays: The @analysis and @mtr_proc slots are cleared, and @meta_var is reduced to only include molecule names.

  • @data_add: Cleared completely.

  • @dim_red: Cleared completely.

  • @meta: Only the barcodes column is retained in the metadata.

  • @spatial:

    • @annotations: Cleared completely.

    • @images: The @outline and @pixel_content slots are cleared.

    • @trajectories: Cleared completely.

    • @outline: Cleared completely.

    Furthermore, all images are unload with unlaodImages().

Examples


# Assuming 'object' is a valid SPATA2 object
reduced_object <- reduceSpataObject(object)