From 70b19a804108ff8c49797d120f1b73b2548f0ce7 Mon Sep 17 00:00:00 2001 From: Robert Ernst Date: Mon, 9 Aug 2021 16:52:21 +0200 Subject: [PATCH] Fix tecan samplesheet for pools and python3 fixes --- clarity_epp/export/tecan.py | 7 +++++-- clarity_epp/export/utils.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/clarity_epp/export/tecan.py b/clarity_epp/export/tecan.py index b9440fc..e444c23 100755 --- a/clarity_epp/export/tecan.py +++ b/clarity_epp/export/tecan.py @@ -11,9 +11,12 @@ def samplesheet(lims, process_id, output_file): process = Process(lims, id=process_id) well_plate = {} - for placement, artifact in process.output_containers()[0].placements.iteritems(): + for placement, artifact in process.output_containers()[0].placements.items(): placement = ''.join(placement.split(':')) - well_plate[placement] = artifact.name.split('_')[0] + if len(artifact.samples) == 1: # Remove 'meet_id' from artifact name if artifact is not a pool + well_plate[placement] = artifact.name.split('_')[0] + else: + well_plate[placement] = artifact.name for well in clarity_epp.export.utils.sort_96_well_plate(well_plate.keys()): output_file.write('{well}\t{sample}\n'.format( diff --git a/clarity_epp/export/utils.py b/clarity_epp/export/utils.py index f9ca27a..2193ed8 100755 --- a/clarity_epp/export/utils.py +++ b/clarity_epp/export/utils.py @@ -17,7 +17,7 @@ def sort_96_well_plate(wells): ] order = dict(zip(order, range(len(order)))) - wells.sort(key=lambda val: order[val]) + wells = sorted(wells, key=lambda val: order[val]) return wells