def __init__(self, run, cancer, data_type, patients=None, drop_pc1=False, create_real_features=True, create_meta_features=True, filter_down=True, draw_figures=False): ''' ''' Dataset.__init__(self, cancer.path, data_type, compressed=True) self.df = IM.read_data(run.data_path, cancer.name, data_type, tissue_code='All') if patients is not None: self.df = self.df.ix[:, patients].dropna(axis=1, how='all') self.patients = patients else: self.patients = self.df.xs('01',1,1).columns self.global_vars = pd.DataFrame(index=self.patients) self.features = {} self.global_loadings = pd.DataFrame(index=self.df.index) self._calc_global_pcs(drop_pc1) if create_real_features is True: self._get_real_features() if create_meta_features is True: self._get_meta_features(run.gene_sets, filter_down) self.features = pd.concat(self.features) if draw_figures is True: self._creat_pathway_figures()
def __init__(self, run, cancer, data_type, patients=None, drop_pc1=False, create_real_features=True, create_meta_features=True, filter_down=True, draw_figures=False): ''' ''' Dataset.__init__(self, cancer.path, data_type, compressed=True) self.df = IM.read_data(run.data_path, cancer.name, data_type, tissue_code='All') if patients is not None: self.df = self.df.ix[:, patients].dropna(axis=1, how='all') self.patients = patients else: self.patients = self.df.xs('01', 1, 1).columns self.global_vars = pd.DataFrame(index=self.patients) self.features = {} self.global_loadings = pd.DataFrame(index=self.df.index) self._calc_global_pcs(drop_pc1) if create_real_features is True: self._get_real_features() if create_meta_features is True: self._get_meta_features(run.gene_sets, filter_down) self.features = pd.concat(self.features) if draw_figures is True: self._creat_pathway_figures()
def __init__(self, run, cancer, cn_type, patients=None): Dataset.__init__(self, cancer.path, cn_type, compressed=False) min_pat = run.parameters['min_patients'] if cn_type == 'CN_broad': self.df = get_gistic(run.data_path, cancer.name, min_patients=min_pat) if patients is not None: self.df = self.df.ix[:, patients].dropna(1, how='all') self.features = self.df
def __init__(self, run, cancer, cn_type, patients=None): ''' ''' Dataset.__init__(self, cancer.path, cn_type, compressed=False) min_pat = run.parameters['min_patients'] if cn_type == 'CN_broad': self.df = FH.get_gistic(run.data_path, cancer.name, min_patients=min_pat) if patients is not None: self.df = self.df.ix[:, patients].dropna(1, how='all') self.features = self.df
def __init__(self, run, cancer, patients=None, create_features=True, draw_figures=False): """ """ Dataset.__init__(self, cancer.path, 'Mutation', compressed=False) self.df = FH.get_mutation_matrix(run.data_path, cancer.name) if patients is not None: self.df = self.df.ix[:, patients].dropna(1, how='all') if create_features is True: min_pat = run.parameters['min_patients'] self._create_feature_matrix(run.gene_sets, min_pat) if draw_figures is True: self._create_pathway_figures(run.gene_sets)