Skip to content

Commit f58a6f3

Browse files
committed
Document special END tag handling in bcf_update_info()
1 parent 88a588a commit f58a6f3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

htslib/vcf.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,14 @@ set to one of BCF_ERR* codes and must be checked before calling bcf_write().
789789
* The @p string in bcf_update_info_flag() is optional,
790790
* @p n indicates whether the flag is set or removed.
791791
*
792+
* Note that updating an END info tag will cause line->rlen to be
793+
* updated as a side-effect (removing the tag will set it to the
794+
* string length of the REF allele). If line->pos is being changed as
795+
* well, it is important that this is done before calling
796+
* bcf_update_info_int32() to update the END tag, otherwise rlen will be
797+
* set incorrectly. If the new END value is less than or equal to
798+
* line->pos, a warning will be printed and line->rlen will be set to
799+
* the length of the REF allele.
792800
*/
793801
#define bcf_update_info_int32(hdr,line,key,values,n) bcf_update_info((hdr),(line),(key),(values),(n),BCF_HT_INT)
794802
#define bcf_update_info_float(hdr,line,key,values,n) bcf_update_info((hdr),(line),(key),(values),(n),BCF_HT_REAL)

0 commit comments

Comments
 (0)