Skip to content

Commit

Permalink
Add test for autosql when writing big bed
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh726 committed Nov 30, 2024
1 parent 8e88e8d commit 306a697
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pybigtools/tests/test_bigwig.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,24 @@ def test_bigbed_write(tmpdir):
("chr1", 0, 100, "foo\tbar\t3"),
("chr2", 100, 200, "xxx\tyyy\t1.0"),
("chr2", 200, 300, "zzz\twww\t1.0")
]
],
autosql="""\
table bed3
"Simple bed"
(
string chrom; "Reference sequence chromosome or scaffold"
uint chromStart; "Start position in chromosome"
uint chromEnd; "End position in chromosome"
)
"""
)
f.close()

f = pybigtools.open(os.path.join(tmpdir, "test.bigBed"))
records = list(f.records("chr2"))
assert records[0][2] == 'xxx'
sql = f.sql()
assert sql.startswith("table")

# TODO: bigWigAverageOverBed
# TODO: bigWigMerge

0 comments on commit 306a697

Please sign in to comment.