Issue Summary:
Inconsistency in formatting a floating-point tag value when using sam_parse1 function from htslib.
Description:
I encountered an inconsistency while using the sam_parse1 function from htslib to convert a kstring_t obtained from minimap2 into a bam1_t structure. The original tag value "de:f:0.0530" was modified to "de:f:0.053" after the conversion.
Steps to Reproduce:
Run minimap2 to obtain alignment results.
Extract the alignment information into a kstring_t structure.
Use sam_parse1 function from htslib to convert the kstring_t into a bam1_t structure.
Retrieve the tag value associated with the "de:f" tag from the resulting bam1_t structure.
Expected Behavior:
The tag value "de:f:0.0530" should be preserved without any modification during the conversion process.
Actual Behavior:
The tag value "de:f:0.0530" is modified to "de:f:0.053" after the conversion.
We store a floating point number not a fixed point one. The value is stored not the formatting of that value. The final zero is meaningless for that stored value.
Issue Summary: Inconsistency in formatting a floating-point tag value when using sam_parse1 function from htslib.
Description: I encountered an inconsistency while using the sam_parse1 function from htslib to convert a kstring_t obtained from minimap2 into a bam1_t structure. The original tag value "de:f:0.0530" was modified to "de:f:0.053" after the conversion.
Steps to Reproduce:
Run minimap2 to obtain alignment results. Extract the alignment information into a kstring_t structure. Use sam_parse1 function from htslib to convert the kstring_t into a bam1_t structure. Retrieve the tag value associated with the "de:f" tag from the resulting bam1_t structure. Expected Behavior: The tag value "de:f:0.0530" should be preserved without any modification during the conversion process.
Actual Behavior: The tag value "de:f:0.0530" is modified to "de:f:0.053" after the conversion.
minimap2 result:
after use sam_parse1 write to bam1_t, result: