Skip to content

Commit

Permalink
Merge pull request #129 from compomics/feature/document-config-extens…
Browse files Browse the repository at this point in the history
…ions

Document supported and allowed extensions for config file
  • Loading branch information
RalfG authored Jan 25, 2021
2 parents 7c443cd + 8873336 commit b7df0fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ MS²PIP predictions can be compared to spectra in an
### Command line interface
```
usage: ms2pip [-h] -c CONFIG_FILE [-s MGF_FILE] [-w FEATURE_VECTOR_OUTPUT]
[-r] [-x] [-t] [-n NUM_CPU]
[-r] [-x] [-m] [-t] [-n NUM_CPU] [--sqldb-uri SQLDB_URI]
<PEPREC file>
positional arguments:
Expand All @@ -131,9 +131,14 @@ optional arguments:
-r, --retention-time add retention time predictions (requires DeepLC python
package)
-x, --correlations calculate correlations (if MGF is given)
-m, --match-spectra match peptides to spectra based on predicted spectra
(if MGF is given)
-t, --tableau create Tableau Reader file
-n NUM_CPU, --num-cpu NUM_CPU
number of CPUs to use (default: all available)
--sqldb-uri SQLDB_URI
use sql database of observed spectra instead of MGF
files
```

### Input files
Expand Down
2 changes: 1 addition & 1 deletion ms2pip/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def argument_parser():
action="store",
required=True,
dest="config_file",
help="config file",
help="Configuration file: text-based (extensions `.txt`, `.config`, or `.ms2pip`) or TOML (extension `.toml`).",
)
parser.add_argument(
"-s", "--spectrum-file",
Expand Down
8 changes: 6 additions & 2 deletions ms2pip/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ def load(self, filepath=None, config_format=None):

if config_format == "toml":
self._load_toml()
elif config_format in ("txt", "config"):
elif config_format in ("txt", "config", "ms2pip"):
self._load_ms2pip_txt()
else:
raise UnsupportedConfigFormatError(config_format)
raise UnsupportedConfigFormatError(
"Configuration file should have extension `txt`, `config`, or "
"`ms2pip` (text-based format) or `toml` (TOML-based format), not "
f"`{config_format}`",
)

def write(self, filepath=None, config_format="toml"):
"""
Expand Down

0 comments on commit b7df0fc

Please sign in to comment.