def testGetOutputDataFromDNATableFile(self): edPluginRdfit = self.createPlugin() strPathToTableFile = os.path.join(self.strDataPath, "rdfit.xml") xsDataResultRdfit = edPluginRdfit.getOutputDataFromDNATableFile(strPathToTableFile) strPathToReference = os.path.join(self.strDataPath, "XSDataResultRdfit_reference.xml") xsDataResultRdfitReference = XSDataResultRdfit.parseFile(strPathToReference) EDAssert.equal(xsDataResultRdfitReference.marshal(), xsDataResultRdfit.marshal(), "Test parsing result 'DNA' xml file")
def __init__(self): EDPluginExecProcessScript.__init__(self) self.setXSDataInputClass(XSDataInputRdfit) self.setDataOutput(XSDataResultRdfit()) self.strScaleIntensityGleFile = self.getBaseName( ) + "_scaleIntensity.gle" self.strScaleIntensityPlot = self.strScaleIntensityGleFile.replace( ".gle", ".png") self.strBFactorGleFile = self.getBaseName() + "_bFactor.gle " self.strBFactorPlot = self.strBFactorGleFile.replace(".gle", ".png") self.strHtmlPath = self.getBaseName() + ".html"
def getOutputDataFromDNATableFile(self, _strFileName): """Parses the result 'DNA'-type XML file""" xsDataResultRdfit = XSDataResultRdfit() strDnaTablesXML = self.readProcessFile(_strFileName) xsDataDnaTables = dna_tables.parseString(strDnaTablesXML) # Loop through all the tables and fill in the relevant parts of xsDataResultBest xsDataRDFIT_Results = EDUtilsTable.getTableListFromTables(xsDataDnaTables, "RDFIT_Results")[0] xsDataListGeneral = EDUtilsTable.getListsFromTable(xsDataRDFIT_Results, "general")[0] xsDataItemBeta = EDUtilsTable.getItemFromList(xsDataListGeneral, "beta") if xsDataItemBeta is not None: beta = xsDataItemBeta.getValueOf_() xsDataResultRdfit.setBeta(XSDataDouble(beta)) xsDataItemGama = EDUtilsTable.getItemFromList(xsDataListGeneral, "gama") if xsDataItemGama is not None: gama = xsDataItemGama.getValueOf_() xsDataResultRdfit.setGama(XSDataDouble(gama)) xsDataItemDose_half_th = EDUtilsTable.getItemFromList(xsDataListGeneral, "Dose_1/2_th") if xsDataItemDose_half_th is not None: dose_half_th = xsDataItemDose_half_th.getValueOf_() xsDataResultRdfit.setDose_half_th(XSDataDouble(dose_half_th)) xsDataItemDose_half = EDUtilsTable.getItemFromList(xsDataListGeneral, "Dose_1/2") if xsDataItemDose_half is not None: dose_half = xsDataItemDose_half.getValueOf_() xsDataResultRdfit.setDose_half(XSDataDouble(dose_half)) xsDataItemRelative_radiation_sensitivity = EDUtilsTable.getItemFromList(xsDataListGeneral, "Relative_Radiation_Sensitivity") if xsDataItemRelative_radiation_sensitivity is not None: relative_radiation_sensitivity = xsDataItemRelative_radiation_sensitivity.getValueOf_() xsDataResultRdfit.setRelative_radiation_sensitivity(XSDataDouble(relative_radiation_sensitivity)) return xsDataResultRdfit
def getOutputDataFromDNATableFile(self, _strFileName): """Parses the result 'DNA'-type XML file""" xsDataResultRdfit = XSDataResultRdfit() strDnaTablesXML = self.readProcessFile(_strFileName) xsDataDnaTables = dna_tables.parseString(strDnaTablesXML) # Loop through all the tables and fill in the relevant parts of xsDataResultBest xsDataRDFIT_Results = EDUtilsTable.getTableListFromTables( xsDataDnaTables, "RDFIT_Results")[0] xsDataListGeneral = EDUtilsTable.getListsFromTable( xsDataRDFIT_Results, "general")[0] xsDataItemBeta = EDUtilsTable.getItemFromList(xsDataListGeneral, "beta") if xsDataItemBeta is not None: beta = xsDataItemBeta.getValueOf_() xsDataResultRdfit.setBeta(XSDataDouble(beta)) xsDataItemGama = EDUtilsTable.getItemFromList(xsDataListGeneral, "gama") if xsDataItemGama is not None: gama = xsDataItemGama.getValueOf_() xsDataResultRdfit.setGama(XSDataDouble(gama)) xsDataItemDose_half_th = EDUtilsTable.getItemFromList( xsDataListGeneral, "Dose_1/2_th") if xsDataItemDose_half_th is not None: dose_half_th = xsDataItemDose_half_th.getValueOf_() xsDataResultRdfit.setDose_half_th(XSDataDouble(dose_half_th)) xsDataItemDose_half = EDUtilsTable.getItemFromList( xsDataListGeneral, "Dose_1/2") if xsDataItemDose_half is not None: dose_half = xsDataItemDose_half.getValueOf_() xsDataResultRdfit.setDose_half(XSDataDouble(dose_half)) xsDataItemRelative_radiation_sensitivity = EDUtilsTable.getItemFromList( xsDataListGeneral, "Relative_Radiation_Sensitivity") if xsDataItemRelative_radiation_sensitivity is not None: relative_radiation_sensitivity = xsDataItemRelative_radiation_sensitivity.getValueOf_( ) xsDataResultRdfit.setRelative_radiation_sensitivity( XSDataDouble(relative_radiation_sensitivity)) return xsDataResultRdfit