core.lib.pgsexceptions¶
This module defines a custom PGS exception hierarchy.
This module overrides sys.excepthook. Uncaught exceptions are intercepted,
and sys.exit() is called with a custom code. This can be helpful to debug
problems in other applications, because there are relatively few failure states.
The hierarchy:
BasePGSException
MatchError
DuplicateMatchError
MatchRateError
ZeroMatchesError
MatchValueError
CombineError
BuildError
ScoreFormatError
LiftoverError
CatalogError
ScoreDownloadError
ScoreChecksumError
QueryError
InvalidAccessionError
SamplesheetError
GenomesNotFound
SamplesheetFormatError
Exceptions¶
The base class from which all PGS errors must inherit. |
|
Raised when there's a problem with a scoring file genome build. |
|
The base class for errors when querying or downloading from the PGS Catalog |
|
The base class for errors that are raised when combining scorefiles |
|
Raised when a matched variant has been duplicated, so that a variant with the same ID |
|
Raised when non-supported effect types are present |
|
Raised when FileNotFound |
|
Raised when an invalid term is used to query the Catalog |
|
Raised when liftover has failed to convert genomic coordinates well |
|
The base class for errors that are raised during variant matching |
|
Raised when match rate is below match threshold for one or more scoring files |
|
Raised when a match function receives inappropriate values. |
|
Raised when the Catalog API doesn't return a valid response |
|
The base class for errors related to samplesheet parsing |
|
Raised when a samplesheet is badly formatted |
|
Raised when a scoring file fails checksum validation |
|
Raised when a scoring file can't be downloaded |
|
Raised when there's a problem with a scoring file. |
|
Raised when zero matches are found for one or more scoring files. |
Classes¶
A read only map to get exit codes for custom exceptions |
Functions¶
|
Intercept BasePGSExceptions and trigger sys.exit with a custom code |
Module Contents¶
- exception core.lib.pgsexceptions.BasePGSException(message: str)¶
The base class from which all PGS errors must inherit. The purpose of this class is to simplify finding PGS exceptions and exiting python with a matching custom exit code.
- exception core.lib.pgsexceptions.BuildError(message: str)¶
Raised when there’s a problem with a scoring file genome build.
- exception core.lib.pgsexceptions.CatalogError(message: str)¶
The base class for errors when querying or downloading from the PGS Catalog
- exception core.lib.pgsexceptions.CombineError(message: str)¶
The base class for errors that are raised when combining scorefiles
- exception core.lib.pgsexceptions.DuplicateMatchError(message: str)¶
Raised when a matched variant has been duplicated, so that a variant with the same ID would be split across two rows in an output scoring file.
- exception core.lib.pgsexceptions.EffectTypeError(message: str)¶
Raised when non-supported effect types are present
- exception core.lib.pgsexceptions.GenomesNotFound(message: str)¶
Raised when FileNotFound
- exception core.lib.pgsexceptions.InvalidAccessionError(message: str)¶
Raised when an invalid term is used to query the Catalog
- exception core.lib.pgsexceptions.LiftoverError(message: str)¶
Raised when liftover has failed to convert genomic coordinates well
- exception core.lib.pgsexceptions.MatchError(message: str)¶
The base class for errors that are raised during variant matching
- exception core.lib.pgsexceptions.MatchRateError(message: str)¶
Raised when match rate is below match threshold for one or more scoring files
- exception core.lib.pgsexceptions.MatchValueError(message: str)¶
Raised when a match function receives inappropriate values.
e.g., Multiple chromosomes detected in variant data but data is split per-chromosome
- exception core.lib.pgsexceptions.QueryError(message: str)¶
Raised when the Catalog API doesn’t return a valid response
- exception core.lib.pgsexceptions.SamplesheetError(message: str)¶
The base class for errors related to samplesheet parsing
- exception core.lib.pgsexceptions.SamplesheetFormatError(message: str)¶
Raised when a samplesheet is badly formatted
- exception core.lib.pgsexceptions.ScoreChecksumError(message: str)¶
Raised when a scoring file fails checksum validation
- exception core.lib.pgsexceptions.ScoreDownloadError(message: str)¶
Raised when a scoring file can’t be downloaded
- exception core.lib.pgsexceptions.ScoreFormatError(message: str)¶
Raised when there’s a problem with a scoring file.
- exception core.lib.pgsexceptions.ZeroMatchesError(message: str)¶
Raised when zero matches are found for one or more scoring files.
Distinct from MatchRateError because it’s very common, and caused by bad input data or parameters.
- class core.lib.pgsexceptions.ExceptionExitCodeMap¶
A read only map to get exit codes for custom exceptions
- code_map¶
- core.lib.pgsexceptions.handle_uncaught_exception(exctype: type[BaseException], value: BaseException, trace: types.TracebackType | None) None¶
Intercept BasePGSExceptions and trigger sys.exit with a custom code