             output->new_entry(id);
             auto& chromosome = output->get_sequence(id);
 
-            // note: VCF positions are 1-based, but we convert to 0-based
-            chromosome.feature_start.push_back(record.alignment_start() - 1);
-            chromosome.feature_stop.push_back(record.alignment_stop() - 1);
+            chromosome.feature_start.push_back(data->pos);
+            chromosome.feature_stop.push_back(data->pos + data->rlen - 1);
         }
     }
 

 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <gamgee/variant/variant_reader.h>

#include <string>

#include "../command_line.h"
#include "reference.h"


    if (!loaded)
    {
        htsFile *fp;
        bcf_hdr_t *bcf_header;
        bcf1_t *data;

        fp = bcf_open(filename, "r");
        if (fp == NULL)
        {
            fprintf(stderr, "error opening %s\n", filename);
            return false;
        }

        bcf_header = bcf_hdr_read(fp);
        bcf_hdr_set_samples(bcf_header, nullptr, 0);

        // build a list of chromosomes in the header
        std::vector<std::string> chromosomes;
        for(int32 i = 0; i < bcf_header->nhrec; i++)
        {
            bcf_hrec_t *r = bcf_header->hrec[i];

            if (r->type == BCF_HL_CTG)
            {
                chromosomes.push_back(*r->vals);
            }
        }

        data = bcf_init();

        for(;;)
        {
            // read the next thing
            int ret;
            ret = bcf_read(fp, bcf_header, data);

            if (ret == -1)
            {
                break;
            }

            // "unpack" up to ALT inclusive
            bcf_unpack(data, BCF_UN_STR);

            // grab the data we need
            uint32 chromosome_id = data->rid;
            const std::string& chromosome_name = chromosomes[chromosome_id];
            reference_handle->make_sequence_available(chromosome_name);

            uint32 id = reference_handle->sequence_data.sequence_names.lookup(chromosome_name);
