changeset 6:3870c546db18 draft

planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/albacore commit 1514f4060da0b3a7866ac36d8a389828cbf48bd7
author jdv
date Tue, 23 Jan 2018 14:24:39 -0500
parents 4d72adba794f
children ce1fa05ffb6c
files albacore_1D.py
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/albacore_1D.py	Fri Oct 20 23:10:23 2017 -0400
+++ b/albacore_1D.py	Tue Jan 23 14:24:39 2018 -0500
@@ -121,8 +121,19 @@
         test_file = files[0]
 
         f = h5py.File(test_file,"r")
-        flowcell = f["/UniqueGlobalKey/context_tags"].attrs["flowcell"].upper()
-        kit = f["/UniqueGlobalKey/context_tags"].attrs["sequencing_kit"].upper()
+        #TODO: clean up attribute checking
+        try:
+            flowcell = f["/UniqueGlobalKey/context_tags"].attrs["flowcell"].upper()
+        except:
+            try:
+                flowcell = f["/UniqueGlobalKey/context_tags"].attrs["flowcell_type"].upper()
+            except:
+                raise ValueError('No attribute found for flowcell type')
+        try:
+            kit = f["/UniqueGlobalKey/context_tags"].attrs["sequencing_kit"].upper()
+        except:
+            raise ValueError('No attribute found for sequencing kit')
+            
     except OSError as e:
         print("Unexpected error:", e.strerror)
         raise