Skip to content

Commit

Permalink
added more tests for indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
SooLee committed Apr 10, 2017
1 parent 290d2b5 commit 6c06e97
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Binary file modified samples/SRR1171591.variants.snp.vqsr.p.vcf.gz.px2
Binary file not shown.
Binary file modified samples/merged_nodup.tab.chrblock_sorted.txt.gz.px2
Binary file not shown.
Binary file not shown.
10 changes: 9 additions & 1 deletion test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,22 @@ def test_build_index_without_force(self):
pypairix.build_index(TEST_FILE_2D_4DN)
self.assertEqual(error.exception.message, "The index file exists. Please use force=1 to overwrite.")

def test_build_index_with_force(self):
def test_build_index_with_force(self): ## recognizing file extension pairs.gz
pypairix.build_index(TEST_FILE_2D_4DN, force=1)
pr = pypairix.open(TEST_FILE_2D_4DN)
query = '{}:{}-{}|{}:{}-{}'.format(self.chrom, self.start, self.end, self.chrom2, self.start2, self.end2)
it = pr.querys2D(query)
pr_result = build_it_result(it, self.f_type)
self.assertEqual(self.result, pr_result)

def test_build_index_with_force_merged_nodups(self): ## recognizing preset merged_nodups
pypairix.build_index(TEST_FILE_2D_SPACE, "merged_nodups", force=1)

def test_build_index_with_force_merged_nodups_tab(self): ## recognizing custom set
pypairix.build_index(TEST_FILE_2D, sc=2, bc=3, ec=3, sc2=6, bc2=7, ec2=7, force=1)

def test_build_index_with_force_vcf(self): ## recognizing file extension vcf.gz
pypairix.build_index(TEST_FILE_1D, force=1)


if __name__ == '__main__':
Expand Down

0 comments on commit 6c06e97

Please sign in to comment.