diff id_converter.py @ 17:1e45ea50f145 draft

planemo upload commit 640429adac783e2354f5caf12d7b6b81b8ddf54f-dirty
author proteore
date Thu, 07 Mar 2019 07:49:18 -0500
parents b6607b7e683f
children 5252bbcfbdd7
line wrap: on
line diff
--- a/id_converter.py	Mon Jan 28 11:08:47 2019 -0500
+++ b/id_converter.py	Thu Mar 07 07:49:18 2019 -0500
@@ -44,6 +44,7 @@
     for line in input_file :
         if line != [] and set(line) != {''}: 
             line[nb_col] = re.sub(r"\s+","",line[nb_col])
+            if line[nb_col] == "" : line[nb_col]='NA'
             if ";" in line[nb_col] :
                 ids = line[nb_col].split(";")
                 for id in ids :
@@ -119,6 +120,7 @@
     if args.input_type=="file" :
         args.column_number = nb_col_to_int(args.column_number)
         header = str2bool(args.header)
+    
 
     #Get ref file to build dictionary
     csv.field_size_limit(sys.maxsize) # to handle big files
@@ -151,7 +153,7 @@
     if args.input_type == "list" :
         ids = get_input_ids_from_string(args.input)
     elif args.input_type == "file" :
-        input_file, ids = get_input_ids_from_file(args.input,args.column_number,args.header)
+        input_file, ids = get_input_ids_from_file(args.input,args.column_number,header)
 
     #Mapping ids
     result_dict = map_to_dictionary(ids,ids_dictionary,args.id_type,target_ids)