当前位置: 首页>>代码示例>>Python>>正文


Python XSDataSampleCrystalMM.setCrystal方法代码示例

本文整理汇总了Python中XSDataMXv1.XSDataSampleCrystalMM.setCrystal方法的典型用法代码示例。如果您正苦于以下问题:Python XSDataSampleCrystalMM.setCrystal方法的具体用法?Python XSDataSampleCrystalMM.setCrystal怎么用?Python XSDataSampleCrystalMM.setCrystal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XSDataMXv1.XSDataSampleCrystalMM的用法示例。


在下文中一共展示了XSDataSampleCrystalMM.setCrystal方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testDefaultChemicalComposition

# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import setCrystal [as 别名]
    def testDefaultChemicalComposition(self):
        edPluginStrategy = self.createPlugin()

        from XSDataCommon import XSDataAngle
        from XSDataCommon import XSDataLength
        from XSDataMXv1 import XSDataSampleCrystalMM
        from XSDataMXv1 import XSDataCrystal
        from XSDataMXv1 import XSDataCell


        xsDataSampleCrystalMM = XSDataSampleCrystalMM()
        xsDataCrystal = XSDataCrystal()
        xsDataCell = XSDataCell(XSDataAngle(90.0),
                                 XSDataAngle(90.0),
                                 XSDataAngle(90.0),
                                 XSDataLength(78.9),
                                 XSDataLength(95.162),
                                 XSDataLength(104.087))
        xsDataCrystal.setCell(xsDataCell)
        xsDataSampleCrystalMM.setCrystal(xsDataCrystal)
        inumOperators = 4

        xsDataSample2 = edPluginStrategy.getDefaultChemicalComposition(xsDataSampleCrystalMM, inumOperators)
        strChainType = xsDataSample2.getStructure().getChain()[0].getType()
        EDAssert.equal("protein", strChainType.getValue())
开发者ID:antolinos,项目名称:edna,代码行数:27,代码来源:EDTestCasePluginUnitControlStrategyv1_1.py

示例2: testDefaultChemicalComposition

# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import setCrystal [as 别名]
    def testDefaultChemicalComposition(self):
        edPluginStrategy = self.createPlugin()

        xsDataSampleCrystalMM = XSDataSampleCrystalMM()
        xsDataCrystal = XSDataCrystal()
        xsDataCell = XSDataCell(angle_alpha=XSDataAngle(90.0),
                                 angle_beta=XSDataAngle(90.0),
                                 angle_gamma=XSDataAngle(90.0),
                                 length_a=XSDataLength(78.9),
                                 length_b=XSDataLength(95.162),
                                 length_c=XSDataLength(104.087))
        xsDataCrystal.setCell(xsDataCell)
        xsDataSampleCrystalMM.setCrystal(xsDataCrystal)
        inumOperators = 4

        xsDataSample2 = edPluginStrategy.getDefaultChemicalComposition(xsDataSampleCrystalMM, inumOperators)
        pyStrChainType = xsDataSample2.getStructure().getChain()[0].getType()
        EDAssert.equal("protein", pyStrChainType.getValue())
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:20,代码来源:EDTestCasePluginUnitControlStrategyv1_3.py

示例3: EDPluginControlStrategyv10

# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import setCrystal [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)
#.........这里部分代码省略.........
开发者ID:antolinos,项目名称:edna,代码行数:103,代码来源:EDPluginControlStrategyv10.py

示例4: EDPluginControlStrategyv1_2

# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import setCrystal [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
#.........这里部分代码省略.........
开发者ID:antolinos,项目名称:edna,代码行数:103,代码来源:EDPluginControlStrategyv1_2.py

示例5: EDPluginControlKappaStrategyv2_0

# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import setCrystal [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):
#.........这里部分代码省略.........
开发者ID:antolinos,项目名称:edna,代码行数:103,代码来源:EDPluginControlKappaStrategyv2_0.py

示例6: testGetXSDataRaddoseInput

# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import setCrystal [as 别名]

#.........这里部分代码省略.........
        from XSDataMXv1   import XSDataCell

        from EDHandlerXSDataRaddosev10 import EDHandlerXSDataRaddosev10

        EDFactoryPluginStatic.loadModule("XSDataRaddosev10")
        from XSDataRaddosev10 import XSDataRaddoseInput

        xsDataBeam = XSDataBeam()
        xsDataBeam.setSize(XSDataSize(x=XSDataLength(0.1), y=XSDataLength(0.1)))
        xsDataBeam.setWavelength(XSDataWavelength(2.41))
        xsDataBeam.setFlux(XSDataFlux(1e+12))

        xsDataSample = XSDataSampleCrystalMM()
        xsDataStructure = XSDataStructure()
        xsDataComposition = XSDataChemicalCompositionMM()

        xsDataChain = XSDataChain()
        xsDataChain.setType(XSDataString("protein"))
        xsDataChain.setNumberOfCopies(XSDataDouble(2))
        xsDataAtomicComposition = XSDataAtomicComposition()
        xsDataAtom1 = XSDataAtom()
        xsDataAtom1.setSymbol(XSDataString("Se"))
        xsDataAtom1.setNumberOf(XSDataDouble(4))
        xsDataAtomicComposition.addAtom(xsDataAtom1)
        xsDataAtom2 = XSDataAtom()
        xsDataAtom2.setSymbol(XSDataString("S"))
        xsDataAtom2.setNumberOf(XSDataDouble(5))
        xsDataAtomicComposition.addAtom(xsDataAtom2)
        xsDataChain.setHeavyAtoms(xsDataAtomicComposition)
        xsDataChain.setNumberOfMonomers(XSDataDouble(100))
        xsDataStructure.addChain(xsDataChain)

        xsDataChain2 = XSDataChain()
        xsDataChain2.setType(XSDataString("rna"))
        xsDataChain2.setNumberOfCopies(XSDataDouble(1))
        xsDataChain2.setNumberOfMonomers(XSDataDouble(60))
        xsDataStructure.addChain(xsDataChain2)

        xsDataLigand = XSDataLigand()
        xsDataLigand.setNumberOfCopies(XSDataDouble(2))
        xsDataLigand.setNumberOfLightAtoms(XSDataDouble(42))
        xsDataAtomicComposition = XSDataAtomicComposition()
        xsDataAtom3 = XSDataAtom()
        xsDataAtom3.setSymbol(XSDataString("Fe"))
        xsDataAtom3.setNumberOf(XSDataDouble(1))
        xsDataAtomicComposition.addAtom(xsDataAtom3)
        xsDataLigand.setHeavyAtoms(xsDataAtomicComposition)
        xsDataStructure.addLigand(xsDataLigand)
        xsDataStructure.setNumberOfCopiesInAsymmetricUnit(XSDataDouble(0.25))

        xsDataSolvent = XSDataSolvent()
        xsDataAtomicComposition = XSDataAtomicComposition()
        xsDataAtomNa = XSDataAtom()
        xsDataAtomNa.setSymbol(XSDataString("Na"))
        xsDataAtomNa.setConcentration(XSDataDouble(1000))
        xsDataAtomicComposition.addAtom(xsDataAtomNa)
        xsDataAtomCl = XSDataAtom()
        xsDataAtomCl.setSymbol(XSDataString("Cl"))
        xsDataAtomCl.setConcentration(XSDataDouble(1000))
        xsDataAtomicComposition.addAtom(xsDataAtomCl)
        xsDataSolvent.setAtoms(xsDataAtomicComposition)

        xsDataComposition.setStructure(xsDataStructure)
        xsDataComposition.setSolvent(xsDataSolvent)
        xsDataSample.setChemicalComposition(xsDataComposition)

        xsDataSample.setSize(XSDataSize(XSDataLength(0.1), XSDataLength(0.1), XSDataLength(0.1)))
        xsDataCell = XSDataCell(angle_alpha=XSDataAngle(90.0),
                                angle_beta=XSDataAngle(90.0),
                                angle_gamma=XSDataAngle(90.0),
                                length_a=XSDataLength(78.9),
                                length_b=XSDataLength(95.162),
                                length_c=XSDataLength(104.087))

        xsDataCrystal = XSDataCrystal()
        xsDataSpaceGroup = XSDataSpaceGroup()

        xsDataCrystal.setCell(xsDataCell)

        xsDataSpaceGroup.setITNumber(XSDataInteger(16))
        xsDataCrystal.setSpaceGroup(xsDataSpaceGroup)

        xsDataSample.setCrystal(xsDataCrystal)

        iNumSymOperators = 4


        xsDataRaddosev01Input = EDHandlerXSDataRaddosev10().getXSDataRaddoseInput(xsDataBeam,
                                                                                      xsDataSample,
                                                                                      iNumSymOperators)


        xsDataRaddosev01Input.exportToFile(self.strObtainedInputFile2)
        strExpectedInput = EDUtilsTest.readAndParseFile (self.strReferenceInputFile2)
        strObtainedInput = EDUtilsTest.readAndParseFile (self.strObtainedInputFile2)

        xsDataInputExpected = XSDataRaddoseInput.parseString(strExpectedInput)
        xsDataInputObtained = XSDataRaddoseInput.parseString(strObtainedInput)

        EDAssert.equal(xsDataInputExpected.marshal(), xsDataInputObtained.marshal())
开发者ID:antolinos,项目名称:edna,代码行数:104,代码来源:EDTestCaseEDHandlerRaddosev10.py

示例7: EDPluginControlStrategyv1_2

# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import setCrystal [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)
#.........这里部分代码省略.........
开发者ID:jordiandreu,项目名称:edna-mx,代码行数:103,代码来源:EDPluginControlStrategyv1_2.py

示例8: EDPluginControlStrategyv1_3

# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import setCrystal [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
#.........这里部分代码省略.........
开发者ID:jordiandreu,项目名称:edna-mx,代码行数:103,代码来源:EDPluginControlStrategyv1_3.py


注:本文中的XSDataMXv1.XSDataSampleCrystalMM.setCrystal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。