Every error pyMzLib raises tells you whose problem it is, so you know whether to fix your call,
retry later, or report a bug.
Exception
Whose problem
What to do
UsageError
Your call: a missing file, a malformed accession, a format without the view you asked for, an option without a value
Fix the call. Most are raised before any process starts.
ServiceUnavailableError
A remote service: PRIDE, UniProt or the Gene Ontology server was down, rate-limiting, timed out, or dropped the connection
Retry later. Not your bug, and not pyMzLib's.
BridgeError
mzLib: it read your input and failed, or rejected it. error_type is mzLib's own exception type, such as MzLibException
Read the message; it usually names the file and line. If it looks like a defect, report it.
BridgeTimeoutError
Time: the call ran past the timeout you gave
Give it longer, or a smaller input. pyMzLib will not guess whether the bridge was slow or stuck.
ProjectNotFoundError
The accession: PRIDE has no project by that name, or it has no files
Check the accession for a typo. Raised by pymzlib.pride only.
BridgeNotFoundError
The install: no bridge for this platform, or PYMZLIB_BRIDGE points at nothing
Reinstall the wheel; in a source checkout, build the bridge.
They nest, so you can catch as broadly or as narrowly as you like:
PyMzLibError every pyMzLib error
├── UsageError your call
├── BridgeError mzLib failed; .error_type says how
│ └── ServiceUnavailableError a remote service failed: retry
├── BridgeTimeoutError
├── BridgeNotFoundError
└── pride.ProjectNotFoundError no such PRIDE project
A typical pattern retries outages and reports everything else:
Each verb's spec lists the errors it can raise and when. They are collected here, so you can see in
one place what a call can do wrong. The same tables appear on each verb's reference page. "Kind" is
the bridge's language-neutral name for the error; "pyMzLib raises" is the Python exception.
neither or both of gtf and gene-set; a missing GTF, gene set or xref; any database-selection error proteins read raises
correctness
BridgeError
a GTF gene row without gene_id (InvalidDataException); an xref whose header is not Ensembl's nine columns; a compact gene table mzLib's reader refuses; a database mzLib cannot parse
no sequences on stdin; --from or --to not a registered format, or given without a value (the message lists the registered names); --mode not a SequenceConversionHandlingMode name; --threads 0 or below -1
usage
UsageError
--mode ThrowException and mzLib could not convert an input (the first in input order; the message names it and mzLib's reason)
correctness
BridgeError
mzLib threw something other than its SequenceConversionException (never seen at 0a808fec)
accession missing or blank; UniProt answers 400 or 404 (no such entry); the entry holds no protein sequence; protease not in ProteaseDictionary; dissociation or terminus not an enum name; an integer option that is not an integer
service_unavailable
ServiceUnavailableError
UniProt unreachable by the bridge's own classification: a timeout (HttpClient 100 s), a socket or TLS failure, a request that never got a response, an HTTP 408, 429 or 5xx, or a body cut off in transit
correctness
BridgeError
any other UniProt status (e.g. 403); UniProt's ptmlist.txt or PSI-MOD.obo.xml missing from the bridge payload (FileNotFoundException: every protein would otherwise look unmodified or carry wrong charges); mzLib failing to parse the entry or to digest it
accession or dest missing or blank; category given but blank; ext given but naming no extension; names-from-stdin together with category or ext; names-from-stdin with no non-blank line on stdin
usage
UsageError
names-from-stdin naming a file the project's manifest does not contain (the message lists up to five). Raised AFTER the matching files have been downloaded: they are on disk when the error arrives.
service_unavailable
ServiceUnavailableError
the bridge's own classification (Program.ClassifyError; since mzLib 1.0.593 (#1350) PRIDE raises every transport failure as an HttpRequestException carrying the cause or the status, and messages name the file and host, never the URL): a timeout, a socket or TLS failure, an HTTP 408, 429 or 5xx on the manifest or a file, a body that delivered nothing for mzLib's BodyStallTimeout (2 min), or a body cut off in transit
correctness
BridgeError
a selected file has no HTTPS location (NotSupportedException; Aspera-only); a manifest file name that is not a bare leaf name (ArgumentException: refusing to write outside dest); any other HTTP status; a local disk failure while writing (a bare IOException, e.g. a full disk, is deliberately NOT treated as an outage)
accession missing or blank; page-size not an integer
service_unavailable
ServiceUnavailableError
the bridge's own classification (Program.ClassifyError; since mzLib 1.0.593 (#1350) PRIDE raises every transport failure as an HttpRequestException carrying the cause or the status, and messages name the file and host, never the URL): a timeout or cancellation, a socket failure, an HttpRequestException with no status but an inner cause (refused connection, DNS, TLS), an HTTP 408, 429 or 5xx, or a response body cut off in transit
correctness
BridgeError
any other HTTP status (e.g. 404), a paging contract violation (MzLibException: an identical page while total_records says more remain), the MaxPages backstop (an HttpRequestException mzLib composes with no status and no inner exception, which ClassifyHttpFailure deliberately does not excuse as an outage), or page-size <= 0 (mzLib's ArgumentOutOfRangeException; the bridge does not check it first)
the bridge's own classification (Program.ClassifyError; since mzLib 1.0.593 (#1350) PRIDE raises every transport failure as an HttpRequestException carrying the cause or the status, and messages name the file and host, never the URL): a timeout or cancellation, a socket failure, a request that never got a response (refused connection, DNS, TLS), an HTTP 408, 429 or 5xx on the project lookup or on any directory listing, or a body cut off in transit
correctness
BridgeError
no project has that accession, or it has no publication date to locate its directory (MzLibException; the bindings re-map it to their not-found error); a directory listing answering any other status; nesting deeper than 64 levels (MzLibException: the listing may be cyclic)
keyword missing or blank; keyword longer than 1000 characters; page-size not an integer or <= 0 (both checked by the bridge before mzLib)
service_unavailable
ServiceUnavailableError
the bridge's own classification (Program.ClassifyError; since mzLib 1.0.593 (#1350) PRIDE raises every transport failure as an HttpRequestException carrying the cause or the status, and messages name the file and host, never the URL): a timeout or cancellation, a socket failure, a request that never got a response (refused connection, DNS, TLS), an HTTP 408, 429 or 5xx, or a body cut off in transit
correctness
BridgeError
any other HTTP status; a paging contract violation (MzLibException: an identical page while total_records says more remain); the page limit (mzLib MaxPages) exceeded
a missing groups table, database, go.obo or category map; a FASTA database; out or categories-out not .tsv, naming an input, naming each other, or in a folder that does not exist; categories-out without category-map; a negative offset or limit. Every one is raised before any file is read.
correctness
BridgeError
the database cites a GO id the release lacks, without skip-unknown-go-ids (InvalidDataException naming every id); a go.obo mzLib cannot parse, including a truncated one whose edges name absent terms (InvalidDataException with the line); a category map it refuses; a group written twice with different members (InvalidDataException); a table or database it cannot parse
no peptides; a peptide that is not non-empty A-Z (mzLib's ArgumentException, reclassified; the message names the peptide) - lower case and bracketed modifications included
usage
UsageError
on-error other than fail; any database-selection error proteins read raises; paths-stdin without the '--' line
neither or both of path and paths-stdin; contaminant with paths-stdin; no paths on stdin; a blank or repeated path; a role other than target/contaminant; accessions-stdin with no accessions; paths-stdin with accessions-stdin but no '--' line
usage
UsageError
tables names something else; threads 0 or < -1; on-error not fail/skip; an option given without a value
usage
UsageError
a database not named .xml or a FASTA extension; a missing database (under skip: recorded in files[i].error with kind usage)
correctness
BridgeError
mzLib cannot parse a database (malformed XML); under skip, recorded with kind correctness
psms missing or blank; the PSM file not found; nothing on stdin; a stdin line with no path; a run that is not .mzML; an mzML not found; two runs sharing a base name; a design field that is not a non-negative integer
usage
UsageError
the PSM file names runs with no mzML on stdin (checked before any spectra are read; the message lists up to five); ppm, isotope-ppm, mbr-ppm or mbr-q not a number; threads not an integer
correctness
BridgeError
the PSM file is of a type mzLib cannot read as quantifiable results (MzLibException), or is malformed; an mzML fails to parse; the FlashLFQ engine fails
peptides missing or blank, or not found; the file empty; a required column (Sequence, Base Sequence, Protein Groups) missing; no Intensity_ columns; a sequence on two rows; an intensity cell that is not a number; a Detection Type_ cell that is not a FlashLFQ DetectionType name
usage
UsageError
a design line with no run name, a run named twice, or a replicate/fraction that is not a non-negative integer; design runs with no Intensity_ column; Intensity_ runs the design does not mention (a design must name every run and only those)
path missing, blank or not found; mzLib does not recognise the file type
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
path missing or blank; file or directory not found; mzLib does not recognise the file type (the message points at readers formats)
usage
UsageError
offset, limit or out given with no value; offset or limit < 0; non-integer value; out resolves to the same file as path
usage
UsageError
the file has no ms1_features view
correctness
BridgeError
mzLib recognises the file and fails to parse it
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
correctness
BridgeError
with on-error fail, mzLib failing to parse an input: that input's own error type, message prefixed 'Input ()'
usage
UsageError
out (with path or paths-stdin) whose extension is not .tsv, any case, including none (PYB-1); checked before any input is opened
usage
UsageError
the answer is too large to return as one JSON document (PYB-3 part 1; measured: past the ~1.07 G-character .NET string ceiling, not RAM). Message: 'this read (N records) is too large to return as one document; use --limit/--offset or --out', N the parsed record_count
path missing or blank; file or directory not found; mzLib does not recognise the file type (the message points at readers formats)
usage
UsageError
offset, limit or out given with no value; offset or limit < 0; non-integer value; out resolves to the same file as path
usage
UsageError
the file has no spectral_match view
correctness
BridgeError
mzLib recognises the file and fails to parse it
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
correctness
BridgeError
with on-error fail, mzLib failing to parse an input: that input's own error type, message prefixed 'Input ()'
usage
UsageError
out (with path or paths-stdin) whose extension is not .tsv, any case, including none (PYB-1); checked before any input is opened
usage
UsageError
the answer is too large to return as one JSON document (PYB-3 part 1; measured: past the ~1.07 G-character .NET string ceiling, not RAM). Message: 'this read (N records) is too large to return as one document; use --limit/--offset or --out', N the parsed record_count
path missing or blank; file or directory not found; mzLib does not recognise the file type (the message points at readers formats)
usage
UsageError
offset, limit or out given with no value; offset or limit < 0; non-integer value; out resolves to the same file as path
usage
UsageError
the file is not a MetaMorpheus protein-group table
correctness
BridgeError
mzLib cannot parse the table (MzLibException). A single malformed cell does NOT fail the read: it is named in failed_fields and gives no rows
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
correctness
BridgeError
with on-error fail, mzLib failing to parse an input: that input's own error type, message prefixed 'Input ()'
usage
UsageError
out (with path or paths-stdin) whose extension is not .tsv, any case, including none (PYB-1); checked before any input is opened
usage
UsageError
the answer is too large to return as one JSON document (PYB-3 part 1; measured: past the ~1.07 G-character .NET string ceiling, not RAM). Message: 'this read (N records) is too large to return as one document; use --limit/--offset or --out', N the parsed record_count
path missing or blank; file or directory not found; mzLib does not recognise the file type (the message points at readers formats)
usage
UsageError
offset, limit or out given with no value; offset or limit < 0; non-integer value; out resolves to the same file as path
usage
UsageError
the file is not a MetaMorpheus protein-group table (the message names what it is and points at read-records)
correctness
BridgeError
mzLib cannot parse the table (MzLibException)
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
correctness
BridgeError
with on-error fail, mzLib failing to parse an input: that input's own error type, message prefixed 'Input ()'
usage
UsageError
out (with path or paths-stdin) whose extension is not .tsv, any case, including none (PYB-1); checked before any input is opened
usage
UsageError
the answer is too large to return as one JSON document (PYB-3 part 1; measured: past the ~1.07 G-character .NET string ceiling, not RAM). Message: 'this read (N records) is too large to return as one document; use --limit/--offset or --out', N the parsed record_count
path missing or blank; file or directory not found; mzLib does not recognise the file type (the message points at readers formats)
usage
UsageError
offset, limit or out given with no value; offset or limit < 0; non-integer value; out resolves to the same file as path
usage
UsageError
the file is not a FlashLFQ peptide table
correctness
BridgeError
mzLib cannot parse the table (MzLibException)
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
correctness
BridgeError
with on-error fail, mzLib failing to parse an input: that input's own error type, message prefixed 'Input ()'
usage
UsageError
out (with path or paths-stdin) whose extension is not .tsv, any case, including none (PYB-1); checked before any input is opened
usage
UsageError
the answer is too large to return as one JSON document (PYB-3 part 1; measured: past the ~1.07 G-character .NET string ceiling, not RAM). Message: 'this read (N records) is too large to return as one document; use --limit/--offset or --out', N the parsed record_count
path missing or blank; file or directory not found
usage
UsageError
mzLib does not recognise the file type (the message points at readers formats)
usage
UsageError
offset, limit or out given with no value; offset or limit < 0; non-integer value; out resolves to the same file as path
correctness
BridgeError
the file is recognised but mzLib fails to parse it; the error type is mzLib's own (e.g. HeaderValidationException, MzLibException)
correctness
BridgeError
a vendor format that cannot load on this platform surfaces as its real failure (Bruker/timsTOF native DLLs are Windows x64 only)
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
correctness
BridgeError
with on-error fail, mzLib failing to parse an input: that input's own error type, message prefixed 'Input ()'
usage
UsageError
with paths-stdin, inputs of more than one record type: refused before any file is parsed, naming the groups, whatever on-error says
usage
UsageError
out (with path or paths-stdin) whose extension is not .tsv, any case, including none (PYB-1); checked before any input is opened
usage
UsageError
the answer is too large to return as one JSON document (PYB-3 part 1; measured: past the ~1.07 G-character .NET string ceiling, not RAM). Message: 'this read (N records) is too large to return as one document; use --limit/--offset or --out', N the parsed record_count
path missing or blank; file or directory not found; mzLib does not recognise the file type (the message points at readers formats)
usage
UsageError
offset, limit or out given with no value; offset or limit < 0; non-integer value; out resolves to the same file as path
usage
UsageError
the file has no quantifiable view (the message names the views it does have)
correctness
BridgeError
mzLib recognises the file and fails to parse it
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
correctness
BridgeError
with on-error fail, mzLib failing to parse an input: that input's own error type, message prefixed 'Input ()'
usage
UsageError
out (with path or paths-stdin) whose extension is not .tsv, any case, including none (PYB-1); checked before any input is opened
usage
UsageError
the answer is too large to return as one JSON document (PYB-3 part 1; measured: past the ~1.07 G-character .NET string ceiling, not RAM). Message: 'this read (N records) is too large to return as one document; use --limit/--offset or --out', N the parsed record_count
path missing or blank; file not found; the file is not one of the seven spectra types (the message names the views it does have)
usage
UsageError
ms-order, offset, limit or out given with no value; ms-order < 1; offset or limit < 0; non-integer value
usage
UsageError
out resolves to the same file as path
correctness
BridgeError
a vendor format that cannot load on this platform surfaces as its real failure (Bruker/timsTOF native DLLs are Windows x64 only)
usage
UsageError
paths-stdin with path, offset or limit; paths-stdin with a value; no paths on stdin; a repeated path; threads 0 or below -1; on-error not fail or skip; on-error skip with a single path; out naming an input
usage
UsageError
with on-error fail, an input that is missing or not this view: the usage error of that input, prefixed 'Input ()'
correctness
BridgeError
with on-error fail, mzLib failing to parse an input: that input's own error type, message prefixed 'Input ()'
usage
UsageError
out (with path or paths-stdin) whose extension is not .tsv, any case, including none (PYB-1); checked before any input is opened
usage
UsageError
the answer is too large to return as one JSON document (PYB-3 part 1; measured: past the ~1.07 G-character .NET string ceiling, not RAM). Message: 'this read (N records) is too large to return as one document; use --limit/--offset or --out', N the parsed record_count
responses or design missing, blank or not found; a table empty, header-only or with too few columns; a row whose field count differs from its header; an empty or repeated feature id, sample or coefficient name; a response cell that is not a number (other than blank, NA, NaN); a design cell that is not a finite number
usage
UsageError
the design's samples are not exactly the responses' sample columns (both differences are named); no coefficient on stdin, one named twice, or one not in the design; --spline-basis without --trend, or below 1; --threads 0 or below -1
usage
UsageError
mzLib refuses the input: the design is not of full column rank, or fewer than 2 features could be fitted, so no variance prior exists (mzLib's ArgumentException, reclassified)
stdin empty; a line without exactly 3 tab-separated fields; an empty feature name; an estimate that is not a finite number; a standard error that is not finite and positive (mzLib's refusal, reclassified, naming the feature); --confidence not strictly between 0 and 1, or given without a value