Beispiel #1
0
    def test_linreg(self):
        logging.info("TestSingleSnpLinReg test_linreg")
        test_snps = Bed(self.bedbase, count_A1=False)
        pheno = self.phen_fn
        covar = self.cov_fn

        output_file = self.file_name("linreg")

        frame1 = single_snp_linreg(test_snps=test_snps[:, :10],
                                   pheno=pheno,
                                   covar=covar,
                                   output_file_name=output_file,
                                   count_A1=False)

        frame1 = frame1[[
            'sid_index', 'SNP', 'Chr', 'GenDist', 'ChrPos', 'PValue'
        ]]
        self.compare_files(frame1, "linreg")

        frame2 = single_snp_linreg(test_snps=test_snps[:, :10],
                                   pheno=pheno,
                                   covar=covar,
                                   output_file_name=output_file,
                                   count_A1=False)
        self.compare_files(frame2, "linreg")
Beispiel #2
0
    def test_linreg(self):
        logging.info("TestSingleSnp test_linreg")
        test_snps = Bed(self.bedbase)
        pheno = self.phen_fn
        covar = self.cov_fn

        output_file = self.file_name("linreg")

        frame1 = single_snp(test_snps=test_snps[:, :10],
                            pheno=pheno,
                            mixing=0,
                            leave_out_one_chrom=False,
                            G0=KernelIdentity(iid=test_snps.iid),
                            covar=covar,
                            output_file_name=output_file)

        frame1 = frame1[[
            'sid_index', 'SNP', 'Chr', 'GenDist', 'ChrPos', 'PValue'
        ]]
        self.compare_files(frame1, "linreg")

        frame2 = single_snp_linreg(test_snps=test_snps[:, :10],
                                   pheno=pheno,
                                   covar=covar,
                                   output_file_name=output_file)
        self.compare_files(frame2, "linreg")
Beispiel #3
0
 def top_snps_for_each_fold_nested(kfold_item):
     fold_index, (train_idx, test_idx) = kfold_item
     _, G_in, pheno_in, covar_in = _fixup(test_snps, G, pheno, covar)
     nested = single_snp_linreg(G_in[train_idx, :],
                                pheno_in[train_idx, :],
                                covar_in[train_idx, :],
                                GB_goal=GB_goal,
                                max_output_len=max(k_list_in))
     return nested
    def test_linreg(self):
        logging.info("TestSingleSnpLinReg test_linreg")
        test_snps = Bed(self.bedbase)
        pheno = self.phen_fn
        covar = self.cov_fn

        output_file = self.file_name("linreg")

        frame1 = single_snp_linreg(test_snps=test_snps[:,:10], pheno=pheno,
                                    covar=covar, 
                                    output_file_name=output_file
                                    )

        frame1 = frame1[['sid_index', 'SNP', 'Chr', 'GenDist', 'ChrPos', 'PValue']]
        self.compare_files(frame1,"linreg")

        frame2 = single_snp_linreg(test_snps=test_snps[:,:10], pheno=pheno, 
                                    covar=covar, 
                                    output_file_name=output_file
                                    )
        self.compare_files(frame2,"linreg")
    def test_linreg(self):
        logging.info("TestSingleSnp test_linreg")
        test_snps = Bed(self.bedbase, count_A1=False)
        pheno = self.phen_fn
        covar = self.cov_fn

        output_file = self.file_name("linreg")

        frame1 = single_snp(test_snps=test_snps[:,:10], pheno=pheno, mixing=0,leave_out_one_chrom=False,
                                    G0=KernelIdentity(iid=test_snps.iid), covar=covar, 
                                    output_file_name=output_file,count_A1=False
                                    )

        frame1 = frame1[['sid_index', 'SNP', 'Chr', 'GenDist', 'ChrPos', 'PValue']]
        self.compare_files(frame1,"linreg")

        frame2 = single_snp_linreg(test_snps=test_snps[:,:10], pheno=pheno, 
                                    covar=covar, 
                                    output_file_name=output_file
                                    )
        self.compare_files(frame2,"linreg")
 def top_snps_for_each_fold_nested(kfold_item):
     fold_index, (train_idx, test_idx) = kfold_item
     _, G_in, pheno_in, covar_in = _fixup(test_snps, G, pheno, covar,count_A1=count_A1)
     nested = single_snp_linreg(G_in[train_idx,:],pheno_in[train_idx,:],covar_in[train_idx,:],GB_goal=GB_goal,max_output_len=max(k_list_in),count_A1=count_A1)
     return nested