def test_permutation_all(self): """performs permutation test of Hybrid, but considers all stats""" s = ("ATCGTTGGGACCGGTTCAAGTTTTGGAACTCGCAAGGGGTGAATGGTCTTCGTCTAACGCTGG" "GGAACCCTGAATCGTTGTAACGCTGGGGTCTTTAACCGTTCTAATTTAACGCTGGGGGGTTCT" "AATTTTTAACCGCGGAATTGCGTC") seq_to_symbol = SeqToSymbols(self.motifs, length=len(s)) hybrid_calc = Hybrid(len(s), period=4, return_all=True) stat, p = blockwise_bootstrap(s, hybrid_calc, block_size=10, num_reps=1000, seq_to_symbols=seq_to_symbol)
def test_permutation(self): s = ( "ATCGTTGGGACCGGTTCAAGTTTTGGAACTCGCAAGGGGTGAATGGTCTTCGTCTAACGCTGG" "GGAACCCTGAATCGTTGTAACGCTGGGGTCTTTAACCGTTCTAATTTAACGCTGGGGGGTTCT" "AATTTTTAACCGCGGAATTGCGTC" ) seq_to_symbol = SeqToSymbols(self.motifs, length=len(s)) hybrid_calc = Hybrid(len(s), llim=2, period=4) ipdft_calc = Ipdft(len(s), llim=2, period=4) stat, p = blockwise_bootstrap( s, hybrid_calc, block_size=10, num_reps=1000, seq_to_symbols=seq_to_symbol ) stat, p = blockwise_bootstrap( s, ipdft_calc, block_size=10, num_reps=1000, seq_to_symbols=seq_to_symbol )
def test_get_num_stats(self): """calculators should return correct num stats""" hybrid_calc = Hybrid(150, llim=2, period=4) ipdft_calc = Ipdft(150, llim=2, period=4) autocorr_calc = AutoCorrelation(150, llim=2, period=4) self.assertEqual(hybrid_calc.getNumStats(), 1) self.assertEqual(ipdft_calc.getNumStats(), 1) self.assertEqual(autocorr_calc.getNumStats(), 1) hybrid_calc = Hybrid(150, llim=2, period=4, return_all=True) self.assertEqual(hybrid_calc.getNumStats(), 3)