|
417 | 417 | :reverse (protein-position pos alt-rg))
|
418 | 418 | (count alt-prot-seq*))])
|
419 | 419 | [pref-only palt-only offset _] (diff-bases pref palt)
|
| 420 | + npref (count pref) |
420 | 421 | nprefo (count pref-only)
|
421 | 422 | npalto (count palt-only)
|
422 | 423 | [unit ref-repeat alt-repeat] (repeat-info* ref-prot-seq
|
|
436 | 437 | :unknown
|
437 | 438 |
|
438 | 439 | (or (= ref-prot-rest alt-prot-rest)
|
439 |
| - (and prefer-extension-for-initial-codon-alt? |
440 |
| - (not= (first ref-prot-seq) (first alt-prot-seq*)))) |
| 440 | + (and prefer-extension-for-initial-codon-alt? |
| 441 | + (not= (first ref-prot-seq) (first alt-prot-seq*)))) |
441 | 442 | :extension
|
442 | 443 |
|
443 | 444 | :else
|
444 | 445 | :frame-shift)
|
445 |
| - (and (pos? nprefo) (= (first palt-only) \*)) :substitution |
| 446 | + (and (pos? npref) (= (first palt-only) \*)) :substitution |
446 | 447 | (not= ref-prot-rest alt-prot-rest) (cond
|
447 | 448 | (or (and (= (first alt-prot-rest) \*)
|
448 | 449 | (>= nprefo npalto)
|
|
480 | 481 | palt)})))
|
481 | 482 |
|
482 | 483 | (defn- protein-substitution
|
483 |
| - [ppos pref palt] |
| 484 | + [ppos pref palt {:keys [ref-prot-seq alt-prot-seq]}] |
484 | 485 | (let [[s-ref s-alt offset _] (diff-bases pref palt)]
|
485 |
| - (if (and (empty? s-ref) (empty? s-alt)) |
| 486 | + (cond |
| 487 | + (and (empty? s-ref) (empty? s-alt)) |
486 | 488 | (mut/protein-substitution (mut/->long-amino-acid (last pref))
|
487 | 489 | (coord/protein-coordinate ppos)
|
488 | 490 | (mut/->long-amino-acid (last palt)))
|
| 491 | + (empty? s-ref) |
| 492 | + (let [{:keys [ppos pref palt]} (get-first-diff-aa-info ppos ref-prot-seq alt-prot-seq)] |
| 493 | + (mut/protein-substitution (mut/->long-amino-acid pref) |
| 494 | + (coord/protein-coordinate ppos) |
| 495 | + (mut/->long-amino-acid palt))) |
| 496 | + :else |
489 | 497 | (mut/protein-substitution (mut/->long-amino-acid (first s-ref))
|
490 | 498 | (coord/protein-coordinate (+ ppos offset))
|
491 | 499 | (mut/->long-amino-acid (first s-alt))))))
|
|
555 | 563 | (subs (dec (+ ppos offset)))
|
556 | 564 | (string/index-of "*"))]
|
557 | 565 | (if (= alt \*)
|
558 |
| - (protein-substitution (+ ppos offset) (str ref) (str alt)) ; eventually fs-ter-substitution |
| 566 | + (protein-substitution (+ ppos offset) (str ref) (str alt) seq-info) ; eventually fs-ter-substitution |
559 | 567 | (mut/protein-frame-shift (mut/->long-amino-acid ref)
|
560 | 568 | (coord/protein-coordinate (+ ppos offset))
|
561 | 569 | (mut/->long-amino-acid alt)
|
|
662 | 670 | pvariant)
|
663 | 671 | seq-info (merge seq-info options)]
|
664 | 672 | (case (:type pvariant)
|
665 |
| - :substitution (protein-substitution ppos pref palt) |
| 673 | + :substitution (protein-substitution ppos pref palt seq-info) |
666 | 674 | :deletion (protein-deletion ppos pref palt)
|
667 | 675 | :duplication (protein-duplication ppos pref palt)
|
668 | 676 | :insertion (protein-insertion ppos pref palt seq-info)
|
|
0 commit comments