lgatto/synapter — pull request #57 by sgibb (2014-04-28 21:11:07+00:00)
Title: emulate PLGS' peptide cleavage; close #53

Dear Laurent,

this PR abuses `cleaver`s new `custom` argument to introduce a bug into `synapter` to emulate the peptide cleavage method of PLGS. :worried:

Changes:
- Ignore the default `cleaver` trypsin cleavage rules (we also ignore the exceptions) from http://web.expasy.org/peptide_cutter/peptidecutter_enzymes.html#Tryps and replace them by PLGS' rules.
- The argument `missedCleavages` is now considered as maximal number of mis-cleavages (before it was possible to allow `c(0,1,5)` mis-cleavages. This case is now treated as `5`).

The new rules in a (hopefully) human readable format:

1. We cleave after every K or R that is *not* followed by P (default
trypsin rule), or D, E, K, R (PLGS rule) [no mis-cleavages allowed].
2. Subsequently we count the consecutive K or R in each peptide and
consider these numbers as maximal possible mis-cleavages to get
every peptide of interest.
3. We compare the numbers from 2. with the user-defined threshold
"missedCleavages" and only allow 0 to min(number from 2., user-defined
threshold).
4. We cleave the results from 1. after every K or R that is *not* followed by P (default
trypsin rule) and allow maximal `n` mis-cleavages. `n` is determined in 3.

Best wishes,

Sebastian

P.S.:
```s
library("fortunes")
fortune(228)
```
```
R is Open Source and so you can modify it to emulate the bugs in other software:
that is not one of the aims of its developers
so please don't expect us to do so for you.
-- Brian D. Ripley (answering a request for a change to Excel-like non IEC 60559
standard conform rounding)
R-help (March 2009)
```