Skip to content

Commit c62f156

Browse files
committed
fixing some checks in options
1 parent d650d2b commit c62f156

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

neat/read_simulator/utils/options.py

+18-4
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ def check_and_log_error(keyname, value_to_check, lowval, highval):
187187
pass
188188
elif lowval != "exists" and highval:
189189
if not (lowval <= value_to_check <= highval):
190-
raise ValueError(f'@{keyname} must be between {lowval} and {highval}.\nYour input: {value_to_check}')
190+
mssg = f'`{keyname}` must be between {lowval} and {highval} (input: {value_to_check}).'
191+
_LOG.error(mssg)
192+
raise ValueError(mssg)
193+
191194
elif lowval == "exists" and value_to_check:
192195
validate_input_path(value_to_check)
193196

@@ -204,11 +207,22 @@ def read(self):
204207
# if it's already set to the default value, ignore.
205208
if value == default or value == ".":
206209
continue
207-
208-
# Now we check that the type is correct and it is in range, depending on the type defined for it
210+
# check for empty
211+
if value is None:
212+
if key == "reference":
213+
mssg = "Must entered a value for `reference` in config"
214+
_LOG.error(mssg)
215+
raise ValueError(mssg)
216+
else:
217+
_LOG.warning(f"No value entered for `{key}`, skipping.")
218+
continue
219+
220+
# Now we check that the type is correct, and it is in range, depending on the type defined for it
209221
# If it passes that it gets put into the args dictionary.
210222
if value != type_of_var(value):
211-
raise ValueError(f"Incorrect type for value entered for {key}: {type_of_var} (found: {value})")
223+
mssg = f"Incorrect type for value entered for {key}: {type_of_var} (found: {value})"
224+
_LOG.error(mssg)
225+
raise ValueError(mssg)
212226

213227
self.check_and_log_error(key, value, criteria1, criteria2)
214228
self.args[key] = value

neat/read_simulator/utils/read.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def convert_masking(self, error_model: SequencingErrorModel):
371371
modified_segment += base
372372
else:
373373
modified_segment += repeat_bases[i % 6]
374-
self.num_ns += 1
374+
self.quality_array[i] = bad_score
375375
else:
376376
modified_segment = MutableSeq(raw_sequence)
377377

0 commit comments

Comments
 (0)