-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmolAdaptor.py
101 lines (81 loc) · 2.9 KB
/
molAdaptor.py
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
"""
Copyright (C) <2010> Autin L.
This file ePMV_git/molAdaptor.py is part of ePMV.
ePMV is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ePMV is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ePMV. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 12 14:06:41 2011
@author: -
"""
class aGeom:
def __init__(self,name=None,vertices=None,faces=None,
normals=None,colors=None,pov = None):
self.name = name
self.vertices = vertices
self.faces = faces
self.colors = colors
self.normals = normals
self.pov = pov
def Set(name=None,vertices=None,faces=None,normals=None,colors=None,pov =None):
if name is not None :
self.name = name
if vertices is not None :
self.vertices = vertices
if faces is not None :
self.faces = faces
if colors is not None :
self.colors = colors
if normals is not None :
self.normals = normals
if pov is not None :
self.pov = pov
class molAdaptor:
"""
The general pymol adaptor.
from ePMV.PyMol.pymolAdaptor import pymolAdaptor
pym = pymolAdaptor(debug=1)
mol = pym.readMolecule("/Users/ludo/blenderKTF/1CRN.pdb")
geom = pym.displayExtrudedSS(mol)#cartoon pym.cmd.show_as("cartoon",mol)
#create a polygon and color it
selection :/object-name/segi-identifier/chain-identifier/resi-identifier/name-identifier
...
"""
def __init__(self,debug=0):
#look for PYMOL_PATH
self.start_engine()
self.Mols = {}
self.cmd = None
self.molengine = self.start_engine()
self.debug = debug
self.viewmat = None#numpy.array(self.cmd.get_view(quiet=1))
def start_engine(self,):
pass
def Load(self,filename,name):
pass
def readMolecule(self,filename,name=None):
if name is None :
name = filename.split('/')[-1].split('.')[0]
self.Load(filename,name)
self.Mols[name]={}
return name
def displayExtrudedSS(self,name,fancyH=True,color=""):
#color "ss"
#self.cmd.hide("all")
geom = None
return geom
def get_povray(self):
return None
def get_view(self):
return None
def parsePOVmesh2(self,name,rep="cartoon"):
return None