本文整理汇总了Python中XSDataMXv1.XSDataSampleCrystalMM.getCrystal方法的典型用法代码示例。如果您正苦于以下问题:Python XSDataSampleCrystalMM.getCrystal方法的具体用法?Python XSDataSampleCrystalMM.getCrystal怎么用?Python XSDataSampleCrystalMM.getCrystal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XSDataMXv1.XSDataSampleCrystalMM
的用法示例。
在下文中一共展示了XSDataSampleCrystalMM.getCrystal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EDPluginControlStrategyv10
# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import getCrystal [as 别名]
class EDPluginControlStrategyv10(EDPluginControl):
"""
The Plugin that controls the strategy step
"""
def __init__ (self):
EDPluginControl.__init__(self)
self.__strPluginRaddoseName = "EDPluginRaddosev10"
self.__oedPluginRaddose = None
self.__oedHandlerXSDataRaddose = None
self.__strPluginBestName = "EDPluginBestv10"
self.__edPluginBest = None
self.__edHandlerXSDataBest = None
self.__strCONF_SYMOP_HOME = "symopHome"
# Default value for the location of the symop table
self.__strSymopHome = "/opt/pxsoft/ccp4-6.0.2/lib/data"
self.__xsDataSampleCopy = None
# For default chemical composition
self.__fAverageAminoAcidVolume = 135.49
self.__fAverageCrystalSolventContent = 0.47
self.__fAverageSulfurContentPerAminoacid = 0.05
self.__fAverageSulfurConcentration = 314
self.setXSDataInputClass(XSDataStrategyInput)
def setSymopHome(self, _strSymopHome):
self.__strSymopHome = _strSymopHome
def getSymopHome(self):
return self.__strSymopHome
def preProcess(self, _edObject=None):
"""
Gets the Configuration Parameters, if found, overrides default parameters
"""
EDPluginControl.preProcess(self, _edObject)
EDVerbose.DEBUG("EDPluginControlStrategyv10.preProcess...")
self.__edPluginRaddose = None
xsDataSampleCrystalMM = self.getDataInput().getSample()
if(xsDataSampleCrystalMM is None):
self.__xsDataSampleCopy = XSDataSampleCrystalMM()
else:
strXmlStringDataSample = xsDataSampleCrystalMM.marshal()
self.__xsDataSampleCopy = XSDataSampleCrystalMM.parseString(strXmlStringDataSample)
xsDataCrystal = self.getDataInput().getCrystalRefined()
if(xsDataCrystal is not None):
self.__xsDataSampleCopy.setCrystal(xsDataCrystal)
# Raddose is enabled only if the beam flux is set
if(self.getDataInput().getExperimentalCondition().getBeam().getFlux() is None):
warningMessage = EDMessage.WARNING_CANNOT_USE_PLUGIN_03 % ('EDPluginControlStrategyv10.preProcess', self.__strPluginRaddoseName, "Beam Flux not set")
EDVerbose.warning(warningMessage)
self.addWarningMessage(warningMessage)
else:
self.__edPluginRaddose = self.loadPlugin(self.__strPluginRaddoseName)
if (self.__edPluginRaddose is not None):
EDVerbose.DEBUG("EDPluginControlStrategyv10.preProcess: " + self.__strPluginRaddoseName + " Found... setting Data Input")
strFileSymop = os.path.join(self.getSymopHome(), "symop.lib")
xsDataStringSpaceGroup = self.getDataInput().getDiffractionPlan().getForcedSpaceGroup()
# Space Group has been forced
# Prepare chemical composition calculation with the forced Space Group (Space Group Name)
if(xsDataStringSpaceGroup is not None):
strSpaceGroup = xsDataStringSpaceGroup.getValue()
EDVerbose.DEBUG("EDPluginControlStrategyv10.preProcess: Forced Space Group Found: " + strSpaceGroup)
try:
strNumOperators = EDUtilsSymmetry.getNumberOfSymmetryOperatorsFromSpaceGroupName(strSpaceGroup, strFileSymop)
except Exception, detail:
errorMessage = EDMessage.ERROR_EXECUTION_03 % ('EDPluginControlStrategyv10.preProcess', "Problem to calculate Number of symmetry operators", detail)
EDVerbose.error(errorMessage)
self.addErrorMessage(errorMessage)
raise RuntimeError, errorMessage
# Space Group has NOT been forced
else:
xsDataStringSpaceGroup = self.__xsDataSampleCopy.getCrystal().getSpaceGroup().getName()
if (xsDataStringSpaceGroup is not None):
# Prepare chemical composition calculation with the Space Group calculated by indexing (Space Group Name)
strSpaceGroupName = self.__xsDataSampleCopy.getCrystal().getSpaceGroup().getName().getValue()
EDVerbose.DEBUG("EDPluginControlStrategyv10.preProcess: Space Group IT Name found by indexing: " + strSpaceGroupName)
try:
strNumOperators = EDUtilsSymmetry.getNumberOfSymmetryOperatorsFromSpaceGroupName(strSpaceGroupName, strFileSymop)
except Exception, detail:
errorMessage = EDMessage.ERROR_EXECUTION_03 % ('EDPluginControlStrategyv10.preProcess', "Problem to calculate Number of symmetry operators", detail)
EDVerbose.error(errorMessage)
self.addErrorMessage(errorMessage)
#.........这里部分代码省略.........
示例2: EDPluginControlStrategyv1_2
# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import getCrystal [as 别名]
class EDPluginControlStrategyv1_2(EDPluginControl):
"""
The Plugin that controls the strategy step
"""
def __init__ (self):
"""
"""
EDPluginControl.__init__(self)
self.setXSDataInputClass(XSDataInputStrategy)
self._strPluginRaddoseName = "EDPluginRaddosev10"
self._edPluginRaddose = None
self._edHandlerXSDataRaddose = None
self._strPluginBestName = "EDPluginBestv1_2"
self._edPluginBest = None
self._edHandlerXSDataBest = None
self._strPluginPlotGleName = "EDPluginExecPlotGlev1_0"
self._edPluginPlotGle = None
self._strCONF_SYMOP_HOME = "symopHome"
# Default value for the location of the symop table
self._strSymopHome = None
self._xsDataSampleCopy = None
# For default chemical composition
self._fAverageAminoAcidVolume = 135.49
self._fAverageCrystalSolventContent = 0.47
self._fAverageSulfurContentPerAminoacid = 0.05
self._fAverageSulfurConcentration = 314
# This varaible determines if Raddose should be executed or not
self._bEstimateRadiationDamage = None
# Raddose log file
self.xsDataFileRaddoseLog = None
def setSymopHome(self, _strSymopHome):
self._strSymopHome = _strSymopHome
def getSymopHome(self):
return self._strSymopHome
def preProcess(self, _edObject=None):
"""
Gets the Configuration Parameters, if found, overrides default parameters
"""
EDPluginControl.preProcess(self, _edObject)
EDVerbose.DEBUG("EDPluginControlStrategyv1_2.preProcess...")
self._edPluginRaddose = None
xsDataSampleCrystalMM = self.getDataInput().getSample()
if(xsDataSampleCrystalMM is None):
self._xsDataSampleCopy = XSDataSampleCrystalMM()
else:
strXmlStringDataSample = xsDataSampleCrystalMM.marshal()
self._xsDataSampleCopy = XSDataSampleCrystalMM.parseString(strXmlStringDataSample)
xsDataCrystal = self.getDataInput().getCrystalRefined()
if(xsDataCrystal is not None):
self._xsDataSampleCopy.setCrystal(xsDataCrystal)
# Load the Best plugin
self._edPluginBest = self.loadPlugin(self._strPluginBestName)
self._edPluginBest.setBaseDirectory(self.getWorkingDirectory())
self._edPluginBest.setBaseName(self._strPluginBestName)
# Load the plot gle plugin
self._edPluginPlotGle = self.loadPlugin(self._strPluginPlotGleName)
# Check if radiation damage estimation is required or not in the diffraction plan
xsDataDiffractionPlan = self.getDataInput().getDiffractionPlan()
if xsDataDiffractionPlan is not None:
if xsDataDiffractionPlan.getEstimateRadiationDamage():
if xsDataDiffractionPlan.getEstimateRadiationDamage().getValue():
# Yes, is requested
self._bEstimateRadiationDamage = True
else:
# No, is explicitly not requested
self._bEstimateRadiationDamage = False
elif xsDataDiffractionPlan.getStrategyOption() is not None:
if xsDataDiffractionPlan.getStrategyOption().getValue().find("-DamPar") != -1:
# The "-DamPar" option requires estimation of radiation damage
self._bEstimateRadiationDamage = True
# Check if we know what to do with radiation damage
if self._bEstimateRadiationDamage is None:
# "Force" the estimation of radiation damage if the flux is present
if self.getDataInput().getExperimentalCondition().getBeam().getFlux() is None:
strWarningMessage = "EDPluginControlStrategyv1_2: Missing flux input - cannot estimate radiation damage."
EDVerbose.WARNING(strWarningMessage)
self.addWarningMessage(strWarningMessage)
self._bEstimateRadiationDamage = False
#.........这里部分代码省略.........
示例3: EDPluginControlStrategyv1_2
# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import getCrystal [as 别名]
class EDPluginControlStrategyv1_2(EDPluginControl):
"""
The Plugin that controls the strategy step
"""
def __init__(self):
"""
"""
EDPluginControl.__init__(self)
self.setXSDataInputClass(XSDataInputStrategy)
self._strPluginRaddoseName = "EDPluginRaddosev10"
self._edPluginRaddose = None
self._edHandlerXSDataRaddose = None
self._strPluginBestName = "EDPluginBestv1_2"
self._edPluginBest = None
self._edHandlerXSDataBest = None
self._strPluginPlotGleName = "EDPluginExecPlotGlev1_1"
self._edPluginPlotGle = None
self._strCONF_SYMOP_HOME = "symopHome"
# Default value for the location of the symop table
self._strSymopHome = None
self._xsDataSampleCopy = None
# For default chemical composition
self._fAverageAminoAcidVolume = 135.49
self._fAverageCrystalSolventContent = 0.47
self._fAverageSulfurContentPerAminoacid = 0.05
self._fAverageSulfurConcentration = 314
# This varaible determines if Raddose should be executed or not
self._bEstimateRadiationDamage = None
# Raddose log file
self.xsDataFileRaddoseLog = None
self.roundUpToEven100 = False
def setSymopHome(self, _strSymopHome):
self._strSymopHome = _strSymopHome
def getSymopHome(self):
return self._strSymopHome
def preProcess(self, _edObject=None):
"""
Gets the Configuration Parameters, if found, overrides default parameters
"""
EDPluginControl.preProcess(self, _edObject)
self.DEBUG("EDPluginControlStrategyv1_2.preProcess...")
self._edPluginRaddose = None
xsDataSampleCrystalMM = self.getDataInput().getSample()
if xsDataSampleCrystalMM is None:
self._xsDataSampleCopy = XSDataSampleCrystalMM()
else:
strXmlStringDataSample = xsDataSampleCrystalMM.marshal()
self._xsDataSampleCopy = XSDataSampleCrystalMM.parseString(strXmlStringDataSample)
xsDataCrystal = self.getDataInput().getCrystalRefined()
if xsDataCrystal is not None:
self._xsDataSampleCopy.setCrystal(xsDataCrystal)
# Load the Best plugin
self._edPluginBest = self.loadPlugin(self._strPluginBestName)
self._edPluginBest.setBaseDirectory(self.getWorkingDirectory())
self._edPluginBest.setBaseName(self._strPluginBestName)
# Load the plot gle plugin
self._edPluginPlotGle = self.loadPlugin(self._strPluginPlotGleName)
# Check if radiation damage estimation is required or not in the diffraction plan
xsDataDiffractionPlan = self.getDataInput().getDiffractionPlan()
if xsDataDiffractionPlan is not None:
if xsDataDiffractionPlan.getEstimateRadiationDamage():
if xsDataDiffractionPlan.getEstimateRadiationDamage().getValue():
# Yes, is requested
self._bEstimateRadiationDamage = True
else:
# No, is explicitly not requested
self._bEstimateRadiationDamage = False
elif xsDataDiffractionPlan.getStrategyOption() is not None:
if xsDataDiffractionPlan.getStrategyOption().getValue().find("-DamPar") != -1:
# The "-DamPar" option requires estimation of radiation damage
self._bEstimateRadiationDamage = True
# Check if we know what to do with radiation damage
if self._bEstimateRadiationDamage is None:
# "Force" the estimation of radiation damage if the flux is present
if self.getDataInput().getExperimentalCondition().getBeam().getFlux() is None:
strWarningMessage = (
"EDPluginControlStrategyv1_2: Missing flux input - cannot estimate radiation damage."
)
self.WARNING(strWarningMessage)
self.addWarningMessage(strWarningMessage)
#.........这里部分代码省略.........
示例4: EDPluginControlKappaStrategyv2_0
# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import getCrystal [as 别名]
class EDPluginControlKappaStrategyv2_0(EDPluginControl):
"""
The Plugin that controls the strategy step
"""
def __init__ (self):
EDPluginControl.__init__(self)
#self.setXSDataInputClass(EDList)
self.setRequiredToHaveConfiguration(True)
self.strPluginRaddoseName = "EDPluginRaddosev10"
self.edPluginRaddose = None
self.edHandlerXSDataRaddose = None
self.strPluginBestName = "EDPluginBestv1_2"
self.edPluginBest = None
from EDHandlerXSDataBestv1_2 import EDHandlerXSDataBestv1_2
self.edHandlerXSDataBest = EDHandlerXSDataBestv1_2()
self.strPluginAlignmentName = "EDPluginSTACAlignmentv2_0"
self.edPluginAlignment = None
self.edHandlerXSDataAlignment = None
self.strPluginKappaStrategyName = "EDPluginSTACStrategyv2_0"
self.edPluginKappaStrategy = None
self.edHandlerXSDataKappaStrategy = None
self.setXSDataInputClass(XSDataInputStrategy, "mxv1InputStrategy")
EDFactoryPluginStatic.loadModule("XSDataMXv2")
import XSDataMXv2
self.setXSDataInputClass(XSDataMXv2.XSDataCollection, "mxv2DataCollection")
import XSDataMXv1
self.setXSDataInputClass(XSDataMXv1.XSDataIndexingResult, "mxv1IndexingResult")
#disable kappa by default
self.KappaStrategy = 0
self.strCONF_SYMOP_HOME = "symopHome"
# Default value for the location of the symop table
self.strSymopHome = os.path.normpath("/opt/pxsoft/ccp4-6.0.2/lib/data")
self.xsDataSampleCopy = None
# For default chemical composition
self.fAverageAminoAcidVolume = 135.49
self.fAverageCrystalSolventContent = 0.47
self.fAverageSulfurContentPerAminoacid = 0.05
self.fAverageSulfurConcentration = 314
def setSymopHome(self, _strSymopHome):
self.strSymopHome = _strSymopHome
def getSymopHome(self):
return self.strSymopHome
def preProcess(self, _edObject=None):
"""
Gets the Configuration Parameters, if found, overrides default parameters
"""
EDPluginControl.preProcess(self, _edObject)
EDVerbose.DEBUG("EDPluginControlKappaStrategyv2_0.preProcess...")
self.edPluginRaddose = None
xsDataSampleCrystalMM = self.getDataInput("mxv1InputStrategy")[0].getSample()
if(xsDataSampleCrystalMM is None):
self.xsDataSampleCopy = XSDataSampleCrystalMM()
else:
strXmlStringDataSample = xsDataSampleCrystalMM.marshal()
self.xsDataSampleCopy = XSDataSampleCrystalMM.parseString(strXmlStringDataSample)
xsDataCrystal = self.getDataInput("mxv1InputStrategy")[0].getCrystalRefined()
if(xsDataCrystal is not None):
self.xsDataSampleCopy.setCrystal(xsDataCrystal)
# Raddose is enabled only if the beam flux is set
if(self.getDataInput("mxv1InputStrategy")[0].getExperimentalCondition().getBeam().getFlux() is None):
strWarningMessage = EDMessage.WARNING_CANNOT_USE_PLUGIN_03 % ('EDPluginControlKappaStrategyv2_0.preProcess', self.strPluginRaddoseName, "Beam Flux not set")
EDVerbose.warning(strWarningMessage)
self.addWarningMessage(strWarningMessage)
else:
self.edPluginRaddose = self.loadPlugin(self.strPluginRaddoseName)
if (self.edPluginRaddose is not None):
EDVerbose.DEBUG("EDPluginControlKappaStrategyv2_0.preProcess: " + self.strPluginRaddoseName + " Found... setting Data Input")
strFileSymop = os.path.join(self.getSymopHome(), "symop.lib")
xsDataStringSpaceGroup = self.getDataInput("mxv1InputStrategy")[0].getDiffractionPlan().getForcedSpaceGroup()
# Space Group has been forced
# Prepare chemical composition calculation with the forced Space Group (Space Group Name)
strNumOperators = None
strSpaceGroup = None
if(xsDataStringSpaceGroup is not None):
#.........这里部分代码省略.........
示例5: EDPluginControlStrategyv1_3
# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import getCrystal [as 别名]
class EDPluginControlStrategyv1_3(EDPluginControl):
"""
The Plugin that controls the strategy step
"""
def __init__ (self):
"""
"""
EDPluginControl.__init__(self)
self.setXSDataInputClass(XSDataInputStrategy)
self._strPluginRaddoseName = "EDPluginRaddosev10"
self._edPluginRaddose = None
self._edHandlerXSDataRaddose = None
self._strPluginBestName = "EDPluginBestv1_3"
self._edPluginBest = None
self._edHandlerXSDataBest = None
self._strPluginPlotGleName = "EDPluginExecPlotGlev1_1"
self._edPluginPlotGle = None
self._strCONF_SYMOP_HOME = "symopHome"
# Default value for the location of the symop table
self._strSymopHome = None
self._xsDataSampleCopy = None
# For default chemical composition
self._fAverageAminoAcidVolume = 135.49
self._fAverageCrystalSolventContent = 0.47
self._fAverageSulfurContentPerAminoacid = 0.05
self._fAverageSulfurConcentration = 314
# This varaible determines if Raddose should be executed or not
self._bEstimateRadiationDamage = None
# Raddose log file
self.xsDataFileRaddoseLog = None
def setSymopHome(self, _strSymopHome):
self._strSymopHome = _strSymopHome
def getSymopHome(self):
return self._strSymopHome
def preProcess(self, _edObject=None):
"""
Gets the Configuration Parameters, if found, overrides default parameters
"""
EDPluginControl.preProcess(self, _edObject)
self.DEBUG("EDPluginControlStrategyv1_3.preProcess...")
self._edPluginRaddose = None
xsDataSampleCrystalMM = self.getDataInput().getSample()
if(xsDataSampleCrystalMM is None):
self._xsDataSampleCopy = XSDataSampleCrystalMM()
else:
strXmlStringDataSample = xsDataSampleCrystalMM.marshal()
self._xsDataSampleCopy = XSDataSampleCrystalMM.parseString(strXmlStringDataSample)
xsDataCrystal = self.getDataInput().getCrystalRefined()
if(xsDataCrystal is not None):
self._xsDataSampleCopy.setCrystal(xsDataCrystal)
# Load the Best plugin
self._edPluginBest = self.loadPlugin(self._strPluginBestName)
self._edPluginBest.setBaseDirectory(self.getWorkingDirectory())
self._edPluginBest.setBaseName(self._strPluginBestName)
# Load the plot gle plugin
self._edPluginPlotGle = self.loadPlugin(self._strPluginPlotGleName)
# Check if radiation damage estimation is required or not in the diffraction plan
xsDataDiffractionPlan = self.getDataInput().getDiffractionPlan()
if xsDataDiffractionPlan is not None:
if xsDataDiffractionPlan.getEstimateRadiationDamage():
if xsDataDiffractionPlan.getEstimateRadiationDamage().getValue():
# Yes, is requested
self._bEstimateRadiationDamage = True
else:
# No, is explicitly not requested
self._bEstimateRadiationDamage = False
elif xsDataDiffractionPlan.getStrategyOption() is not None:
if xsDataDiffractionPlan.getStrategyOption().getValue().find("-DamPar") != -1:
# The "-DamPar" option requires estimation of radiation damage
self._bEstimateRadiationDamage = True
# Check if we know what to do with radiation damage
if self._bEstimateRadiationDamage is None:
# "Force" the estimation of radiation damage if the flux is present
if self.getDataInput().getExperimentalCondition().getBeam().getFlux() is None:
strWarningMessage = "EDPluginControlStrategyv1_3: Missing flux input - cannot estimate radiation damage."
self.WARNING(strWarningMessage)
self.addWarningMessage(strWarningMessage)
self._bEstimateRadiationDamage = False
#.........这里部分代码省略.........