pegasusio/multimodal_data.py
def subset_data(self, data_subset: Set[str] = None, genome_subset: Set[str] = None, modality_subset: Set[str] = None) -> None:
        """ Only keep data that are in data_subset or genome_subset or modality_subset
        """
        if data_subset is not None:
            for key in self.list_data():
                if key not in data_subset:
                    del self.data[key]
        elif genome_subset is not None:
            for key in self.list_data():
                if self.data[key].get_genome() not in genome_subset:
                    del self.data[key]
        elif modality_subset is not None:
            for key in self.list_data():
                if self.data[key].get_modality() not in modality_subset:
                    del self.data[key]

        if len(self.list_data()) == 0:
            self._selected = None
            self._unidata = None
        elif self._selected not in self.list_data():
            self._selected = self.list_data()[0]
            self._unidata = self.data[self._selected]
 Only keep data that are in data_subset or genome_subset or modality_subset
        
Only keep data that are in data_subset or genome_subset or modality_subset
Only keep data that are in data_subset or genome_subset or modality_subset
def subset_data(self, data_subset: Set[str] = None, genome_subset: Set[str] = None, modality_subset: Set[str] = None) -> None:
        if data_subset is not None:
            for key in self.list_data():
                if key not in data_subset:
                    del self.data[key]
        elif genome_subset is not None:
            for key in self.list_data():
                if self.data[key].get_genome() not in genome_subset:
                    del self.data[key]
        elif modality_subset is not None:
            for key in self.list_data():
                if self.data[key].get_modality() not in modality_subset:
                    del self.data[key]
        if len(self.list_data()) == 0:
            self._selected = None
            self._unidata = None
        elif self._selected not in self.list_data():
            self._selected = self.list_data()[0]
            self._unidata = self.data[self._selected]
def subset_data ( self , data_subset : Set [ str ] = None , genome_subset : Set [ str ] = None , modality_subset : Set [ str ] = None ) -> None : if data_subset is not None : for key in self . list_data ( ) : if key not in data_subset : del self . data [ key ] elif genome_subset is not None : for key in self . list_data ( ) : if self . data [ key ] . get_genome ( ) not in genome_subset : del self . data [ key ] elif modality_subset is not None : for key in self . list_data ( ) : if self . data [ key ] . get_modality ( ) not in modality_subset : del self . data [ key ] if len ( self . list_data ( ) ) == 0 : self . _selected = None self . _unidata = None elif self . _selected not in self . list_data ( ) : self . _selected = self . list_data ( ) [ 0 ] self . _unidata = self . data [ self . _selected ]
Only keep data that are in data_subset or genome_subset or modality_subset
Only keep data that are in data_subset or genome_subset or modality_subset
""" Only keep data that are in data_subset or genome_subset or modality_subset
        """
self
data_subset
Set[str]
genome_subset
Set[str]
modality_subset
Set[str]