Repository navigation
Commit e31a444
TreeConstruction: Add 'skip_letters' parameter to DistanceCalculator (biopython#491)
When scoring with a distance matrix other than 'identity', the gap and
stop characters '-' and '*' are skipped & not counted toward the total
score. With the 'identity' model, the default for DistanceCalculator,
these characters are retained and compared. That's potentially
surprising, so this patch exposes the 'skip_letters' keyword argument in
the constructor so that the scoring/skipping behavior can be changed for
any model.
In a future release, it would be better to set the default value of
skip_letters=('-', '*') and have 'identity' use this default value like
the other models do. For now, we'll leave a shim for backward
compatibility.1 parent 3b930da commit e31a444
1 file changed
Lines changed: 14 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
| 404 | + | |
405 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
406 | 414 | | |
407 | 415 | | |
408 | 416 | | |
| |||
426 | 434 | | |
427 | 435 | | |
428 | 436 | | |
429 | | - | |
430 | 437 | | |
431 | 438 | | |
432 | 439 | | |
433 | | - | |
| 440 | + | |
434 | 441 | | |
435 | 442 | | |
436 | 443 | | |
| |||
445 | 452 | | |
446 | 453 | | |
447 | 454 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
453 | 459 | | |
454 | | - | |
455 | 460 | | |
456 | 461 | | |
457 | 462 | | |
| |||
0 commit comments