示例#1
0
def findQhullModule(modname):
    """return (platform-dependent) path to qhull module"""

    if modname not in ['qconvex', 'qdelaunay', 'qhalf', 'qhull',
                       'qvoronoi', 'rbox']:
        print 'QHULL ERROR! Illegal module name %s.'%modname
        return None
    try:
        mod = __import__('binaries')
        pth = mod.__path__[0]
    except ImportError:
        pth = ''

    pth = os.path.join( pth, modname)

    if which(pth):
        #print pth
        return pth
    else:
        #print 'QHULL ERROR! Module not found in %s'%pth
        return None
示例#2
0
def findQhullModule(modname):
    """return (platform-dependent) path to qhull module"""

    if modname not in [
            'qconvex', 'qdelaunay', 'qhalf', 'qhull', 'qvoronoi', 'rbox'
    ]:
        print 'QHULL ERROR! Illegal module name %s.' % modname
        return None
    try:
        mod = __import__('binaries')
        pth = mod.__path__[0]
    except ImportError:
        pth = ''

    pth = os.path.join(pth, modname)

    if which(pth):
        #print pth
        return pth
    else:
        #print 'QHULL ERROR! Module not found in %s'%pth
        return None
    def getBlenderDir(self):
        if self.plateform.find("linux") != -1:
            dir=self.findDirectoryFrom(".blender",self.userDirectory+"/",sp=".*")
            if len(dir) == 0 :
                x = askdirectory(initialdir=self.userDirectory, title="where is blender script directory, ie .blender/script")
                dir = x#self.softdir[2]
            else :
                dir = dir[0]
            dir = dir.replace(" ","\ ")
            self.dir[0].set(dir)
            self.softdir[0] = dir
        elif self.plateform == 'darwin':
            dir=self.findDirectoryFrom("blender",self.progDirectory+"/")
            if len(dir) == 0 :
                x = askdirectory(initialdir=self.userDirectory, title="where is blender script directory, ie .blender/script")
                dir = x#self.softdir[2]
                self.dir[0].set(dir)
                self.softdir[0] = dir
            elif len(dir) == 1 :
                dir = dir[0]
                dir = dir.replace(" ","\ ")
                self.dir[0].set(dir)
                self.softdir[0] = dir
            else :
                self.chooseDirectory(0,dir)
        elif self.plateform == 'win32':
            #blender can be in Prgoram files or Application Data
            #dir=self.findDirectoryFrom("Blender Foundation",self.progDirectory)
            #if len(dir) == 0 :
            dir=self.findDirectoryFrom("Blender Foundation",self.preferencesDir)
            if len(dir) == 0 :
                x = askdirectory(initialdir=self.userDirectory, title="where is the Blender Foundation directory")
                dir = x
                self.dir[0].set(dir)
                self.softdir[0] = dir     
            elif len(dir) == 1 :
                dir = dir[0]
#                dir = dir+os.sep+"Blender"+os.sep+".blender"+os.sep
                self.dir[0].set(dir)
                self.softdir[0] = dir
            else :
                self.chooseDirectory(0,dir)
        if self.automaticSearch :
            t1=time.time()
            self.progressbar.setLabelText('searching '+".blender")
            #is blender define in path
            dir=packageFilePath.which('blender')
            if dir == None :
                dir=self.findDirectory(".blender",self.progDirectory)
                if dir is None :
                    dir=self.findDirectory(".blender",self.userDirectory)
                    if dir is None :
                    #dir=self.findDirectory(".blender",self.rootDirectory)
                    #if dir is None:
                        dir="not Found"
                        return 
            print "time to find", time.time()-t1
            print dir
            dir = dir.replace(" ","\ ")
            self.dir[0].set(dir)
            self.softdir[0] = dir
#$Id: msmsClient.py,v 1.3 2008/12/23 00:29:19 sargis Exp $
#
# Authors: M. Sanner and S. Dallakyan

import socket
import subprocess
import numpy
import struct
from mglutil.util.packageFilePath import getBinary, which
try:
    msmsBinary = getBinary('msms','binaries')
except:
    msmsBinary = None

if not msmsBinary: #msms not found in binaries
    msmsBinary = which('msms')

msmsBinary = None #(un)comment this line to (not) use msmsClient instead of mslib 
class MSMSClient:    
    def __init__(self, coords=None, radii=None, **kw):
        
        self.coords = coords
        self.radii = radii        
        soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        port = 2000
        #find a free port
        result = soc.connect_ex(('', port))
        while not result:
            port += 1
            result = soc.connect_ex(('', port))
            soc.close()
示例#5
0
    def __init__(self, name='Default', **kw):
        """Constructor for class APBSParams"""
        from mglutil.util.packageFilePath import getBinary, findFilePath, which
        if not hasattr(self,'APBS_Path'):
            try:
                self.APBS_Path = getBinary("apbs", 'binaries')
            except ImportError:
                self.APBS_Path = None
            if not self.APBS_Path:
                self.APBS_Path = which('apbs')
                 
        self.pdb2pqr_Path = findFilePath('pdb2pqr.py','MolKit.pdb2pqr')
        self.name = name    # name of the APBS Param instance
        
        self.pdb2pqr_ForceField = 'amber'
        self.calculationType = 'Electrostatic potential'
        self.pbeType = 'Linearized'
        self.boundaryConditions = 'Single Debye-Huckel'
        self.chargeDiscretization = 'Cubic B-spline'
        self.surfaceCalculation = 'Cubic B-spline'
        self.sdens = 10.0
        self.splineWindow = 0.3
        self.molecule1Path = ''
        self.molecule2Path = ''
        self.complexPath = ''
        self.energyOutput = 'Total'
        self.forceOutput = ''
        self.projectFolder = 'apbs-project'
        self.chargeDistributionFile = ''
        self.potentialFile = 'OpenDX'
        self.solventAccessibilityFile = ''
        self.splineBasedAccessibilityFile = ''
        self.VDWAccessibilityFile = ''
        self.ionAccessibilityFile = ''
        self.laplacianOfPotentialFile = ''
        self.energyDensityFile = ''
        self.ionNumberFile = ''
        self.ionChargeDensityFile = ''
        self.xShiftedDielectricFile = ''
        self.yShiftedDielectricFile = ''
        self.zShiftedDielectricFile = ''
        self.kappaFunctionFile = ''

        #Grid parameters
        self.gridPointsX = 65
        self.gridPointsY = 65
        self.gridPointsZ = 65
        self.coarseLengthX = 40
        self.coarseLengthY = 50
        self.coarseLengthZ = 60
        self.coarseCenterX = 0
        self.coarseCenterY = 0
        self.coarseCenterZ = 0
        self.fineLengthX = 20
        self.fineLengthY = 35
        self.fineLengthZ = 30
        self.fineCenterX = 0
        self.fineCenterY = 0
        self.fineCenterZ = 0

        # Physical Parameters
        self.proteinDielectric = 2.0
        self.solventDielectric = 78.54
        self.solventRadius = 1.4
        self.systemTemperature = 298.15
        self.saltConcentration = 0.01
        self.ions = []

        apply( self.Set, (), kw )
示例#6
0
#$Id: msmsClient.py,v 1.3 2008/12/23 00:29:19 sargis Exp $
#
# Authors: M. Sanner and S. Dallakyan

import socket
import subprocess
import numpy
import struct
from mglutil.util.packageFilePath import getBinary, which
try:
    msmsBinary = getBinary('msms', 'binaries')
except:
    msmsBinary = None

if not msmsBinary:  #msms not found in binaries
    msmsBinary = which('msms')

msmsBinary = None  #(un)comment this line to (not) use msmsClient instead of mslib


class MSMSClient:
    def __init__(self, coords=None, radii=None, **kw):

        self.coords = coords
        self.radii = radii
        soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        port = 2000
        #find a free port
        result = soc.connect_ex(('', port))
        while not result:
            port += 1
示例#7
0
    def __init__(self, name='Default', **kw):
        """Constructor for class APBSParams"""
        from mglutil.util.packageFilePath import getBinary, findFilePath, which
        if not hasattr(self,'APBS_Path'):
            try:
                self.APBS_Path = getBinary("apbs", 'binaries')
            except ImportError:
                self.APBS_Path = None
            if not self.APBS_Path:
                self.APBS_Path = which('apbs')
                 
        self.pdb2pqr_Path = findFilePath('pdb2pqr.py','MolKit.pdb2pqr')
        self.name = name    # name of the APBS Param instance
        
        self.pdb2pqr_ForceField = 'amber'
        self.calculationType = 'Electrostatic potential'
        self.pbeType = 'Linearized'
        self.boundaryConditions = 'Single Debye-Huckel'
        self.chargeDiscretization = 'Cubic B-spline'
        self.surfaceCalculation = 'Cubic B-spline'
        self.sdens = 10.0
        self.splineWindow = 0.3
        self.molecule1Path = ''
        self.molecule2Path = ''
        self.complexPath = ''
        self.energyOutput = 'Total'
        self.forceOutput = ''
        self.projectFolder = 'apbs-project'
        self.chargeDistributionFile = ''
        self.potentialFile = 'OpenDX'
        self.solventAccessibilityFile = ''
        self.splineBasedAccessibilityFile = ''
        self.VDWAccessibilityFile = ''
        self.ionAccessibilityFile = ''
        self.laplacianOfPotentialFile = ''
        self.energyDensityFile = ''
        self.ionNumberFile = ''
        self.ionChargeDensityFile = ''
        self.xShiftedDielectricFile = ''
        self.yShiftedDielectricFile = ''
        self.zShiftedDielectricFile = ''
        self.kappaFunctionFile = ''

        #Grid parameters
        self.gridPointsX = 65
        self.gridPointsY = 65
        self.gridPointsZ = 65
        self.coarseLengthX = 40
        self.coarseLengthY = 50
        self.coarseLengthZ = 60
        self.coarseCenterX = 0
        self.coarseCenterY = 0
        self.coarseCenterZ = 0
        self.fineLengthX = 20
        self.fineLengthY = 35
        self.fineLengthZ = 30
        self.fineCenterX = 0
        self.fineCenterY = 0
        self.fineCenterZ = 0

        # Physical Parameters
        self.proteinDielectric = 2.0
        self.solventDielectric = 78.54
        self.solventRadius = 1.4
        self.systemTemperature = 298.15
        self.saltConcentration = 0.01
        self.ions = []

        apply( self.Set, (), kw )