Ejemplo n.º 1
0
    def test_one(self):
        logging.info("TestEpistasis test_one")
        from pysnptools.snpreader import Bed
        test_snps = Bed(self.bedbase, count_A1=False)
        pheno = self.phen_fn
        covar = self.cov_fn

        output_file = self.file_name("one")
        frame = epistasis(
            test_snps,
            pheno,
            G0=test_snps,
            covar=covar,
            sid_list_0=test_snps.sid[:10],  #first 10 snps
            sid_list_1=test_snps.sid[5:15],  #Skip 5 snps, use next 10
            output_file_name=output_file,
            count_A1=False)
        sid0, sid1, pvalue_list = np.array(frame['SNP0']), np.array(
            frame['SNP1']), np.array(frame['PValue'])

        #Check the output file
        self.compare_files(sid0, sid1, pvalue_list, "one")

        #Check the values returned
        output_file2 = self.file_name("one_again")
        write(sid0, sid1, pvalue_list, output_file2)
        self.compare_files(sid0, sid1, pvalue_list, "one")
Ejemplo n.º 2
0
    def test_no_sid_list_1(self):
        logging.info("TestEpistasis test_no_sid_list_1")
        from pysnptools.snpreader import Bed
        test_snps = Bed(self.bedbase)
        pheno = self.phen_fn
        covar = self.cov_fn

        output_file = self.file_name("no_sid_list_1")
        frame = epistasis(test_snps, pheno, G0=test_snps, 
                                  covar=covar, 
                                  sid_list_1=['1_4']
                                  )

        sid0,sid1,pvalue_list =np.array(frame['SNP0']),np.array(frame['SNP1']),np.array(frame['PValue'])
        write(sid0,sid1,pvalue_list,output_file)        
        self.compare_files(sid1,sid0,pvalue_list,"no_sid_list_0") #Swap order of sid0 and sid1
Ejemplo n.º 3
0
    def test_one(self):
        logging.info("TestEpistasis test_one")
        from pysnptools.snpreader import Bed
        test_snps = Bed(self.bedbase)
        pheno = self.phen_fn
        covar = self.cov_fn

        output_file = self.file_name("one")
        frame = epistasis(test_snps, pheno, G0=test_snps, 
                                  covar=covar, 
                                  sid_list_0=test_snps.sid[:10], #first 10 snps
                                  sid_list_1=test_snps.sid[5:15], #Skip 5 snps, use next 10
                                  output_file_name=output_file
                                  )
        sid0,sid1,pvalue_list =np.array(frame['SNP0']),np.array(frame['SNP1']),np.array(frame['PValue'])


        #Check the output file
        self.compare_files(sid0,sid1,pvalue_list,"one")

        #Check the values returned
        output_file2 = self.file_name("one_again")
        write(sid0,sid1,pvalue_list,output_file2)
        self.compare_files(sid0,sid1,pvalue_list,"one")