vt
vt copied to clipboard
protected (some) complex variants from left-trimming in normalize
This patch prevents the trimming of complex variants that are already normalized.
Example: trimming CAT -> CG
changes it to a form that is hard to analyze: AT -> G. Indeed, some tools, such as freebayes, interpret it incorrectly, while the original combination of a deletion and a SNP presents no problems.
I do not know whether the solution I present here is complete (I suspect not), but it fixes all instances of this type of error I was able to find in my data.
@selkovjr - I cannot accept this PR because:
- it would contradict the definition of normalization
- it is not practical to make exceptions so that a downstream tool will work
- It is probably a better idea for you to add an intermediate step between vt normalize and freebayes to manipulate the variants