Commit ba9a03f
committed
Fix iVar deletion convention: POS is the anchor before the gap
iVar reports a deletion at the reference base immediately BEFORE the deleted
sequence: POS is that anchor, REF is the base at POS, and ALT='-<bases>' lists
the bases deleted starting at POS+1 (andersen-lab/ivar issue #86 and the iVar
manual; this is also what nf-core/viralrecon's ivar_variants_to_vcf.py assumes).
normalize_ivar_allele instead treated POS as the first deleted base: it read the
deleted bases from reference[POS..POS+len] and anchored at POS-1. On real iVar
output this rejected every deletion as a FASTA mismatch (or, in a homopolymer,
silently shifted it one base left).
Read the deleted bases from reference[POS+1..] and anchor at POS, producing the
VCF allele (POS, REF=anchor+deleted, ALT=anchor) - symmetric with the insertion
branch, which already anchors at POS. Updates the unit test and the iVar
deletion scenario to real iVar inputs; the emitted DEL:31:G frameshift row is
unchanged, only the input notation (POS 30 anchor instead of 31).
252 lib + 37 integration + 9 doc tests; clippy -D warnings, fmt, 36 scenarios pass.1 parent 455baff commit ba9a03f
2 files changed
Lines changed: 27 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
198 | | - | |
199 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
200 | 206 | | |
201 | 207 | | |
202 | 208 | | |
203 | 209 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 210 | + | |
| 211 | + | |
216 | 212 | | |
217 | 213 | | |
218 | 214 | | |
| |||
401 | 397 | | |
402 | 398 | | |
403 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
404 | 403 | | |
405 | 404 | | |
406 | | - | |
| 405 | + | |
407 | 406 | | |
408 | 407 | | |
409 | 408 | | |
410 | 409 | | |
411 | 410 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
415 | 414 | | |
416 | 415 | | |
417 | 416 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1223 | 1223 | | |
1224 | 1224 | | |
1225 | 1225 | | |
1226 | | - | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1227 | 1229 | | |
1228 | 1230 | | |
1229 | | - | |
| 1231 | + | |
1230 | 1232 | | |
1231 | 1233 | | |
1232 | 1234 | | |
| |||
1238 | 1240 | | |
1239 | 1241 | | |
1240 | 1242 | | |
1241 | | - | |
| 1243 | + | |
1242 | 1244 | | |
1243 | 1245 | | |
1244 | 1246 | | |
| |||
0 commit comments