bjbvoesenek / qPCR-analysis

GNU General Public License v3.0
1 stars 0 forks source link

Script throws an error when not enough arguments have been passed. #5

Closed ifokkema closed 1 year ago

ifokkema commented 1 year ago

Although the web wrapper will make sure there are three arguments, the code does not check for it. It's common practice to handle such cases nicely.

Instead of the current output:

Traceback (most recent call last):
  File "qpcr_analysis.py", line 12, in <module>
    input_file = str(sys.argv[1])
IndexError: list index out of range

It would be useful to produce a short "usage" output, e.g.:

Error: Not enough arguments. A minimum of three arguments are required.
Usage:
    python3 qpcr_analysis.py <input file> <housekeeping gene 1> <housekeeping gene 2>

input file          : An .xlsx file saved from LinRegPCR.
housekeeping gene 1 : First housekeeping gene. Make sure you use the same case as used in the input file. E.g., GAPDH.
housekeeping gene 2 : Second housekeeping gene. Make sure you use the same case as used in the input file. E.g., Bactin.
bjbvoesenek commented 1 year ago

Will change! Thanks for your thorough testing Ivo!

bjbvoesenek commented 1 year ago

Should be fixed

ifokkema commented 1 year ago

Confirmed to be fixed in 9b9f172a5b265cb5955def23f33f368813aea9e1.