Add flowcell/lane information for a library to the rest hts api.
[htsworkflow.git] / htsworkflow / frontend / experiments / experiments.py
index 4d9dac15715e078e3a131fa36260e080d32edd20..7f492a6fc85e174edefb55303e25fa403345404e 100755 (executable)
@@ -39,14 +39,20 @@ def flowcell_information(flowcell_id):
             'library_name': lane.library.library_name,
             'library_id': lane.library.id,
             'library_species': lane.library.library_species.scientific_name,
-            'pM': float(lane.pM),
-            'read_length': fc.read_length
+            'pM': unicode(lane.pM),
+            'read_length': lane.flowcell.read_length
         }
+
+    if fc.control_lane is None:
+        control_lane = None
+    else:
+        control_lane = int(fc.control_lane)
+        
     info = {
         'advanced_run': fc.advanced_run,
         'cluster_station_id': fc.cluster_station_id,
         'cluster_station': fc.cluster_station.name,
-        'control_lane': int(fc.control_lane),
+        'control_lane': control_lane,
         # 'datarun_set': how should this be represented?,
         'flowcell_id': fc.flowcell_id,
         'id': fc.id,