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

python: get_header_names() #34

Closed Psy-Fer closed 3 years ago

Psy-Fer commented 3 years ago

get all header names and dump to user as list.

Then use slow5_hdr_get() to get values

BLOCKER: need C API to access keys in hashmap Something like: slow5_hdr_names(uint32_t read_group, const slow5_hdr_t *header); Return something I can parse into a python list on the other end. @hasindu2008

Psy-Fer commented 3 years ago

Looked at the closed issues, and it looks like @hiruna72 and I think the same. Eposing something like slow5_extract_hdr() will do the trick

hasindu2008 commented 3 years ago

Use the following function

//get the list of hdr data keys in sorted order (only the returned pointer must be freed, not the ones inside - subjet to change)
//len is the numberof elements
//returns null if no attributes
const char **slow5_get_hdr_keys(const slow5_hdr_t *header,uint64_t *len);
Psy-Fer commented 3 years ago

Yep this works. Cheers