-
Notifications
You must be signed in to change notification settings - Fork 2
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 substitution for nonsense variant #113
Merged
+16
−7
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -417,6 +417,7 @@ | |
:reverse (protein-position pos alt-rg)) | ||
(count alt-prot-seq*))]) | ||
[pref-only palt-only offset _] (diff-bases pref palt) | ||
npref (count pref) | ||
nprefo (count pref-only) | ||
npalto (count palt-only) | ||
[unit ref-repeat alt-repeat] (repeat-info* ref-prot-seq | ||
|
@@ -436,13 +437,13 @@ | |
:unknown | ||
|
||
(or (= ref-prot-rest alt-prot-rest) | ||
(and prefer-extension-for-initial-codon-alt? | ||
(not= (first ref-prot-seq) (first alt-prot-seq*)))) | ||
(and prefer-extension-for-initial-codon-alt? | ||
(not= (first ref-prot-seq) (first alt-prot-seq*)))) | ||
:extension | ||
|
||
:else | ||
:frame-shift) | ||
(and (pos? nprefo) (= (first palt-only) \*)) :substitution | ||
(and (pos? npref) (= (first palt-only) \*)) :substitution | ||
(not= ref-prot-rest alt-prot-rest) (cond | ||
(or (and (= (first alt-prot-rest) \*) | ||
(>= nprefo npalto) | ||
|
@@ -480,12 +481,19 @@ | |
palt)}))) | ||
|
||
(defn- protein-substitution | ||
[ppos pref palt] | ||
[ppos pref palt {:keys [ref-prot-seq alt-prot-seq]}] | ||
(let [[s-ref s-alt offset _] (diff-bases pref palt)] | ||
(if (and (empty? s-ref) (empty? s-alt)) | ||
(cond | ||
(and (empty? s-ref) (empty? s-alt)) | ||
(mut/protein-substitution (mut/->long-amino-acid (last pref)) | ||
(coord/protein-coordinate ppos) | ||
(mut/->long-amino-acid (last palt))) | ||
(empty? s-ref) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s-ref is empty in a case like |
||
(let [{:keys [ppos pref palt]} (get-first-diff-aa-info ppos ref-prot-seq alt-prot-seq)] | ||
(mut/protein-substitution (mut/->long-amino-acid pref) | ||
(coord/protein-coordinate ppos) | ||
(mut/->long-amino-acid palt))) | ||
:else | ||
(mut/protein-substitution (mut/->long-amino-acid (first s-ref)) | ||
(coord/protein-coordinate (+ ppos offset)) | ||
(mut/->long-amino-acid (first s-alt)))))) | ||
|
@@ -555,7 +563,7 @@ | |
(subs (dec (+ ppos offset))) | ||
(string/index-of "*"))] | ||
(if (= alt \*) | ||
(protein-substitution (+ ppos offset) (str ref) (str alt)) ; eventually fs-ter-substitution | ||
(protein-substitution (+ ppos offset) (str ref) (str alt) seq-info) ; eventually fs-ter-substitution | ||
(mut/protein-frame-shift (mut/->long-amino-acid ref) | ||
(coord/protein-coordinate (+ ppos offset)) | ||
(mut/->long-amino-acid alt) | ||
|
@@ -662,7 +670,7 @@ | |
pvariant) | ||
seq-info (merge seq-info options)] | ||
(case (:type pvariant) | ||
:substitution (protein-substitution ppos pref palt) | ||
:substitution (protein-substitution ppos pref palt seq-info) | ||
:deletion (protein-deletion ppos pref palt) | ||
:duplication (protein-duplication ppos pref palt) | ||
:insertion (protein-insertion ppos pref palt seq-info) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return false in a case like
pref Y
andpalt *Y
.So I change
nprefo
tonpref
.