pegasusio/zarr_utils.py
def write_unimodal_data(self, parent: zarr.Group, name: str, data: UnimodalData, overwrite: bool = True) -> None:
        """ Write UnimodalData
            overwrite means if overwrite the whole unimodal data; meaning is different from require_group overwrite --- if the name in array_keys(), take it and make it as a group
        """
        group = None
        if overwrite:
            group = parent.create_group(name, overwrite = True)
        else:
            group = parent.require_group(name, overwrite = False) # throw an error if name in array_keys()

        attrs_dict = {'data_type': 'UnimodalData', '_cur_matrix': data.current_matrix()}
        group.attrs.update(**attrs_dict)

        self.write_dataframe(group, 'barcode_metadata', data.barcode_metadata)
        self.write_dataframe(group, 'feature_metadata', data.feature_metadata)

        if overwrite or data.matrices.is_dirty():
            self.write_mapping(group, 'matrices', data.matrices, overwrite = overwrite)
        if overwrite or data.metadata.is_dirty():
            self.write_mapping(group, 'metadata', data.metadata, overwrite = overwrite)
        if overwrite or data.barcode_multiarrays.is_dirty():
            self.write_mapping(group, 'barcode_multiarrays', data.barcode_multiarrays, overwrite = overwrite)
        if overwrite or data.feature_multiarrays.is_dirty():
            self.write_mapping(group, 'feature_multiarrays', data.feature_multiarrays, overwrite = overwrite)
        if overwrite or data.barcode_multigraphs.is_dirty():
            self.write_mapping(group, 'barcode_multigraphs', data.barcode_multigraphs, overwrite = overwrite)
        if overwrite or data.feature_multigraphs.is_dirty():
            self.write_mapping(group, 'feature_multigraphs', data.feature_multigraphs, overwrite = overwrite)
 Write UnimodalData
            overwrite means if overwrite the whole unimodal data; meaning is different from require_group overwrite --- if the name in array_keys(), take it and make it as a group
        
Write UnimodalData
overwrite means if overwrite the whole unimodal data; meaning is different from require_group overwrite --- if the name in array_keys(), take it and make it as a group
Write UnimodalData overwrite means if overwrite the whole unimodal data ; meaning is different from require_group overwrite --- if the name in array_keys () take it and make it as a group
def write_unimodal_data(self, parent: zarr.Group, name: str, data: UnimodalData, overwrite: bool = True) -> None:
        group = None
        if overwrite:
            group = parent.create_group(name, overwrite = True)
        else:
            group = parent.require_group(name, overwrite = False) 
        attrs_dict = {'data_type': 'UnimodalData', '_cur_matrix': data.current_matrix()}
        group.attrs.update(**attrs_dict)
        self.write_dataframe(group, 'barcode_metadata', data.barcode_metadata)
        self.write_dataframe(group, 'feature_metadata', data.feature_metadata)
        if overwrite or data.matrices.is_dirty():
            self.write_mapping(group, 'matrices', data.matrices, overwrite = overwrite)
        if overwrite or data.metadata.is_dirty():
            self.write_mapping(group, 'metadata', data.metadata, overwrite = overwrite)
        if overwrite or data.barcode_multiarrays.is_dirty():
            self.write_mapping(group, 'barcode_multiarrays', data.barcode_multiarrays, overwrite = overwrite)
        if overwrite or data.feature_multiarrays.is_dirty():
            self.write_mapping(group, 'feature_multiarrays', data.feature_multiarrays, overwrite = overwrite)
        if overwrite or data.barcode_multigraphs.is_dirty():
            self.write_mapping(group, 'barcode_multigraphs', data.barcode_multigraphs, overwrite = overwrite)
        if overwrite or data.feature_multigraphs.is_dirty():
            self.write_mapping(group, 'feature_multigraphs', data.feature_multigraphs, overwrite = overwrite)
def write_unimodal_data ( self , parent : zarr . Group , name : str , data : UnimodalData , overwrite : bool = True ) -> None : group = None if overwrite : group = parent . create_group ( name , overwrite = True ) else : group = parent . require_group ( name , overwrite = False ) attrs_dict = { 'data_type' : 'UnimodalData' , '_cur_matrix' : data . current_matrix ( ) } group . attrs . update ( ** attrs_dict ) self . write_dataframe ( group , 'barcode_metadata' , data . barcode_metadata ) self . write_dataframe ( group , 'feature_metadata' , data . feature_metadata ) if overwrite or data . matrices . is_dirty ( ) : self . write_mapping ( group , 'matrices' , data . matrices , overwrite = overwrite ) if overwrite or data . metadata . is_dirty ( ) : self . write_mapping ( group , 'metadata' , data . metadata , overwrite = overwrite ) if overwrite or data . barcode_multiarrays . is_dirty ( ) : self . write_mapping ( group , 'barcode_multiarrays' , data . barcode_multiarrays , overwrite = overwrite ) if overwrite or data . feature_multiarrays . is_dirty ( ) : self . write_mapping ( group , 'feature_multiarrays' , data . feature_multiarrays , overwrite = overwrite ) if overwrite or data . barcode_multigraphs . is_dirty ( ) : self . write_mapping ( group , 'barcode_multigraphs' , data . barcode_multigraphs , overwrite = overwrite ) if overwrite or data . feature_multigraphs . is_dirty ( ) : self . write_mapping ( group , 'feature_multigraphs' , data . feature_multigraphs , overwrite = overwrite )
Write UnimodalData
overwrite means if overwrite the whole unimodal data; meaning is different from require_group overwrite --- if the name in array_keys(), take it and make it as a group
Write UnimodalData overwrite means if overwrite the whole unimodal data ; meaning is different from require_group overwrite --- if the name in array_keys () take it and make it as a group
""" Write UnimodalData
            overwrite means if overwrite the whole unimodal data; meaning is different from require_group overwrite --- if the name in array_keys(), take it and make it as a group
        """ # throw an error if name in array_keys()
self
parent
zarr.Group
name
str
data
UnimodalData
overwrite
bool