Ejemplo n.º 1
0
 def parseInputXML(self, inputXML):
     dataDict = {}
     
     xmltree = MU.parseXML(inputXML)
     if xmltree:
         header = xmltree.firstChild.getElementsByTagName('header')
         dataRef = xmltree.firstChild.getElementsByTagName('dataReferences')
         
         if header and dataRef:
             header = header.pop()
             dataRef = dataRef.pop()
             jid = int(header.getAttribute('id'))
             job = header.getElementsByTagName('job')
             primFolder = dataRef.getElementsByTagName('tag')
             
             if jid and job and primFolder:
                 job = job.pop()
                 primFolder = primFolder.pop()
                 paramsDict = {node.tagName: node.firstChild.data for node in job.childNodes if node.nodeType != 3 and node.firstChild}
                 cells = [l.firstChild.data for l in dataRef.getElementsByTagName('location')]
 #                    cellPaths = map(lambda x: os.path.basename(x), cells)
 #                    limsCodes = map(lambda x: '-'.join(LIMSMapper.limsCodeFromCellPath(x)), cellPaths)
                 
                 if paramsDict.get('referenceSequenceName'):
                     dataDict['SecondaryReference'] = paramsDict.get('referenceSequenceName')
                     
                 if paramsDict.get('protocolName'):
                     dataDict['SecondaryProtocol'] = paramsDict.get('protocolName')
 
                 if cells:
                     dataDict['InputPaths'] = cells
 
     return dataDict
Ejemplo n.º 2
0
 def parseReferenceXML(self, referenceXML):
     dataDict = {}
     xmltree = MU.parseXML(referenceXML)
     if xmltree:
         refInfo = xmltree.getElementsByTagName('reference_info')
         
         if refInfo:
             refInfo = refInfo.pop()
             dataDict['name']         = refInfo.getAttribute('id')
             dataDict['lastModified'] = refInfo.getAttribute('last_modified') 
             #dataDict['md5']          = 'unknown',#refInfo.getAttribute('')
             dataDict['version']      = refInfo.getAttribute('version')
             
     return dataDict
Ejemplo n.º 3
0
 def parseJobXML(self, jobXML):
     protocolDict = {}
     xmltree = MU.parseXML(jobXML)
     if xmltree:
         protocolInfo = xmltree.getElementsByTagName('protocol')
         moduleStageInfo   = xmltree.getElementsByTagName('moduleStage')
 
         if protocolInfo:
             elemAttr = 'name' if self.isMartin else 'id'
             protocolParams = {x.getAttribute(elemAttr): x.getElementsByTagName('param') for x in protocolInfo}
             if protocolParams:
                 protocolDict['protocol'] = {x: {e.getAttribute('name'): self._getXMLParamValue(e) for e in y} for x,y in protocolParams.iteritems()}
             
         if moduleStageInfo:
             moduleParams = {x.getAttribute('name'): x.getElementsByTagName('param') for x in moduleStageInfo}
             if moduleParams:
                 protocolDict['modules'] = {x: {e.getAttribute('name'): self._getXMLParamValue(e) for e in y} for x,y in moduleParams.iteritems()}
         
     return protocolDict