Ejemplo n.º 1
0
    def parseOutput(self, _strFileName):
        """
        This method parses the output of dozor
        """
        xsDataResultDozor = XSDataResultDozor()
        strOutput = EDUtilsFile.readFile(_strFileName)
        # Skip the four first lines
        listOutput = strOutput.split("\n")[6:]
        for strLine in listOutput:
            xsDataImageDozor = XSDataImageDozor()
            # Remove "|" 
            listLine = shlex.split(strLine.replace("|", " "))
#            print listLine
            if listLine != []:
                xsDataImageDozor.number = XSDataInteger(listLine[0])
                if listLine[4].startswith("-"):
                    xsDataImageDozor.spots_num_of = XSDataInteger(listLine[1])
                    xsDataImageDozor.spots_int_aver = self.parseDouble(listLine[2])
                    xsDataImageDozor.spots_resolution = self.parseDouble(listLine[3])
                    xsDataImageDozor.score = self.parseDouble(listLine[7])
                else:
                    xsDataImageDozor.spots_num_of = XSDataInteger(listLine[1])
                    xsDataImageDozor.spots_int_aver = self.parseDouble(listLine[2])
                    xsDataImageDozor.spots_resolution = self.parseDouble(listLine[3])
                    xsDataImageDozor.powder_wilson_scale = self.parseDouble(listLine[4])
                    xsDataImageDozor.powder_wilson_bfactor = self.parseDouble(listLine[5])
                    xsDataImageDozor.powder_wilson_resolution = self.parseDouble(listLine[6])
                    xsDataImageDozor.powder_wilson_correlation = self.parseDouble(listLine[7])
                    xsDataImageDozor.powder_wilson_rfactor = self.parseDouble(listLine[8])
                    xsDataImageDozor.score = self.parseDouble(listLine[9])
#                print xsDataImageDozor.marshal()
                xsDataResultDozor.addImageDozor(xsDataImageDozor)
        return xsDataResultDozor
Ejemplo n.º 2
0
    def parseOutput(self, _strFileName):
        """
        This method parses the output of dozor
        """
        xsDataResultDozor = XSDataResultDozor()
        strOutput = EDUtilsFile.readFile(_strFileName)
        # Skip the four first lines
        self.DEBUG('***** Dozor raw output ***** ')
        self.DEBUG(strOutput)
        listOutput = strOutput.split("\n")[14:]
        for strLine in listOutput:
            xsDataImageDozor = XSDataImageDozor()
            # Remove "|" 
            listLine = shlex.split(strLine.replace("|", " "))
            #print listLine
            if listLine != [] and not listLine[0].startswith("-"):
                xsDataImageDozor.number = XSDataInteger(listLine[0])
                # Fix for xaloc-ALBA
                #if listLine[5].startswith("-") or len(listLine) < 11:
                if len(listLine) < 11:
                    xsDataImageDozor.spots_num_of = XSDataInteger(listLine[1])
                    xsDataImageDozor.spots_int_aver = self.parseDouble(listLine[2])
                    try:
                        xsDataImageDozor.spots_resolution = self.parseDouble(listLine[3])
                    except IndexError as e:
                        xsDataImageDozor.spots_resolution = XSDataDouble(0.0)
                    xsDataImageDozor.score = XSDataDouble(0.0) #self.parseDouble(listLine[4])
                else:
                    xsDataImageDozor.spots_num_of = XSDataInteger(listLine[1])
                    xsDataImageDozor.spots_int_aver = self.parseDouble(listLine[2])
                    xsDataImageDozor.spots_resolution = self.parseDouble(listLine[3])
                    xsDataImageDozor.powder_wilson_scale = self.parseDouble(listLine[4])
                    xsDataImageDozor.powder_wilson_bfactor = self.parseDouble(listLine[5])
                    xsDataImageDozor.powder_wilson_resolution = self.parseDouble(listLine[6])
                    xsDataImageDozor.powder_wilson_correlation = self.parseDouble(listLine[7])
                    xsDataImageDozor.powder_wilson_rfactor = self.parseDouble(listLine[8])
                    xsDataImageDozor.score = self.parseDouble(listLine[9])
#                print xsDataImageDozor.marshal()
                xsDataResultDozor.addImageDozor(xsDataImageDozor)
        return xsDataResultDozor