Improve error message
skodapetr opened this issue · 1 comments
skodapetr commented
For example when using following command:
./p2rank_2.0.1/prank -t data/2020-01/mg/dataset-train.ds -e data/2020-01/mg/dataset-train.ds -o mg
the output is:
----------------------------------------------------------------------------------------------
P2Rank 2.0.1
----------------------------------------------------------------------------------------------
uasge:
prank <command> <dataset.ds> [options]
commands:
predict ... predict pockets (P2RANK)
eval-predict ... evaluate model on a dataset with known ligands
rescore ... rescore previously detected pockets (PRANK)
eval-rescore ... evaluate rescoring model on a dataset with known ligands
datasets:
Dataset files for prediction should contain list of pdb files.
Dataset files for rescoring should contain list of protein files
that are outputs of one of the supported pocket prediction methods
(fpocket, ConCavity). In datasets for evaluation and training they
must be paired with liganated-proteins (correct solutions).
See example datasets in test_data/ directory.
options:
-f <path> run on single pdb file instead of a dataset
-c <path> use configuration file that overrides default configuration
in config/default.groovy, path relative to config/ directory
-m <path> use previously trained classifier file relative to models/ directory
default: models/default.model
-o <path> specify output directory (relative to working dir)
default: test_output/<comamnd>_<dataset>
other parameters:
-threads <int> number of execution threads
dafault: num. of processors + 1
-visualizations <0/1> produce PyMOL visualizations
default: true
-<param> <value> for full list of parameters see config/default.groovy
----------------------------------------------------------------------------------------------
finished with ERROR in 0.117 seconds
log output is:
[INFO] ConsoleWriter - ----------------------------------------------------------------------------------------------
[INFO] ConsoleWriter - P2Rank 2.0.1
[INFO] ConsoleWriter - ----------------------------------------------------------------------------------------------
[INFO] ConsoleWriter -
[INFO] ConsoleWriter -
[INFO] ConsoleWriter - ----------------------------------------------------------------------------------------------
[INFO] ConsoleWriter - finished with ERROR in 0.117 seconds
[INFO] ConsoleWriter - ----------------------------------------------------------------------------------------------
From none of the output, I immediately see that I have not provided the command options.
For example, commons-cli provide nice message when mandatory argument is omitted, something similar can make p2rank more user friendly.
rdk commented
Better error messages and command line arguments validation is implemented on develop branch and will be released in v 2.3 .