jackh726 / bigtools

A high-performance BigWig and BigBed library in Rust
MIT License
66 stars 5 forks source link

pybigtools bigbed write appears to store chrom as "rest" #54

Open nvictus opened 1 day ago

nvictus commented 1 day ago
import pybigtools as pbt

f = pbt.open("/tmp/foo.bb", "w")
f.write(
    {"chr1": 1000, "chr2": 1000}, 
    [
        ("chr1", 0, 100, "foo\tbar\t3"), 
        ("chr2", 100, 200, "xxx\tyyy\t1.0"),
        ("chr2", 200, 300, "zzz\twww\t1.0")
    ]
)
f.close()

f = pbt.open("/tmp/foo.bb", "r")
list(f.records("chr2"))
[(100, 200, 'chr2'), (200, 300, 'chr2')]
print(f.sql())
table bed3
"Simple bed"
(
    string chrom;        "Reference sequence chromosome or scaffold"
    uint   chromStart;   "Start position in chromosome"
    uint   chromEnd;     "End position in chromosome"
)
jackh726 commented 1 day ago

Uh, that's weird.