Commit d3152db1 authored by Harrison Green's avatar Harrison Green
Browse files

reset

parent 0b5a2a23
This diff is collapsed.
%% Cell type:code id: tags:
``` python
import openbabel
import pybel
import numpy as np
```
%% Cell type:code id: tags:
``` python
%load_ext autoreload
%autoreload 2
```
%% Cell type:code id: tags:
``` python
!ls ../data/docked_dude/aa2ar/actives_final_docked_vina.sdf
```
%% Output
../data/docked_dude/aa2ar/actives_final_docked_vina.sdf
%% Cell type:code id: tags:
``` python
actives = [x for x in pybel.readfile('sdf', '../data/docked_dude/aa2ar/actives_final_docked_vina.sdf')]
```
%% Cell type:code id: tags:
``` python
cooh = pybel.Smarts('[CX3](=O)[OX2H1]')
```
%% Cell type:code id: tags:
``` python
for a in range(len(actives)):
t = cooh.findall(actives[a])
if t != []:
print a
```
%% Output
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
2761
2762
2763
2764
2765
2766
2767
2768
2769
4768
4769
4770
4771
4772
4773
4774
4775
4776
%% Cell type:code id: tags:
``` python
a = actives[1762]
t = cooh.findall(a)
[x.GetIdx() for x in openbabel.OBAtomAtomIter(a.atoms[39].OBAtom)]
```
%% Output
[38]
%% Cell type:code id: tags:
``` python
a.atoms[0].coords
```
%% Output
(-12.131, -9.114, 61.917)
%% Cell type:code id: tags:
``` python
a.atoms[3].idx
```
%% Output
4
%% Cell type:code id: tags:
``` python
x = (1,2,3,4)
```
%% Cell type:code id: tags:
``` python
np.array(x[:3])
```
%% Output
array([1, 2, 3])
%% Cell type:code id: tags:
``` python
import grid
```
%% Cell type:code id: tags:
``` python
atoms = [(0,2,2,0), (0,2,2,1)]
radii = [2, 5]
center = [0,2,2]
width = 24
resolution = 0.5
```
%% Cell type:code id: tags:
``` python
g = grid.generate_grid_cpu(atoms, radii, center, width, resolution)
```
%% Cell type:code id: tags:
``` python
g.shape
```
%% Output
(48, 48, 48, 2)
%% Cell type:code id: tags:
``` python
a = [1,-2,3]
```
%% Cell type:code id: tags:
``` python
a < [0,0,0]
```
%% Output
False
%% Cell type:code id: tags:
``` python
import mol
```
%% Cell type:code id: tags:
``` python
m = mol.Mol.from_pybel(a,)
```
%% Cell type:code id: tags:
``` python
len(m.atoms)
```
%% Output
40
%% Cell type:code id: tags:
``` python