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 the 3’ rule on a trailing sub-sequence #63

Merged
merged 3 commits into from
Oct 18, 2022

Conversation

totakke
Copy link
Member

@totakke totakke commented Oct 5, 2022

I have fixed the missing consideration to the 3’ rule on a trailing sub-sequence.

The current 3’ rule of varity does not consider a trailing sub sequence. For example, {:pos 1, :ref "C", :alt "CAT"} insertion to CATA sequence (result: CATATA) is normalized to {:pos 3, :ref "T", :alt "TAT"}. In this case, however, A trails after the inserted bases which is a substring of the insertions AT, so {:pos 4, :ref "A", :alt "ATA"} insertion to CATA also returns the same result (CATATA). The fixed 3’ rule in this PR can consider the trailing sub-sequence.

This PR includes and passes #62 test cases.

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

(v2h/vcf-variant->hgvs
 {:chr "chr20", :pos 58854572, :ref "CCGCCCCAGCCGATCCCGACTCCGGGGCGGCCCCTGA", :alt "C"}
 "path/to/hg38.fa" "path/to/refGene.txt.gz" {:prefer-deletion? true})
;;=> ({:coding-dna #clj-hgvs/hgvs "NM_016592:c.*42+13738_*42+13773delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC",
;;     :protein nil}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001309861:c.-39+12749_-39+12784delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC",
;;     :protein nil}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001309883:c.1172_1207delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC",
;;     :protein #clj-hgvs/hgvs "p.P391_I402del"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_001077490:c.1172_1207delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC",
;;     :protein #clj-hgvs/hgvs "p.P391_I402del"}
;;    {:coding-dna #clj-hgvs/hgvs "NM_080425:c.1359_1394delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC",
;;     :protein #clj-hgvs/hgvs "p.S455_D466del"})

I confirmed lein test :all passed, but the answer values of some existing test cases were changed along with this fix. You need to be careful about that.

@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Merging #63 (e0106e7) into master (4e42341) will decrease coverage by 0.01%.
The diff coverage is 43.13%.

@@            Coverage Diff             @@
##           master      #63      +/-   ##
==========================================
- Coverage   45.64%   45.63%   -0.02%     
==========================================
  Files          16       16              
  Lines        1974     1992      +18     
  Branches       60       63       +3     
==========================================
+ Hits          901      909       +8     
- Misses       1013     1020       +7     
- Partials       60       63       +3     
Impacted Files Coverage Δ
src/varity/vcf_to_hgvs/protein.clj 27.66% <0.00%> (-0.49%) ⬇️
src/varity/vcf_to_hgvs/common.clj 65.83% <68.75%> (+0.06%) ⬆️

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

@totakke totakke mentioned this pull request Oct 6, 2022
"chr2" 26254257 "G" "GACT" '("NM_000183:c.4_6dupACT"
"NM_001281512:c.4_6dupACT"
"NM_001281513:c.-146_-144dupACT") ; cf. rs3839049 (+)
"chr2" 47806844 "T" "TGATT" '("NM_000179:c.4068_4071dupGATT"
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix the VCF variant and HGVS for rs55740729.

"NM_001190274:c.*1272_*1275dupTCAA") ; cf. rs55740729 (+)
"chr2" 26254257 "G" "GACT" '("NM_000183:c.5_7dupCTA"
"NM_001281512:c.5_7dupCTA"
"NM_001281513:c.-145_-143dupCTA") ; cf. rs3839049 (+)
Copy link
Member Author

Choose a reason for hiding this comment

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

c.5_7dup and c.-145_-143dup correspond to rs3839049.

"NM_001309861:c.-39+12749_-39+12784delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC"
"NM_001309883:c.1172_1207delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC"
"NM_001077490:c.1172_1207delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC"
"NM_080425:c.1359_1394delCGACTCCGGGGCGGCCCCTGACGCCCCAGCCGATCC")
Copy link
Member Author

Choose a reason for hiding this comment

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

migrated from #62, but the order is fixed.

@@ -235,6 +241,8 @@
;; prefer-deletion?, not actual example (+)
"chr1" 47439008 "CCCGCAC" "C" {:prefer-deletion? false} '("p.P286_H287[3]")
"chr1" 47439008 "CCCGCAC" "C" {:prefer-deletion? true} '("p.P292_H293del")
"chr20" 58854572 "CCGCCCCAGCCGATCCCGACTCCGGGGCGGCCCCTGA" "C" {:prefer-deletion? true}
'("p.P391_I402del" "p.S455_D466del")
Copy link
Member Author

Choose a reason for hiding this comment

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

migrated from #62, but missing p.P391_I402del is added.

@totakke totakke marked this pull request as ready for review October 13, 2022 05:41
Copy link
Contributor

@nokara26 nokara26 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! LGTM👍🏻

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 🙆‍♂️

@federkasten federkasten merged commit a4660be into master Oct 18, 2022
@federkasten federkasten deleted the fix/subsequence-3rule branch October 18, 2022 13:09
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.

None yet

3 participants