hasindu2008 / slow5lib

slow5lib is a software library for reading & writing SLOW5 files.
https://hasindu2008.github.io/slow5lib
MIT License
41 stars 4 forks source link

Pywrite #58

Closed Psy-Fer closed 2 years ago

Psy-Fer commented 2 years ago

Adding slow5 write capability within the python library

F = slow5.Open('test.slow5','w')
# fill in empty header dictionary with values
header = F.get_empty_header()
...
# then write it to the file
ret = F.write_header(header)

# for each read in some set of reads, write to slow5
for read in reads:
    # get empty record dictionary to populate with data
    record = F.get_empty_record()
    ...
    # write record
    ret = F.write_record(record)
    ...

# close to write EOF
F.close()