def parser(): ''' Creates the csv and the json ''' dataToWrite = [] for index, row in dataFrame.iterrows(): content = OrderedDict(row) tmpRes = JsonManager.createData(content) dataFrame.at[index, 'Detector'] = rm.removeMiRNAIdentifier( dataFrame.at[index, "Detector"]) dataToWrite.append(tmpRes) JsonManager.writeJSON(dataToWrite, file) (dataFrame.fillna(0)).to_csv("./data/result.csv", header=None)
def parser(): ''' Creates the csv and the json ''' dataToWrite = [] for index, row in dataFrame.iterrows(): content = OrderedDict(row) tmpRes = JsonManager.createData(content) dataFrame.at[index,'Detector'] = rm.removeMiRNAIdentifier(dataFrame.at[index, "Detector"]) dataToWrite.append(tmpRes) JsonManager.writeJSON(dataToWrite, file) (dataFrame.fillna(0)).to_csv("./data/result.csv", header=None)
writer = csv.writer(file) for elementName in miRNAList: genes = searchForTarget(elementName) genes.insert(0, elementName) if len(genes) > 1: writer.writerow(genes) file.close() """ The following is the main class of the software. It is used to open a dataset written in an excel file """ filesPath, file = JsonManager.initPath('results') # Open DataSet datasetFilename = filesPath + 'Dati HF-LF_3_6_12 mesi.xlsx' # Local Section localDBFilename = filesPath + 'localDB.xls' dataFrame = getDataFrameFromExcel(datasetFilename, 'Sheet1') dataFrame.loc[:, 'Targets'] = 'Waiting' localDF = getDataFrameFromExcel(localDBFilename, 'miRTarBase') # Creates a dataframe containing only the miRNA under consideration miRNAList = getMiRNAList() # Obtains the data frame including the miRNAs
file = open('./data/resTarget.csv', 'w', newline="") writer = csv.writer(file) for elementName in miRNAList: genes = searchForTarget(elementName) genes.insert(0, elementName) if len(genes) > 1: writer.writerow(genes) file.close() """ The following is the main class of the software. It is used to open a dataset written in an excel file """ filesPath, file = JsonManager.initPath('results') # Open DataSet datasetFilename = filesPath + 'Dati HF-LF_3_6_12 mesi.xlsx' # Local Section localDBFilename = filesPath + 'localDB.xls' dataFrame = getDataFrameFromExcel(datasetFilename, 'Sheet1') dataFrame.loc[:, 'Targets'] = 'Waiting' localDF = getDataFrameFromExcel(localDBFilename, 'miRTarBase') # Creates a dataframe containing only the miRNA under consideration miRNAList = getMiRNAList() # Obtains the data frame including the miRNAs