Commit 80825945 authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.cpp: CDR3aa, better translation for out-of-frame CDR3

All full codons aligned with the J germline gene are translated according to this frame.
parent d0c3b05a
......@@ -1059,7 +1059,20 @@ void FineSegmenter::findCDR3(){
CDR3end = JUNCTIONend - 3;
CDR3nuc = subsequence(getSequence().sequence, CDR3start, CDR3end);
CDR3aa = nuc_to_aa(CDR3nuc);
if (CDR3nuc.length() % 3 == 0)
{
CDR3aa = nuc_to_aa(CDR3nuc);
}
else
{
// start of codon fully included in the germline J
int CDR3startJfull = (CDR3end + 3) - ((J_118_offset / 3) * 3) + 1;
CDR3aa =
nuc_to_aa(subsequence(getSequence().sequence, CDR3start, CDR3startJfull-1)) +
nuc_to_aa(subsequence(getSequence().sequence, CDR3startJfull, CDR3end));
}
JUNCTIONaa = nuc_to_aa(subsequence(getSequence().sequence, JUNCTIONstart, CDR3start-1))
+ CDR3aa + nuc_to_aa(subsequence(getSequence().sequence, CDR3end+1, JUNCTIONend));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment