hasindu2008/slow5lib

Check header attribute values and record values before writing to slow5 file

hiruna72 opened this issue · 2 comments

Along with the API integration I have removed https://github.com/hasindu2008/slow5/blob/460c22f9eff2b6162f7162b8ab5867b2300605db/src/read_fast5.c#L935 which used slow5_old.h's structs to confirm the attribute values were set correctly before writing to slow5 file.

We should check attribute values before writing. I can amend check_attributes() to do that. I assume @sashajenner can do the same thing inside slow5_hdr_fwrite and slow5_rec_fwrite functions which will not cost an extra iteration over the attributes.

What do you think?

Do we need to check before writing? Or is it better before setting the values? How was check_attributes checking the attribute values were set correctly?

Well it is about whether a certain attribute field has a value. For example, in some fast5s 'median before' is not found. If 'median_before' is added to the struct slow5_aux_meta but slow5_rec_set() is not used to set it, later the conversion to blow5 fails. In slow5_old implementation there were default values for all the attributes.