comparison unipept.py @ 6:9aaa46d45472 draft

"planemo upload for repository http://unipept.ugent.be/apidocs commit 228074586987e33782b8c2faf61257ac7506e51e"
author galaxyp
date Tue, 02 Jun 2020 10:30:01 -0400
parents 917fd3ebc223
children 75b3b3d0adbf
comparison
equal deleted inserted replaced
5:917fd3ebc223 6:9aaa46d45472
335 if 'ec' in pdict: 335 if 'ec' in pdict:
336 for ec in pdict['ec']: 336 for ec in pdict['ec']:
337 ec_numbers.append(ec['ec_number']) 337 ec_numbers.append(ec['ec_number'])
338 protein_counts.append(str(ec['protein_count'])) 338 protein_counts.append(str(ec['protein_count']))
339 if extra: 339 if extra:
340 ec_names.append(ec['name'] if 'name' in ec else '') 340 ec_names.append(ec['name'] if 'name' in ec and ec['name'] else '')
341 vals = [','.join(ec_numbers), ','.join(protein_counts)] 341 vals = [','.join(ec_numbers), ','.join(protein_counts)]
342 if extra: 342 if extra:
343 vals.append(','.join(ec_names)) 343 vals.append(','.join(ec_names))
344 ec_dict[peptide] = vals 344 ec_dict[peptide] = vals
345 return (ec_dict, ec_cols) 345 return (ec_dict, ec_cols)
358 for go in pdict['go']: 358 for go in pdict['go']:
359 if 'go_term' in go: 359 if 'go_term' in go:
360 go_terms.append(go['go_term']) 360 go_terms.append(go['go_term'])
361 protein_counts.append(str(go['protein_count'])) 361 protein_counts.append(str(go['protein_count']))
362 if extra: 362 if extra:
363 go_names.append(go['name'] if 'name' in go else '') 363 go_names.append(go['name'] if 'name' in go and go['name'] else '')
364 else: 364 else:
365 for go_type in go_types: 365 for go_type in go_types:
366 if go_type in go: 366 if go_type in go:
367 for _go in go[go_type]: 367 for _go in go[go_type]:
368 go_terms.append(_go['go_term']) 368 go_terms.append(_go['go_term'])
369 protein_counts.append(str(_go['protein_count'])) 369 protein_counts.append(str(_go['protein_count']))
370 if extra: 370 if extra:
371 go_names.append(_go['name'] if 'name' in _go else '') 371 go_names.append(_go['name'] if 'name' in _go and _go['name'] else '')
372 vals = [','.join(go_terms), ','.join(protein_counts)] 372 vals = [','.join(go_terms), ','.join(protein_counts)]
373 if extra: 373 if extra:
374 vals.append(','.join(go_names)) 374 vals.append(','.join(go_names))
375 go_dict[peptide] = vals 375 go_dict[peptide] = vals
376 return (go_dict, go_cols) 376 return (go_dict, go_cols)