Example #1
0
    def do_analysis(self):
        """
        Generator that performs the analysis. Uses data from the files within the folder that was given at runtime.
        Currently, only GWAS is supported.

        :return: loads all files from the folder given at runtime, parses data with the load_data function, returns the
        results of the analysis with this data
        """
        app_output_list = sorted(checkList(getList(self.args_dict['folder'])))
        for each in app_output_list:
            if self.args_dict['beta'] is not None:
                if self.args_dict['covar'] is not None:
                    score_column, beta_column, covar_column = self.load_data(each)
                else:
                    score_column, beta_column = self.load_data(each)
                    covar_column = None
            else:
                if self.args_dict['covar'] is not None:
                    score_column, covar_column = self.load_data(each)
                    beta_column = None
                else:
                    score_column = self.load_data(each)
                    beta_column = None
                    covar_column = None
            if self.args_dict['analysis'] == 'GWAS':
                yield self.do_gwas(score_column, beta_column, covar_column)
            else:
                # Add other analysis methods here
                print 'Currently, only GWAS is supported.'
Example #2
0
    def do_analysis(self):
        """
        Generator that performs the analysis. Uses data from the files within the folder that was given at runtime.
        Currently, only GWAS is supported.

        :return: loads all files from the folder given at runtime, parses data with the load_data function, returns the
        results of the analysis with this data
        """
        app_output_list = sorted(checkList(getList(self.args_dict['folder'])))
        for each in app_output_list:
            if self.args_dict['beta'] is not None:
                if self.args_dict['covar'] is not None:
                    score_column, beta_column, covar_column = self.load_data(
                        each)
                else:
                    score_column, beta_column = self.load_data(each)
                    covar_column = None
            else:
                if self.args_dict['covar'] is not None:
                    score_column, covar_column = self.load_data(each)
                    beta_column = None
                else:
                    score_column = self.load_data(each)
                    beta_column = None
                    covar_column = None
            if self.args_dict['analysis'] == 'GWAS':
                yield self.do_gwas(each, score_column, beta_column,
                                   covar_column)
            else:
                # Add other analysis methods here
                print 'Currently, only GWAS is supported.'
Example #3
0
    def load_ote(self):
        """
        Loads only truth and effect type known truth file.

        :return: sets the instance list variables snp_true_false and beta_true_false with data from the known truth file
        given at runtime, separated by the given delimiter
        """
        app_output_list = checkList(getList(self.args_dict['folder']))
        kt_file = loadKT(self.args_dict['truth'], self.args_dict['kt_type_separ'])
        acquired_data = loadFile(self.args_dict['folder'], app_output_list[0], self.args_dict['separ'])
        snp_column = data_to_list(acquired_data, 1, acquired_data.header.index(self.args_dict['snp']))
        kt_snps = data_to_list(kt_file, 1, 0)
        kt_betas = data_to_list(kt_file, 1, 1)
        for each in snp_column:
            self.snp_true_false.append(trueFalse(each, kt_snps))
        self.load_ote_betas(snp_column, kt_snps, kt_betas)
Example #4
0
    def load_ote(self):
        """
        Loads only truth and effect type known truth file.

        :return: sets the instance list variables snp_true_false and beta_true_false with data from the known truth file
        given at runtime, separated by the given delimiter
        """
        app_output_list = sorted(checkList(getList(self.args_dict['folder'])))
        acquired_data = loadFile(self.args_dict['folder'], app_output_list[0],
                                 self.args_dict['separ'])
        kt_file = loadKT(self.args_dict['truth'],
                         self.args_dict['kt_type_separ'])
        snp_column = data_to_list(
            acquired_data, 1,
            acquired_data.header.index(self.args_dict['snp']))
        kt_snps = data_to_list(kt_file, 1, 0)
        kt_betas = data_to_list(kt_file, 1, 1)
        for each in snp_column:
            self.snp_true_false.append(trueFalse(each, kt_snps))
        self.load_ote_betas(snp_column, kt_snps, kt_betas)