def get_iTRAQ_pep_raw_XLS(f, iTRAQ_reporter_ions, entrez): iTRAQ_data_raw = {} with report.reader(f) as rdr: for row in rdr: seq, mods, acc = (row.seq, row.var_mods, row.acc) acc = acc.replace(" ", "") gene = entrez[acc].upper() pep = functions.mz_pep_format(seq, mods) #Raw Values raw_counts = [] for ion in iTRAQ_reporter_ions: raw_counts.append(float(row["Rep%d" % ion])) raw_counts = array(raw_counts) key = "%s_%s" % (gene, pep) #Sum intensities per peptide per protein if key in iTRAQ_data_raw: iTRAQ_data_raw[key] += raw_counts else: iTRAQ_data_raw[key] = raw_counts return iTRAQ_data_raw
def get_entrez_XLS(f): #Store Entrez gene names with report.reader(f, sheet_name='GenBank_Info') as genbank: entrez = dict((row.acc, (row.gene).upper()) for row in genbank) return entrez