From cd04bdd410f0c09d6bd286299e37b9e249ae4689 Mon Sep 17 00:00:00 2001 From: Luca Denti Date: Thu, 30 Apr 2020 18:24:11 +0200 Subject: [PATCH] Skip variants close to reference sequence ends --- var_block.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/var_block.hpp b/var_block.hpp index 5f8e719..ade4ab8 100644 --- a/var_block.hpp +++ b/var_block.hpp @@ -74,7 +74,11 @@ class VB { Variant *v = &variants[v_index]; - if (!v->is_present) { + if (!v->is_present || v->ref_pos < k || v->ref_pos > (int)reference.size() - k) { + // Here we could use k/2 but with k the probability to not + // exceed the reference length due to insertions is + // higher. Anyway, it shouldn't be common to have variants + // near to reference ends kmers[v_index] = _kmers; continue; }