Update archive script to try and deal with HiSeq multiplexed lanes.
authorDiane Trout <diane@caltech.edu>
Wed, 7 Mar 2012 23:59:42 +0000 (15:59 -0800)
committerDiane Trout <diane@caltech.edu>
Wed, 7 Mar 2012 23:59:42 +0000 (15:59 -0800)
scripts/htsw-update-archive

index 0cf33f3c0d886d84efc26cd0592ed2d1a4b0441b..aeabc57ff20189d716746de5f1afa7d8494f51eb 100755 (executable)
@@ -36,8 +36,12 @@ def build_flowcell_db(fcdb_filename, sequences, baseurl, apiid, apikey):
 
         # make library id db
         if flowcell_info is not None:
-            seq_library_id = flowcell_info['lane_set'][unicode(seq.lane)]['library_id']
-            libdb.setdefault(seq_library_id, []).append(seq)
+            lane_collection = flowcell_info['lane_set'][unicode(seq.lane)]
+            if type(lane_collection) != type([]):
+                lane_collection = [lane_collection]
+            for sample in lane_collection:
+                seq_library_id = sample['library_id']
+                libdb.setdefault(seq_library_id, []).append(seq)
 
     fcdb.sync()
     return fcdb, libdb