diff options
author | Frederick Muriuki Muriithi | 2022-05-20 10:36:48 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-05-20 10:36:48 +0300 |
commit | 960c1a5b831d8761a3e1716f86ded4cc5b67eea0 (patch) | |
tree | d82d03b094a7bd3a21f088c95cfdc84788d5717a | |
parent | 53a1f36b4e910ea9706d427530b5fa6acfe917cc (diff) | |
download | gn-uploader-960c1a5b831d8761a3e1716f86ded4cc5b67eea0.tar.gz |
Accept exponential notation for standard-error files
-rw-r--r-- | README.org | 7 | ||||
-rw-r--r-- | quality_control/standard_error.py | 2 |
2 files changed, 5 insertions, 4 deletions
@@ -19,9 +19,10 @@ following criteria: - No empty data cells - no data cells with spurious characters like `eeeee`, `5.555iloveguix`, etc. - decimal numbers must conform to the following criteria: -- - when checking an average file decimal numbers must contain exactly three places to the right side of the dot. -- - when checking a standard error file decimal numbers must contain six or greater places to the right side of the dot. -- - there must be a number to the left side of the dot (e.g. 0.55555 is allowed but .55555 is not). + - when checking an average file decimal numbers must contain exactly three places to the right side of the dot. + - when checking a standard error file decimal numbers must contain six or greater places to the right side of the dot. + - there must be a number to the left side of the dot (e.g. 0.55555 is allowed but .55555 is not). + - when checking the standard error file, also accept exponential notation with at least 6 decimal places e.g. 0.3423452E-13 - check line endings to make sure they are Unix and not DOS - check strain headers against a source of truth (see strains.csv) diff --git a/quality_control/standard_error.py b/quality_control/standard_error.py index c866993..5489ade 100644 --- a/quality_control/standard_error.py +++ b/quality_control/standard_error.py @@ -12,7 +12,7 @@ def invalid_value( `val` is not a valid input for standard error files, otherwise, it returns `None`. """ - if re.search(r"^[0-9]+\.[0-9]{6,}$", val): + if re.search(r"(^[0-9]+\.[0-9]{6,}$|^[0-9]+\.[0-9]{6,}[eE]-[0-9]+$)", val): return None return InvalidValue( line_number, column_number, val, ( |