Add an option to `observedMutations` to always report stop mutations

Issue #153 new
ssnn created an issue

Add an option to observedMutations to always report mutations to stop codons. Add an additional column to the returned values, named like mu_count_seq_ptc (ptc: premature termination codon).

User feature request:

Add an option to count the mutations that might lead to a stop codon. Alternatively, only if a stop codon is actually obtained, then the mutation that leads to it will not be counted by the function.

observedMutations calls calcObservedMutations and mutationType. The current behaviour of mutationType is:

# Stop codons:
> shazam:::AMINO_ACIDS[shazam:::AMINO_ACIDS == "*"]
TAA TAG TGA 
"*" "*" "*" 

## Example: 2 mutations: CAG -> TAC
# |- #1: TAG, is a stop codon, not reported
# |- #2: CAC, translates to H, replacement mutation counted
# In this case, can't know for sure the order of the mutations.
# If the order is CAG -> CAC -> TAC, the stop codon doesn't happen.
> shazam:::mutationType("CAG", "TAC")
   r    s stop   na 
   1    0    0    0 
> observedMutations(data.frame(
+     "sequence_alignment"="TAC",
+     "germline_alignment_d_mask"="CAG"
+ ))
  sequence_alignment germline_alignment_d_mask mu_count_seq_r mu_count_seq_s
1                TAC                       CAG              1              0

## Example: 1 mutation: CAG -> TAG
# |- #1: TAG, is a stop codon, and is reported
> shazam:::mutationType("CAG", "TAG")
   r    s stop   na 
   0    0    1    0

> observedMutations(data.frame(
+     "sequence_alignment"="TAG",
+     "germline_alignment_d_mask"="CAG"
+ ))
  sequence_alignment germline_alignment_d_mask mu_count_seq_r mu_count_seq_s
1                TAG                       CAG              0              0

Comments (0)

  1. Log in to comment