File: density_image.py

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 239,924 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; javascript: 164; makefile: 88
file content (31 lines) | stat: -rw-r--r-- 1,242 bytes parent folder | download | duplicates (9)
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
pdb = "/local/amoll/scheidig/Strukturbilder_2006_21_03_06/data/p14/p14_50_1.pdb"
density = "/local/amoll/scheidig/Strukturbilder_2006_21_03_06/data/p14/1fofc_p14_50.omap"
#pdb = "/big/incoming/p14/p14_50_1.pdb"
#density = "/big/incoming/p14/1fofc_p14_50.omap"
# color of mesh: red, green, blue
color = ColorRGBA(1., 0, 0)
# value for isosurface
value = 0.7
distance = 1.7

getDisplayProperties().enableCreationForNewMolecules(0)
openFile(pdb)
getMolecularControl().applySelector("residueID(17) OR residueID(33-36) OR residueID(60-66) OR residueID(200)")

grid = getDatasetControl().addDSN6Grid(density)
getDatasetControl().computeIsoContourSurface(grid, color, value)
if len(getRepresentations()) == 0:
	getMainControl().setStatusbarText("No surface could be generated for given value", 1)
	abortScript()

modify_dialog = ModifyRepresentationDialog.getInstance(0)
cs = getRepresentations()[len(getRepresentations()) - 1]
modify_dialog.setRepresentation(cs)
modify_dialog.setSplitRadius(distance)
modify_dialog.applySplit()
reps = getRepresentations()
nr = len(getRepresentations())
reps[nr - 2].setHidden(true)
reps[nr - 1].setDrawingMode(DRAWING_MODE_WIREFRAME)
reps[nr - 1].setTransparency(120)
getMainControl().redrawAllRepresentations(1)