```
In [1]:
```%matplotlib inline
import numpy as np
import bomeba0 as bmb
import matplotlib.pyplot as plt

```
In [2]:
```prot = bmb.Protein('GAG')

A protein object has several attributes for example we can retrieve the sequence

```
In [3]:
```prot.sequence

```
Out[3]:
```

or the cartesian coordinates as a (N, 3) numpy array

```
In [4]:
```prot.coords

```
Out[4]:
```

We can also compute the energy of our protein. At the moment the energy is computed in vacuum, with a very simple force-field that only includes a Lenard-Jones term:

$$LJ_{ij} = \epsilon \left [ \left (\frac{\sigma_{ij}}{r_{ij}} \right)^{12} - 2 \left (\frac{\sigma_{ij}}{r_{ij}} \right)^{6} \right]$$$\sigma_{ij}$ is the distance at which the potential reaches its minimum

$\epsilon_{ij}$ is the depth of the potential well

$r_{ij}$ is the distance between the atoms

Only five atoms types are considered (C, H, O, N, S), the parameters are loosely based on the general purpose force field GAFF

```
In [5]:
```prot.energy()

```
Out[5]:
```

```
In [6]:
```prot.rgyr()

```
Out[6]:
```

```
In [7]:
```len(prot)

```
Out[7]:
```

A `protein`

object is an iterable object made of `aminoacids`

:

```
In [8]:
```for res in prot:
print(res)

```
```

```
In [9]:
```CA_0 = prot[0]['CA']
CA_1 = prot[1]['CA']

Passing 'CA' has the same effect as passing 1, because the 'CA' atom is also the atom 1 ('N' is 0)

```
In [10]:
```CA_0 == prot[0][1]

```
Out[10]:
```

```
In [11]:
```prot[0]['bb']

```
Out[11]:
```

We can use the coordinates we extract to compute, for example, distances:

```
In [12]:
```bmb.utils.dist(CA_0, CA_1)

```
Out[12]:
```

```
In [13]:
```prot.get_torsionals(sidechain=False)

```
Out[13]:
```

and we can also change them!

```
In [14]:
```prot.set_phi(1, -60)
prot.set_psi(1, -40)
prot.get_torsionals(sidechain=False)

```
Out[14]:
```

and we can plot a minimalistic (one-point) ramachadran!

```
In [15]:
```bmb.plot_ramachandran(prot);

```
```

We can also initialize a protein object from a pdb file at the moment

```
In [16]:
```pdb = bmb.Protein(pdb='../pdbs/1ubq.pdb')
pdb

```
Out[16]:
```

```
In [17]:
```pdb.coords

```
Out[17]:
```

```
In [18]:
```bmb.plot_ramachandran(pdb)

```
Out[18]:
```

```
In [19]:
```plt.plot(pdb.bfactors);

```
```

```
In [20]:
```a = pdb[0]['N']
b = pdb[10]['CA']
c = pdb[20]['O']
d = pdb[30]['N']
bmb.utils.get_torsional(a, b, c, d) * bmb.constants.radians_to_degrees

```
Out[20]:
```

`radians_to_degrees`

to get the result in the *more familiar* degrees.

```
In [21]:
```pdb.view3d()

```
```