Mercurial > repos > computational-metabolomics > sirius_csifingerid
comparison sirius_csifingerid.py @ 4:8fb51147d15e draft
"planemo upload for repository https://github.com/computational-metabolomics/sirius_csifingerid_galaxy commit fdeefc696443bc3aadf08d4df7226cb6f91d0388"
| author | computational-metabolomics |
|---|---|
| date | Fri, 04 Feb 2022 10:09:40 +0000 |
| parents | 4cbfd3d0a4c4 |
| children | 96b077221201 |
comparison
equal
deleted
inserted
replaced
| 3:4cbfd3d0a4c4 | 4:8fb51147d15e |
|---|---|
| 388 reader = csv.DictReader(infile, delimiter='\t') | 388 reader = csv.DictReader(infile, delimiter='\t') |
| 389 | 389 |
| 390 ad = paramds[fn.split(os.sep)[-2]]['additional_details'] | 390 ad = paramds[fn.split(os.sep)[-2]]['additional_details'] |
| 391 | 391 |
| 392 for line in reader: | 392 for line in reader: |
| 393 if 'rank' in line and \ | 393 if 'rank' in line \ |
| 394 0 < int(rank_filter) < int(line['rank']): | 394 and 0 < int(rank_filter) < int(line['rank']): |
| 395 # filter out those annotations greater than rank filter | 395 # filter out those annotations greater than rank filter |
| 396 # If rank_filter is zero then skip | 396 # If rank_filter is zero then skip |
| 397 continue | 397 continue |
| 398 | 398 |
| 399 if 'ConfidenceScore' in line \ | 399 if ('ConfidenceScore' in line |
| 400 and 0 < int(confidence_filter) < int(line['rank']): | 400 and 0 < float(confidence_filter) |
| 401 # filter out those annotations greater than rank filter | 401 and float(line['ConfidenceScore']) < |
| 402 # If rank_filter is zero then skip | 402 float(confidence_filter)): |
| 403 # filter out those annotations that are less than | |
| 404 # the confidence filter value | |
| 403 continue | 405 continue |
| 404 line.update(ad) | 406 line.update(ad) |
| 405 | 407 |
| 406 dwriter.writerow(line) | 408 dwriter.writerow(line) |
| 407 | 409 |
| 412 os.system(s1) | 414 os.system(s1) |
| 413 s2 = "sed 's/CSI:FingerIDScore/Score/' {r} > {r}".format(r=result_pth) | 415 s2 = "sed 's/CSI:FingerIDScore/Score/' {r} > {r}".format(r=result_pth) |
| 414 os.system(s2) | 416 os.system(s2) |
| 415 | 417 |
| 416 | 418 |
| 417 concat_output('canopus_summary.tsv', | 419 concat_output('compound_identifications.tsv', |
| 418 args.canopus_result_pth, | 420 args.annotations_result_pth, |
| 419 args.rank_filter, | 421 args.rank_filter, |
| 420 args.confidence_filter, | 422 args.confidence_filter, |
| 421 args.backwards_compatible) | 423 args.backwards_compatible) |
| 422 concat_output('compound_identifications.tsv', | 424 concat_output('canopus_summary.tsv', |
| 423 args.annotations_result_pth, | 425 args.canopus_result_pth, |
| 424 0, | 426 0, |
| 425 0, | 427 0, |
| 426 False) | 428 False) |
