Skip to content

Commit 65549cb

Browse files
update readme
1 parent c11edee commit 65549cb

File tree

1 file changed

+82
-3
lines changed

1 file changed

+82
-3
lines changed

README.md

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,87 @@ pip install mumble
2828
```
2929

3030

31-
### Basic Usage
31+
## Usage
3232

33-
Here's a quick example of how to use the PSM Modification Handler for single PSMs:
33+
### Command-Line Interface (CLI) Usage
34+
35+
Mumble provides a command-line interface to modify PSMs based on mass shifts, as well as several parameters for customization. You can use the `mumble` command to interact with the tool.
36+
37+
#### Basic Command Syntax
38+
39+
To run the CLI, use the following command:
40+
41+
```bash
42+
mumble [OPTIONS] INPUT_FILE
43+
```
44+
45+
Where `INPUT_FILE` is the path to the input file containing the PSM data.
46+
47+
#### Parameters:
48+
49+
Here are the available options you can pass when running the command:
50+
51+
- **`--psm-list`**: (required) Path to the input file containing the PSM data. Must be provided if not already set via arguments.
52+
- **`--modification-file`**: Path to a restriction list of modifications to use from Unimod. Defaults to `default_ptm_list.tsv` included with the package.
53+
- **`--psm-file-type`**: Type of the input file to read with PSM_utils (e.g., `mzid`, `tsv`). Default is "infer".
54+
- **`--aa-combinations`**: Number of amino acid combinations to add as modification. Requires a `fasta_file`. Default is `0`.
55+
- **`--fasta-file`**: Path to a fasta file (for use with `aa_combinations`).
56+
- **`--mass-error`**: Mass error for the mass shift, default is `0.02`.
57+
- **`--output-file`**: Path to the output file to write modified PSMs.
58+
- **`--filetype-write`**: Type of the output file to write with PSM_utils (e.g., `tsv`, `csv`). Default is `tsv`.
59+
- **`--include-decoy-psm`**: Flag to parse modifications for decoys in the modified PSM list.
60+
- **`--include-original-psm`**: Flag to keep the original PSMs in the modified PSM list.
61+
- **`--combination-length`**: Maximum number of modifications per combination. All lower numbers will be included as well. Default is `1`.
62+
- **`--exclude-mutations`**: If set, modifications with the classification 'AA substitution' will be excluded.
63+
- **`--config-file`**: Path to a config file for additional configuration parameters (e.g., custom modification sets, advanced settings).
64+
- **`--log-level`**: Set the logging level. Options: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`. Default is `INFO`.
65+
- **`--clear-cache`**: Remove the modification cache file and exit early.
66+
- **`--all-unimod-modifications`**: Use all available modifications from Unimod instead of a subset.
67+
68+
#### Examples:
69+
70+
1. **Modify a single PSM**:
71+
```bash
72+
mumble --psm-list "path/to/psm_file.mzid" --mass-error 0.02 --output-file "modified_psms.tsv"
73+
```
74+
75+
2. **Modify a list of PSMs with custom configurations**:
76+
```bash
77+
mumble --psm-list "path/to/psm_file.mzid" --fasta-file "path/to/proteins.fasta" --aa-combinations 5 --config-file "path/to/config_file.toml"
78+
```
79+
80+
3. **Clear the cache and exit**:
81+
```bash
82+
mumble --clear-cache
83+
```
84+
85+
4. **Using a custom modification file**:
86+
```bash
87+
mumble --psm-list "path/to/psm_file.mzid" --modification-file "path/to/custom_ptm_list.tsv"
88+
```
89+
90+
#### Config file usage
91+
92+
You can also use a configuration file to specify options that will be loaded automatically when running the command. This allows you to store commonly used parameters without needing to pass them every time.
93+
94+
Example configuration file (`config_file.json`):
95+
96+
```json
97+
{"mass_error" : 0.05
98+
"aa_combinations" : 2
99+
"psm_file_type" : "mzid"
100+
"output_file" : "output.tsv"
101+
}
102+
```
103+
104+
You can then specify the path to this file using the `--config-file` option:
105+
106+
```bash
107+
mumble --config-file "path/to/config_file.toml"
108+
```
109+
110+
### Python API
111+
Here's a quick example of how to use the PSM Modification Handler through the python API for single PSMs:
34112

35113
```python
36114
>>> from mumble import PSMHandler
@@ -59,7 +137,7 @@ Here's a quick example of how to use the PSM Modification Handler for single PSM
59137
# )
60138
# ]
61139
```
62-
Here's a quick example of how to use the PSM Modification Handler for PSM lists:
140+
Here's a quick example of how to use the PSM Modification Handler through the python API for PSM lists:
63141
```python
64142
>>> # Or load a PSM list (from a file or PSMList object)
65143
>>> psm_list = psm_handler.parse_psm_list("path/to/psm_file.mzid", psm_file_type="mzid")
@@ -71,6 +149,7 @@ Here's a quick example of how to use the PSM Modification Handler for PSM lists:
71149
>>> psm_handler.write_modified_psm_list(modified_psm_list, output_file="modified_psms.tsv", psm_file_type="tsv")
72150
```
73151
For more information on PSM objects and PSM lists visit [psm_utils](https://github.com/compomics/psm_utils)
152+
74153
## Testing
75154

76155
The project includes unit tests using `pytest` to ensure code reliability.

0 commit comments

Comments
 (0)