pegasusio/unimodal_data.py
def _update_barcode_metadata_info(
        self, row: pd.Series, attributes: Set[str], append_sample_name: bool
    ) -> None:
        """ Update barcodekey, update channel and add attributes
        """
        nsample = self.barcode_metadata.shape[0]
        sample_name = row["Sample"]

        if append_sample_name:
            barcodes = [sample_name + "-" + x for x in self.barcode_metadata.index]
            self.barcode_metadata.index = pd.Index(barcodes, name="barcodekey")
            if "Channel" in self.barcode_metadata:
                self.barcode_metadata["Channel"] = [
                    sample_name + "-" + x for x in self.barcode_metadata["Channel"]
                ]

        if "Channel" not in self.barcode_metadata:
            self.barcode_metadata["Channel"] = np.repeat(sample_name, nsample)

        for attr in attributes:
            self.barcode_metadata[attr] = np.repeat(row[attr], nsample)

        self.metadata["_sample"] = sample_name
 Update barcodekey, update channel and add attributes
        
Update barcodekey, update channel and add attributes
Update barcodekey update channel and add attributes
def _update_barcode_metadata_info(
        self, row: pd.Series, attributes: Set[str], append_sample_name: bool
    ) -> None:
        nsample = self.barcode_metadata.shape[0]
        sample_name = row["Sample"]
        if append_sample_name:
            barcodes = [sample_name + "-" + x for x in self.barcode_metadata.index]
            self.barcode_metadata.index = pd.Index(barcodes, name="barcodekey")
            if "Channel" in self.barcode_metadata:
                self.barcode_metadata["Channel"] = [
                    sample_name + "-" + x for x in self.barcode_metadata["Channel"]
                ]
        if "Channel" not in self.barcode_metadata:
            self.barcode_metadata["Channel"] = np.repeat(sample_name, nsample)
        for attr in attributes:
            self.barcode_metadata[attr] = np.repeat(row[attr], nsample)
        self.metadata["_sample"] = sample_name
def _update_barcode_metadata_info ( self , row : pd . Series , attributes : Set [ str ] , append_sample_name : bool ) -> None : nsample = self . barcode_metadata . shape [ 0 ] sample_name = row [ "Sample" ] if append_sample_name : barcodes = [ sample_name + "-" + x for x in self . barcode_metadata . index ] self . barcode_metadata . index = pd . Index ( barcodes , name = "barcodekey" ) if "Channel" in self . barcode_metadata : self . barcode_metadata [ "Channel" ] = [ sample_name + "-" + x for x in self . barcode_metadata [ "Channel" ] ] if "Channel" not in self . barcode_metadata : self . barcode_metadata [ "Channel" ] = np . repeat ( sample_name , nsample ) for attr in attributes : self . barcode_metadata [ attr ] = np . repeat ( row [ attr ] , nsample ) self . metadata [ "_sample" ] = sample_name
Update barcodekey, update channel and add attributes
Update barcodekey update channel and add attributes
""" Update barcodekey, update channel and add attributes
        """
self
row
pd.Series
attributes
Set[str]
append_sample_name
bool