Пример #1
0
 def generateXSDataISPyBDiffractionPlan(_xsDataResultCharacterisation):
     xsDataISPyBDiffractionPlan = None
     xsDataCollection = _xsDataResultCharacterisation.getDataCollection()
     if xsDataCollection is not None:
         xsDataDiffractionPlan = xsDataCollection.getDiffractionPlan()
         if xsDataDiffractionPlan != None:
             xsDataISPyBDiffractionPlan = XSDataISPyBDiffractionPlan()
             xsDataISPyBDiffractionPlan.aimedCompleteness = xsDataDiffractionPlan.aimedCompleteness
             xsDataISPyBDiffractionPlan.aimedIOverSigmaAtHighestResolution = (
                 xsDataDiffractionPlan.aimedIOverSigmaAtHighestResolution
             )
             xsDataISPyBDiffractionPlan.aimedMultiplicity = xsDataDiffractionPlan.aimedMultiplicity
             xsDataISPyBDiffractionPlan.aimedResolution = xsDataDiffractionPlan.aimedResolution
             xsDataISPyBDiffractionPlan.anomalousData = xsDataDiffractionPlan.anomalousData
             xsDataISPyBDiffractionPlan.complexity = xsDataDiffractionPlan.complexity
             xsDataISPyBDiffractionPlan.detectorDistanceMax = xsDataDiffractionPlan.detectorDistanceMax
             xsDataISPyBDiffractionPlan.detectorDistanceMin = xsDataDiffractionPlan.detectorDistanceMin
             xsDataISPyBDiffractionPlan.estimateRadiationDamage = xsDataDiffractionPlan.estimateRadiationDamage
             xsDataISPyBDiffractionPlan.forcedSpaceGroup = xsDataDiffractionPlan.forcedSpaceGroup
             xsDataISPyBDiffractionPlan.goniostatMaxOscillationSpeed = (
                 xsDataDiffractionPlan.goniostatMaxOscillationSpeed
             )
             xsDataISPyBDiffractionPlan.goniostatMinOscillationWidth = (
                 xsDataDiffractionPlan.goniostatMinOscillationWidth
             )
             strAllKappaStrategyOptions = ""
             for kappaStrategyOption in xsDataDiffractionPlan.kappaStrategyOption:
                 strAllKappaStrategyOptions += kappaStrategyOption.value
                 # Add a comma to separate entries except for the last item
                 if kappaStrategyOption != xsDataDiffractionPlan.kappaStrategyOption[-1]:
                     strAllKappaStrategyOptions += ", "
             if strAllKappaStrategyOptions != "":
                 xsDataISPyBDiffractionPlan.kappaStrategyOption = XSDataString(strAllKappaStrategyOptions)
             xsDataISPyBDiffractionPlan.maxExposureTimePerDataCollection = (
                 xsDataDiffractionPlan.maxExposureTimePerDataCollection
             )
             xsDataISPyBDiffractionPlan.minExposureTimePerImage = xsDataDiffractionPlan.minExposureTimePerImage
             xsDataISPyBDiffractionPlan.minTransmission = xsDataDiffractionPlan.minTransmission
             xsDataISPyBDiffractionPlan.numberOfPositions = xsDataDiffractionPlan.numberOfPositions
             xsDataISPyBDiffractionPlan.requiredCompleteness = xsDataDiffractionPlan.requiredCompleteness
             xsDataISPyBDiffractionPlan.requiredMultiplicity = xsDataDiffractionPlan.requiredMultiplicity
             xsDataISPyBDiffractionPlan.requiredResolution = xsDataDiffractionPlan.requiredResolution
             xsDataISPyBDiffractionPlan.strategyOption = xsDataDiffractionPlan.strategyOption
     return xsDataISPyBDiffractionPlan
Пример #2
0
 def generateXSDataISPyBDiffractionPlan(_xsDataResultCharacterisation):
     xsDataISPyBDiffractionPlan = None
     xsDataCollection = _xsDataResultCharacterisation.getDataCollection()
     if (xsDataCollection is not None):
         xsDataDiffractionPlan = xsDataCollection.getDiffractionPlan()
         if xsDataDiffractionPlan != None:
             xsDataISPyBDiffractionPlan = XSDataISPyBDiffractionPlan()
             xsDataISPyBDiffractionPlan.aimedCompleteness = xsDataDiffractionPlan.aimedCompleteness
             xsDataISPyBDiffractionPlan.aimedIOverSigmaAtHighestResolution = xsDataDiffractionPlan.aimedIOverSigmaAtHighestResolution
             xsDataISPyBDiffractionPlan.aimedMultiplicity = xsDataDiffractionPlan.aimedMultiplicity
             xsDataISPyBDiffractionPlan.aimedResolution = xsDataDiffractionPlan.aimedResolution
             xsDataISPyBDiffractionPlan.anomalousData = xsDataDiffractionPlan.anomalousData
             xsDataISPyBDiffractionPlan.complexity = xsDataDiffractionPlan.complexity
             xsDataISPyBDiffractionPlan.detectorDistanceMax = xsDataDiffractionPlan.detectorDistanceMax
             xsDataISPyBDiffractionPlan.detectorDistanceMin = xsDataDiffractionPlan.detectorDistanceMin
             xsDataISPyBDiffractionPlan.estimateRadiationDamage = xsDataDiffractionPlan.estimateRadiationDamage
             xsDataISPyBDiffractionPlan.forcedSpaceGroup = xsDataDiffractionPlan.forcedSpaceGroup
             xsDataISPyBDiffractionPlan.goniostatMaxOscillationSpeed = xsDataDiffractionPlan.goniostatMaxOscillationSpeed
             xsDataISPyBDiffractionPlan.goniostatMinOscillationWidth = xsDataDiffractionPlan.goniostatMinOscillationWidth
             strAllKappaStrategyOptions = ""
             for kappaStrategyOption in xsDataDiffractionPlan.kappaStrategyOption:
                 strAllKappaStrategyOptions += kappaStrategyOption.value
                 # Add a comma to separate entries except for the last item
                 if kappaStrategyOption != xsDataDiffractionPlan.kappaStrategyOption[
                         -1]:
                     strAllKappaStrategyOptions += ", "
             if strAllKappaStrategyOptions != "":
                 xsDataISPyBDiffractionPlan.kappaStrategyOption = XSDataString(
                     strAllKappaStrategyOptions)
             xsDataISPyBDiffractionPlan.maxExposureTimePerDataCollection = xsDataDiffractionPlan.maxExposureTimePerDataCollection
             xsDataISPyBDiffractionPlan.minExposureTimePerImage = xsDataDiffractionPlan.minExposureTimePerImage
             xsDataISPyBDiffractionPlan.minTransmission = xsDataDiffractionPlan.minTransmission
             xsDataISPyBDiffractionPlan.numberOfPositions = xsDataDiffractionPlan.numberOfPositions
             xsDataISPyBDiffractionPlan.requiredCompleteness = xsDataDiffractionPlan.requiredCompleteness
             xsDataISPyBDiffractionPlan.requiredMultiplicity = xsDataDiffractionPlan.requiredMultiplicity
             xsDataISPyBDiffractionPlan.requiredResolution = xsDataDiffractionPlan.requiredResolution
             xsDataISPyBDiffractionPlan.strategyOption = xsDataDiffractionPlan.strategyOption
     return xsDataISPyBDiffractionPlan
 def process(self, _edObject=None):
     """
     Uses ToolsForCollectionWebService for storing the workflow status
     """
     EDPluginExec.process(self)
     self.DEBUG("EDPluginISPyBGetSampleInformationv1_4.process")
     # First get the image ID
     xsDataInputGetSampleInformation = self.getDataInput()
     httpAuthenticatedToolsForCollectionWebService = HttpAuthenticated(username=self.strUserName, password=self.strPassWord)
     clientToolsForBLSampleWebServiceWsdl = Client(self.strToolsForBLSampleWebServiceWsdl, transport=httpAuthenticatedToolsForCollectionWebService)
     iSampleId = self.getXSValue(xsDataInputGetSampleInformation.sampleId)
     sampleInfo = clientToolsForBLSampleWebServiceWsdl.service.getSampleInformation(iSampleId)
     self.DEBUG("Sample info from ISPyB: %r" % sampleInfo)
     if sampleInfo is not None:
         if "code" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.code = XSDataString(sampleInfo.code)
         if "cellA" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.cellA = XSDataDouble(sampleInfo.cellA)
         if "cellB" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.cellB = XSDataDouble(sampleInfo.cellB)
         if "cellC" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.cellC = XSDataDouble(sampleInfo.cellC)
         if "cellAlpha" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.cellAlpha = XSDataDouble(sampleInfo.cellAlpha)
         if "cellBeta" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.cellBeta = XSDataDouble(sampleInfo.cellBeta)
         if "cellGamma" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.cellGamma = XSDataDouble(sampleInfo.cellGamma)
         if "containerSampleChangerLocation" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.containerSampleChangerLocation = XSDataString(sampleInfo.containerSampleChangerLocation)
         if "crystalSpaceGroup" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.crystalSpaceGroup = XSDataString(sampleInfo.crystalSpaceGroup)
         if "experimentType" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.experimentType = XSDataString(sampleInfo.experimentType)
         if "holderLength" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.holderLength = XSDataDouble(sampleInfo.holderLength)
         if "minimalResolution" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.minimalResolution = XSDataDouble(sampleInfo.minimalResolution)
         if "proteinAcronym" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.proteinAcronym = XSDataString(sampleInfo.proteinAcronym)
         if "sampleId" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.sampleId = XSDataInteger(sampleInfo.sampleId)
         if "sampleLocation" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.sampleLocation = XSDataString(sampleInfo.sampleLocation)
         if "sampleName" in sampleInfo:
             self.xsDataResultISPyBGetSampleInformation.sampleName = XSDataString(sampleInfo.sampleName)
         if "diffractionPlan" in sampleInfo:
             xsDataISPyBDiffractionPlan = XSDataISPyBDiffractionPlan()
             if "aimedCompleteness" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.aimedCompleteness = XSDataDouble(sampleInfo.diffractionPlan.aimedCompleteness)
             if "aimedIOverSigmaAtHighestResolution" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.aimedIOverSigmaAtHighestResolution = XSDataDouble(sampleInfo.diffractionPlan.aimedIOverSigmaAtHighestResolution)
             if "aimedMultiplicity" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.aimedMultiplicity = XSDataDouble(sampleInfo.diffractionPlan.aimedMultiplicity)
             if "aimedResolution" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.aimedResolution = XSDataDouble(sampleInfo.diffractionPlan.aimedResolution)
             if "anomalousData" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.anomalousData = XSDataBoolean(sampleInfo.diffractionPlan.anomalousData)
             if "comments" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.comments = XSDataString(sampleInfo.diffractionPlan.comments)
             if "complexity" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.complexity = XSDataString(sampleInfo.diffractionPlan.complexity)
             if "diffractionPlanId" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.diffractionPlanId = XSDataInteger(sampleInfo.diffractionPlan.diffractionPlanId)
             if "estimateRadiationDamage" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.estimateRadiationDamage = XSDataBoolean(sampleInfo.diffractionPlan.estimateRadiationDamage)
             if "experimentKind" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.experimentKind = XSDataString(sampleInfo.diffractionPlan.experimentKind)
             if "exposureTime" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.exposureTime = XSDataDouble(sampleInfo.diffractionPlan.exposureTime)
             if "forcedSpaceGroup" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.forcedSpaceGroup = XSDataString(sampleInfo.diffractionPlan.forcedSpaceGroup)
             if "kappaStrategyOption" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.kappaStrategyOption = XSDataString(sampleInfo.diffractionPlan.kappaStrategyOption)
             if "maxDimAccrossSpindleAxis" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.maxDimAccrossSpindleAxis = XSDataDouble(sampleInfo.diffractionPlan.maxDimAccrossSpindleAxis)
             if "maximalResolution" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.maximalResolution = XSDataDouble(sampleInfo.diffractionPlan.maximalResolution)
             if "minDimAccrossSpindleAxis" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.minDimAccrossSpindleAxis = XSDataDouble(sampleInfo.diffractionPlan.minDimAccrossSpindleAxis)
             if "minimalResolution" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.minimalResolution = XSDataDouble(sampleInfo.diffractionPlan.minimalResolution)
             if "numberOfPositions" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.numberOfPositions = XSDataInteger(sampleInfo.diffractionPlan.numberOfPositions)
             if "observedResolution" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.observedResolution = XSDataDouble(sampleInfo.diffractionPlan.observedResolution)
             if "oscillationRange" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.oscillationRange = XSDataDouble(sampleInfo.diffractionPlan.oscillationRange)
             if "preferredBeamSizeX" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.preferredBeamSizeX = XSDataDouble(sampleInfo.diffractionPlan.preferredBeamSizeX)
             if "preferredBeamSizeY" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.preferredBeamSizeY = XSDataDouble(sampleInfo.diffractionPlan.preferredBeamSizeY)
             if "radiationSensitivity" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.radiationSensitivity = XSDataDouble(sampleInfo.diffractionPlan.radiationSensitivity)
             if "radiationSensitivityBeta" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.radiationSensitivityBeta = XSDataDouble(sampleInfo.diffractionPlan.radiationSensitivityBeta)
             if "radiationSensitivityGamma" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.radiationSensitivityGamma = XSDataDouble(sampleInfo.diffractionPlan.radiationSensitivityGamma)
             if "requiredCompleteness" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.requiredCompleteness = XSDataDouble(sampleInfo.diffractionPlan.requiredCompleteness)
             if "requiredMultiplicity" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.requiredMultiplicity = XSDataDouble(sampleInfo.diffractionPlan.requiredMultiplicity)
             if "requiredResolution" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.requiredResolution = XSDataDouble(sampleInfo.diffractionPlan.requiredResolution)
             if "screeningResolution" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.screeningResolution = XSDataDouble(sampleInfo.diffractionPlan.screeningResolution)
             if "anomalousScatterer" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.anomalousScatterer = XSDataString(sampleInfo.diffractionPlan.anomalousScatterer)
             if "strategyOption" in sampleInfo.diffractionPlan:
                 xsDataISPyBDiffractionPlan.strategyOption = XSDataString(sampleInfo.diffractionPlan.strategyOption)
             self.xsDataResultISPyBGetSampleInformation.diffractionPlan = xsDataISPyBDiffractionPlan
     self.DEBUG("EDPluginISPyBGetSampleInformationv1_4.process: result=%s" % pprint.pformat(self.xsDataResultISPyBGetSampleInformation))