-
Notifications
You must be signed in to change notification settings - Fork 0
/
10_06_BRAIN.Rmd
60 lines (44 loc) · 2.64 KB
/
10_06_BRAIN.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
### BRAIN
**Baffling Recursive Algorithm for Isotope distributioN calculations**
R BRAIN is an isotopic abundance calculator implemented in R programming language and is especially useful for chemists and researchers who deal with complex molecules and need to calculate their isotopic composition accurately. In addition, it has a handy function for calculating the mass directly from an amino acid sequence.
\
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ![](images/05.png){height="68"} | [Bioconductor](https://bioconductor.org/packages/release/bioc/manuals/BRAIN/man/BRAIN.pdf) |
| | |
| | *Dittwald, Piotr, et al. "BRAIN: a universal tool for high-throughput calculations of the isotopic distribution for mass spectrometry." Analytical chemistry 85.4 (2013): 1991-1994.* |
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
\
#### Installation {-}
```{r, eval=FALSE}
BiocManager::install("BRAIN")
```
#### Useage {-}
```{r, message=FALSE, warning=FALSE}
library(BRAIN)
# Human insulin amino acid sequence
str_seq <- "MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN"
# get a list-object of atoms
lst_atm <- getAtomsFromSeq(str_seq)
```
Calculate the average mass.
```{r}
calculateAverageMass(lst_atm)
```
Calculate the monoisotopic mass.
```{r}
calculateMonoisotopicMass(lst_atm)
```
Calculate the isotopic abundances (probabilities) mass.
```{r, fig.width=6, fig.height=3, fig.align='center'}
lst_isotopes <- useBRAIN(lst_atm, nrPeaks = 20)
plot(lst_isotopes$masses, lst_isotopes$isoDistr, xlab='Mass', ylab='Probability', type = 'h')
```
Calculate the isotopic abundances (probabilities) mass for a metabolite [C100H200S2Cl5].
```{r, fig.width=6, fig.height=3, fig.align='center'}
lst_atm <- list(C=100, H=200, S=2, Cl=5)
lst_isotopes <- useBRAIN(lst_atm, nrPeaks = 13)
plot(x = lst_isotopes$masses,
y = lst_isotopes$isoDistr / max(lst_isotopes$isoDistr) * 100,
xlab='Mass', ylab='Relative abundance', type = 'h')
```
---