Mercurial > repos > greg > validate_affy_metadata
comparison validate_affy_metadata.py @ 21:90688364136c draft
Uploaded
| author | greg |
|---|---|
| date | Thu, 14 Feb 2019 13:13:33 -0500 |
| parents | 38166b76f47a |
| children | 84478b80cc47 |
comparison
equal
deleted
inserted
replaced
| 20:2df07ae9af2d | 21:90688364136c |
|---|---|
| 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) != 28: | 79 if len(items) != 30: |
| 80 accumulated_msgs = add_error_msg(accumulated_msgs, "Line %d contains %s columns, (must be 28)." % (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] |
| 85 if len(user_specimen_id) == 0: | 85 if len(user_specimen_id) == 0: |
| 153 # Optional. | 153 # Optional. |
| 154 public = string_as_boolean_string(items[26]) | 154 public = string_as_boolean_string(items[26]) |
| 155 # Optional. | 155 # Optional. |
| 156 public_after_date = items[27] | 156 public_after_date = items[27] |
| 157 accumulated_msga = validate_date_string(i, public_after_date, accumulated_msgs) | 157 accumulated_msga = validate_date_string(i, public_after_date, accumulated_msgs) |
| 158 # Required and validated. | |
| 159 sperm_motility = items[28] | |
| 160 accumulated_msgs = validate_decimal(i, sperm_motility, accumulated_msgs) | |
| 161 # Required and validated. | |
| 162 healing_time = items[29] | |
| 163 accumulated_msgs = validate_decimal(i, healing_time, accumulated_msgs) | |
| 158 | 164 |
| 159 if len(accumulated_msgs) > 0: | 165 if len(accumulated_msgs) > 0: |
| 160 stop_error(accumulated_msgs) | 166 stop_error(accumulated_msgs) |
| 161 | 167 |
| 162 shutil.copyfile(args.input, args.output) | 168 shutil.copyfile(args.input, args.output) |
