CLI reference
APB2 exposes three commands:
| Command | Purpose | Guide |
|---|---|---|
apb2 convert |
Parse a vendor table or result directory into HDF5, Parquet, or DuckDB | Convert vendor results |
apb2 reformat |
Change the storage format of an APB2 result | Read and write results |
apb2 annotate |
Attach sample metadata to an APB2 result | Annotate samples |
Use apb2 --help or a command's --help for the installed version's generated Cyclopts reference.
The support matrix lists compatible vendor versions, inputs, parameter
parsers, and quantification levels.
apb2 convert
apb2 convert DATA [LEVEL] [OPTIONS]
| Argument or option | Meaning |
|---|---|
DATA |
Vendor result table or directory containing named result tables |
LEVEL |
Optional quantification level; omit it to write every compatible level |
--params PATH |
Vendor search-parameter file; repeat it for a tool that writes two (MetaMorpheus, quantms); omit only for an explicit rule or a parameter-free packaged rule |
--rule-config PATH |
Explicit schema-0.11 rule document |
--software NAME |
Parameter-file grammar and result-rule hint; required without --params for parameter-free packaged rules such as pb_custom |
--format FORMAT |
hdf5, parquet, or duckdb; default hdf5; duckdb needs pip install 'apb2[duckdb]' |
--output BASENAME |
Output basename without the selected suffix |
--strict |
An effectively empty layer is an error, not left out with a finding |
--timings-output PATH |
Separate JSON file of internal compile, read, parse and write durations; the path must not exist |
Use --params for ordinary packaged rules, --software pb_custom for a parameter-free ProteoBench Custom upload, or --rule-config for an explicit rule. A directory supplies multi-file table groups. An explicit LEVEL selects one decomposition; omission converts all supported levels. HDF5 uses .h5ad for an explicit level and .h5mu otherwise. Parquet and DuckDB retain their suffixes. Compatible one-to-one observation aliases are aligned; incompatible resolutions get separate key-qualified outputs, such as result.raw_file.h5mu and result.experiment.h5mu. The CLI reports every actual path; see output naming.
Every conversion step logs a step=<name> start line and a done or failed line with its seconds and the process's peak resident memory so far (peak_rss_gb; n/a on Windows): detect, with prepare.read and prepare.join inside it for inputs a preparation hook combines, then per level read, parse.decompose, parse.obs, parse.var, parse.layers, parse.validate and parse.park, and finally write. A process the operating system kills for memory writes no error; its last start line names the step it died in.
See Convert vendor results for worked examples.
apb2 reformat
apb2 reformat SOURCE TARGET
SOURCE and TARGET must end in .h5ad, .h5mu, .parquet, or .duckdb. No additional option
changes the result semantics.
See Read and write parsed results for format contracts and fidelity.
apb2 annotate
apb2 annotate SOURCE ANNOTATION TARGET [OPTIONS]
| Argument or option | Meaning |
|---|---|
SOURCE |
Existing APB2 h5ad, h5mu, Parquet, or DuckDB result |
ANNOTATION |
SDRF-Proteomics or generic prolfquapp-style CSV/TSV table |
TARGET |
New annotated APB2 result; format selected by suffix |
--unmatched MODE |
keep, error, or drop behavior |
--include COLUMN |
In drop mode, also require a true Boolean annotation field |
ProteoBench module annotation is provided by the separate apb-proteobench benchmark command, which annotates and scores an existing APB2 result. See Annotate samples.
Exit behavior
0: operation completed successfully1: expected input, selection, parsing, result-format, or writing failure, including aconvertwithout--params,--softwareor--rule-config2: command-line usage, rejected output naming, or an existing--timings-outputfile
Unexpected programming errors are not broadly swallowed; they remain visible with their traceback.