python/pymethylprocess/PreProcessDataTypes.py
def format_geo(self, disease_class_column="methylation class:ch1", include_columns={}):
        """Format clinical sheets if downloaded geo idats.

        Parameters
        ----------
        disease_class_column
            Disease column of clinical info csv.
        include_columns
            Dictionary specifying other columns to include, and new names to assign them to."""
        idats = glob.glob("{}/*.idat".format(self.idat_dir))
        idat_basenames = np.unique(np.vectorize(lambda x: basename(x).replace('_Grn.idat','').replace('_Red.idat',''))(idats)) # '_'.join(x.split('/')[-1].split('_')[:3])
        idat_geo_map = dict(zip(np.vectorize(lambda x: basename(x).split('_')[0])(idat_basenames),np.array(idat_basenames)))
        self.pheno_sheet['Basename'] = self.pheno_sheet['geo_accession'].map(idat_geo_map)
        self.pheno_sheet = self.pheno_sheet[self.pheno_sheet['Basename'].isin(idat_basenames)]
        self.pheno_sheet.loc[:,'Basename'] = self.pheno_sheet['Basename'].map(lambda x: self.idat_dir+x)
        col_dict = {'geo_accession':'AccNum',disease_class_column:'disease'}
        col_dict.update(include_columns)
        self.pheno_sheet = self.pheno_sheet[['Basename', 'geo_accession',disease_class_column]+(list(include_columns.keys()) if include_columns else [])].rename(columns=col_dict)
Format clinical sheets if downloaded geo idats.

        Parameters
        ----------
        disease_class_column
            Disease column of clinical info csv.
        include_columns
            Dictionary specifying other columns to include, and new names to assign them to.
Format clinical sheets if downloaded geo idats.
Parameters

disease_class_column
Disease column of clinical info csv.
include_columns
Dictionary specifying other columns to include, and new names to assign them to.
Format clinical sheets if downloaded geo idats . Parameters disease_class_column Disease column of clinical info csv . include_columns Dictionary specifying other columns to include and new names to assign them to .
def format_geo(self, disease_class_column="methylation class:ch1", include_columns={}):
        idats = glob.glob("{}/*.idat".format(self.idat_dir))
        idat_basenames = np.unique(np.vectorize(lambda x: basename(x).replace('_Grn.idat','').replace('_Red.idat',''))(idats)) 
        idat_geo_map = dict(zip(np.vectorize(lambda x: basename(x).split('_')[0])(idat_basenames),np.array(idat_basenames)))
        self.pheno_sheet['Basename'] = self.pheno_sheet['geo_accession'].map(idat_geo_map)
        self.pheno_sheet = self.pheno_sheet[self.pheno_sheet['Basename'].isin(idat_basenames)]
        self.pheno_sheet.loc[:,'Basename'] = self.pheno_sheet['Basename'].map(lambda x: self.idat_dir+x)
        col_dict = {'geo_accession':'AccNum',disease_class_column:'disease'}
        col_dict.update(include_columns)
        self.pheno_sheet = self.pheno_sheet[['Basename', 'geo_accession',disease_class_column]+(list(include_columns.keys()) if include_columns else [])].rename(columns=col_dict)
def format_geo ( self , disease_class_column = "methylation class:ch1" , include_columns = { } ) : idats = glob . glob ( "{}/*.idat" . format ( self . idat_dir ) ) idat_basenames = np . unique ( np . vectorize ( lambda x : basename ( x ) . replace ( '_Grn.idat' , '' ) . replace ( '_Red.idat' , '' ) ) ( idats ) ) idat_geo_map = dict ( zip ( np . vectorize ( lambda x : basename ( x ) . split ( '_' ) [ 0 ] ) ( idat_basenames ) , np . array ( idat_basenames ) ) ) self . pheno_sheet [ 'Basename' ] = self . pheno_sheet [ 'geo_accession' ] . map ( idat_geo_map ) self . pheno_sheet = self . pheno_sheet [ self . pheno_sheet [ 'Basename' ] . isin ( idat_basenames ) ] self . pheno_sheet . loc [ : , 'Basename' ] = self . pheno_sheet [ 'Basename' ] . map ( lambda x : self . idat_dir + x ) col_dict = { 'geo_accession' : 'AccNum' , disease_class_column : 'disease' } col_dict . update ( include_columns ) self . pheno_sheet = self . pheno_sheet [ [ 'Basename' , 'geo_accession' , disease_class_column ] + ( list ( include_columns . keys ( ) ) if include_columns else [ ] ) ] . rename ( columns = col_dict )
Format clinical sheets if downloaded geo idats.
Format clinical sheets if downloaded geo idats .
"""Format clinical sheets if downloaded geo idats.

        Parameters
        ----------
        disease_class_column
            Disease column of clinical info csv.
        include_columns
            Dictionary specifying other columns to include, and new names to assign them to.""" # '_'.join(x.split('/')[-1].split('_')[:3])
self
disease_class_column
include_columns