1. Modified vcf_parse to update rlen only when an END INFO tag is seen -

Issue: https://github.com/broadinstitute/gamgee/issues/191
1. Modified vcf_parse to update rlen only when an END INFO tag is seen -the END tag is NOT encoded into v->shared.s
2. Modified vcf_write to add END INFO tag if required

What we told Joel was that if a record has only 1 ALT allele and it is
<NON-REF> or <X> then it is a reference block.
If the record has more than 1 ALT allele it can still be a NON-reference
"block".  But in that case it would need to have a different symbolic
allele (the presence of <NON-REF> or <X> in this case is meaningless).
Does that help?


On Tue, Sep 9, 2014 at 3:18 PM, Mauricio Carneiro <notifications@github.com>
wrote:

> In vcf.c:
>
> > @@ -1993,6 +2002,12 @@ int vcf_format(const bcf_hdr_t *h, const bcf1_t *v, kstring_t *s)
> >  {
> >      int i;
> >      bcf_unpack((bcf1_t*)v, BCF_UN_ALL);
> > +    //2 alleles, first is REF and 2nd is NON_REF and rlen > 1, update END tag in INFO
> > +    if(v->n_allele == 2 &&  v->rlen > 1 && (strcmp(v->d.allele[1], "<NON_REF>") == 0))
>
> Can we get @eitanbanks <https://github.com/eitanbanks> and @rpopoin in
> this tread as well? I am concerned that there could also be plain "blocks"
> that are not necessarily reference blocks and our assumptions would fail
> then. Is it possible for a structural variant to use the <NON-REF> allele
> but also other alleles to represent a block in the VCF spec? God this would
> all be so much easier if Ellen was actually a field in the VCF file and we
> didn't have this END info field.
> … <#1485bda4ed49cb23_>
> On Tuesday, September 9, 2014, jmthibault79 <notifications@github.com>
> wrote: In vcf.c: > @@ -1993,6 +2002,12 @@ int vcf_format(const bcf_hdr_t
> *h, const bcf1_t *v, kstring_t *s) > { > int i; > bcf_unpack((bcf1_t*)v,
> BCF_UN_ALL); > + //2 alleles, first is REF and 2nd is NON_REF and rlen > 1,
> update END tag in INFO > + if(v->n_allele == 2 && v->rlen > 1 &&
> (strcmp(v->d.allele[1], "<NON_REF>") == 0)) That would be pretty cool,
> yeah. Actually I see that is already handled as VCF_OTHER in
> vcf.c:bcf_set_variant_type(), interesting. Not sure if that suits us or if
> VCF_NON_REF is needed. Probably better to split this off into a separate
> issue anyway. — Reply to this email directly or view it on GitHub <
> https://github.com/broadinstitute/htslib/pull/5/files#r17319289>.
>  -- Mauricio Carneiro, Ph.D. http://www.broadinstitute.org/~carneiro/
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/broadinstitute/htslib/pull/5/files#r17321488>.
>