comparison validate_affy_metadata.py @ 23:84478b80cc47 draft

Uploaded
author greg
date Fri, 15 Feb 2019 08:57:22 -0500
parents 90688364136c
children 8a826d1afe69
comparison
equal deleted inserted replaced
22:e5f68d7f238e 23:84478b80cc47
74 line = line.rstrip("\r\n") 74 line = line.rstrip("\r\n")
75 if i > 97: 75 if i > 97:
76 accumulated_msgs = add_error_msg(accumulated_msgs, "The input file contains more than 97 lines (must be 1 header line and no more than 96 data lines).") 76 accumulated_msgs = add_error_msg(accumulated_msgs, "The input file contains more than 97 lines (must be 1 header line and no more than 96 data lines).")
77 stop_error(accumulated_msgs) 77 stop_error(accumulated_msgs)
78 items = line.split("\t") 78 items = line.split("\t")
79 if len(items) != 30: 79 if len(items) != 32:
80 accumulated_msgs = add_error_msg(accumulated_msgs, "Line %d contains %s columns, (must be 30)." % (i, len(items))) 80 accumulated_msgs = add_error_msg(accumulated_msgs, "Line %d contains %s columns, (must be 30)." % (i, len(items)))
81 stop_error(accumulated_msgs) 81 stop_error(accumulated_msgs)
82 # Required and validated. 82 # Required and validated.
83 # Required. 83 # Required.
84 user_specimen_id = items[0] 84 user_specimen_id = items[0]
159 sperm_motility = items[28] 159 sperm_motility = items[28]
160 accumulated_msgs = validate_decimal(i, sperm_motility, accumulated_msgs) 160 accumulated_msgs = validate_decimal(i, sperm_motility, accumulated_msgs)
161 # Required and validated. 161 # Required and validated.
162 healing_time = items[29] 162 healing_time = items[29]
163 accumulated_msgs = validate_decimal(i, healing_time, accumulated_msgs) 163 accumulated_msgs = validate_decimal(i, healing_time, accumulated_msgs)
164 # Optional.
165 dna_extraction_method = items[9]
166 # Optional.
167 dna_concentration = items[31]
168 # If dna_concentration has a value, then it must be decimal.
169 if len(dna_concentration) > 0:
170 accumulated_msgs = validate_decimal(i, dna_concentration, accumulated_msgs)
171
164 172
165 if len(accumulated_msgs) > 0: 173 if len(accumulated_msgs) > 0:
166 stop_error(accumulated_msgs) 174 stop_error(accumulated_msgs)
167 175
168 shutil.copyfile(args.input, args.output) 176 shutil.copyfile(args.input, args.output)