Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frameshift conversion failure #59

Merged
merged 2 commits into from
Aug 16, 2022
Merged

Fix frameshift conversion failure #59

merged 2 commits into from
Aug 16, 2022

Conversation

totakke
Copy link
Member

@totakke totakke commented Aug 12, 2022

fixes #58

(require '[varity.vcf-to-hgvs :as v2h])

(v2h/vcf-variant->hgvs {:chr "chr5", :pos 112175534, :ref "AGTGGCAT", :alt "A"}
                        "path/to/hg19.fa" "path/to/refGene.txt.gz")
;;=> ({:coding-dna #clj-hgvs/hgvs "NM_001127511:c.4190_4196delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1397Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001127510:c.4244_4250delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1415Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354897:c.4274_4280delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1425Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354896:c.4298_4304delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1433Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354906:c.3395_3401delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1132Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354895:c.4244_4250delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1415Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354905:c.3764_3770delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1255Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354903:c.3941_3947delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1314Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354902:c.3971_3977delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1324Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354901:c.4067_4073delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1356Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354900:c.4121_4127delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1374Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354904:c.3866_3872delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1289Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354899:c.4160_4166delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1387Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001354898:c.4169_4175delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1390Ifs*2"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_000038:c.4244_4250delGTGGCAT",
;;     :protein #clj-hgvs/hgvs "p.S1415Ifs*2"})

I confirmed lein test :all passed.

@codecov
Copy link

codecov bot commented Aug 12, 2022

Codecov Report

Merging #59 (ef5b988) into master (b6bc691) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
- Coverage   45.65%   45.63%   -0.03%     
==========================================
  Files          16       16              
  Lines        1969     1970       +1     
  Branches       60       60              
==========================================
  Hits          899      899              
- Misses       1010     1011       +1     
  Partials       60       60              
Impacted Files Coverage Δ
src/varity/vcf_to_hgvs/protein.clj 28.15% <0.00%> (-0.09%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

(= palt (subs pref 0 (count palt))))
(= (last palt-only) \*))
:fs-ter-substitution
:frame-shift)
Copy link
Member Author

@totakke totakke Aug 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fs-ter-subsitution detection added by #15 is insufficient because varity.vcf-to-hgvs.common/diff-bases considers right-side commons as well as left-side commons. In this case,

(require '[varity.vcf-to-hgvs.common :refer [diff-bases]])

(diff-bases "SGI" "I")
;;=> ["SG" "" 0 1] ; [pref-only palt-only offset _]

So (empty? palt-only) cannot detect frameshift in the changed proteins and wrongly detect it as fs-ter-substitution. A direct comparison between pref and palt is needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean :fs-ter-substitution had been correct for (diff-bases "SGI" "S") but not for (diff-bases "SGI" "I")?

Copy link
Member Author

@totakke totakke Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. If the ref proteins ...SGIXXXX... change into the alt proteins ...S*YYYY..., that is substitution of G and *, not frameshift.

In #58 case, the ref proteins ...SGIXXXX... change into the alt proteins ...I*YYYY.... That is frameshift caused by the change of SGI to I. The previous implementation using diff-bases result wrongly detect it as substitution because the alt protein I correspondes to the right-side of the ref proteins SGI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. That makes sense!

@@ -205,6 +205,8 @@
"chr1" 69567 "A" "AT" '("p.L160Sfs*7")
"chr1" 963222 "GCG" "G" '("p.A386Gfs*12")
"chr2" 47478341 "T" "TGG" '("p.L762Gfs*2" "p.L696Gfs*2")
"chr5" 112839837 "AGTGGCAT" "A" '("p.S1397Ifs*2"
"p.S1415Ifs*2") ; https://github.com/chrovis/varity/issues/58
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A conversion case of #58 on hg38 assembly.

Copy link
Member

@federkasten federkasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your quick investigation and fix.

Copy link
Contributor

@k-kom k-kom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix and explanation. LGTM

@k-kom k-kom merged commit e75733e into master Aug 16, 2022
@k-kom k-kom deleted the fix/fs-ter-substitution branch August 16, 2022 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vcf-variants->hgvs omits trailing fs*
3 participants