use crate::Format;
#[derive(Debug, Clone)]
pub struct AhdaVersionError;
impl std::fmt::Display for AhdaVersionError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Not a valid AhdaVersion")
}
}
impl std::error::Error for AhdaVersionError {}
#[derive(Debug, Clone)]
pub struct AhdaFormatVersionErr;
impl std::fmt::Display for AhdaFormatVersionErr {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Not a valid AhdaFormatVersion")
}
}
impl std::error::Error for AhdaFormatVersionErr {}
#[derive(Debug, Clone)]
pub struct AhdaHeaderError;
impl std::fmt::Display for AhdaHeaderError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "bytes do not start with a valid ahda file header")
}
}
impl std::error::Error for AhdaHeaderError {}
#[derive(Debug, Clone)]
pub struct SetBitsIteratorNotSorted;
impl std::fmt::Display for SetBitsIteratorNotSorted {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "`set_bits` iterator given to BitmapEncoder::new() (argument #1) must be sorted.")
}
}
impl std::error::Error for SetBitsIteratorNotSorted {}
#[derive(Debug, Clone)]
pub struct ThemistoPrinterError;
impl std::fmt::Display for ThemistoPrinterError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "invalid input to encode")
}
}
impl std::error::Error for ThemistoPrinterError {}
#[derive(Debug, Clone)]
pub struct SamPrinterError;
impl std::fmt::Display for SamPrinterError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "invalid input to encode")
}
}
impl std::error::Error for SamPrinterError {}
#[derive(Debug, Clone)]
pub struct FulgorPrinterError;
impl std::fmt::Display for FulgorPrinterError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "invalid input to encode")
}
}
impl std::error::Error for FulgorPrinterError {}
#[derive(Debug, Clone)]
pub struct AhdaTSVPrinterError;
impl std::fmt::Display for AhdaTSVPrinterError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "invalid input to encode")
}
}
impl std::error::Error for AhdaTSVPrinterError {}
#[derive(Debug, Clone)]
pub struct BifrostPrinterError;
impl std::fmt::Display for BifrostPrinterError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "invalid input to encode")
}
}
impl std::error::Error for BifrostPrinterError {}
#[derive(Debug, Clone)]
pub struct MetagraphPrinterError;
impl std::fmt::Display for MetagraphPrinterError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "invalid input to encode")
}
}
impl std::error::Error for MetagraphPrinterError {}
#[derive(Debug, Clone)]
pub struct UnrecognizedInputFormatErr;
impl std::fmt::Display for UnrecognizedInputFormatErr {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Unrecognized input format.")
}
}
impl std::error::Error for UnrecognizedInputFormatErr {}
#[derive(Debug, Clone)]
pub struct AmbiguousInputFormatErr;
impl std::fmt::Display for AmbiguousInputFormatErr {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Ambiguous input format.")
}
}
impl std::error::Error for AmbiguousInputFormatErr {}
#[derive(Debug, Clone)]
pub struct CorruptedInputErr;
impl std::fmt::Display for CorruptedInputErr {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Corrupted input alignment data.")
}
}
impl std::error::Error for CorruptedInputErr {}
#[derive(Debug, Clone)]
pub struct NeedTargetSequences {
pub format: Format,
}
impl std::fmt::Display for NeedTargetSequences {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Detected input format `{}` requires supplying the target sequence names.", self.format)
}
}
impl std::error::Error for NeedTargetSequences {}
#[derive(Debug, Clone)]
pub struct NeedQueryNamesErr {
pub format: Format,
}
impl std::fmt::Display for NeedQueryNamesErr {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Detected input format `{}` requires supplying the query sequence names.", self.format)
}
}
impl std::error::Error for NeedQueryNamesErr {}
#[derive(Debug, Clone)]
pub struct EncodeError;
impl std::fmt::Display for EncodeError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "invalid input to encode")
}
}
impl std::error::Error for EncodeError {}
#[derive(Debug, Clone)]
pub struct BifrostHeaderNotConsumedError;
impl std::fmt::Display for BifrostHeaderNotConsumedError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Bifrost header not consumed from input `Read`.")
}
}
impl std::error::Error for BifrostHeaderNotConsumedError {}
#[derive(Debug, Clone)]
pub struct DuplicatedQueriesErr;
impl std::fmt::Display for DuplicatedQueriesErr {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Inputs contain duplicated query records, use a set operation to merge instead.")
}
}
impl std::error::Error for DuplicatedQueriesErr {}
#[derive(Debug, Clone)]
pub struct QueryIdsNotFilled;
impl std::fmt::Display for QueryIdsNotFilled {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `query_ids` in BlockFlags is not filled.")
}
}
impl std::error::Error for QueryIdsNotFilled {}
#[derive(Debug, Clone)]
pub struct QueryNamesNotFilled;
impl std::fmt::Display for QueryNamesNotFilled {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `queries` in BlockFlags is not filled.")
}
}
impl std::error::Error for QueryNamesNotFilled {}
#[derive(Debug, Clone)]
pub struct IncompatibleFileHeadersErr;
impl std::fmt::Display for IncompatibleFileHeadersErr {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Incompatible file headers.")
}
}
impl std::error::Error for IncompatibleFileHeadersErr {}
#[derive(Debug, Clone)]
pub struct AhdaTSVHeaderNotConsumedError;
impl std::fmt::Display for AhdaTSVHeaderNotConsumedError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "AhdaTSV header not consumed from input `Read`.")
}
}
impl std::error::Error for AhdaTSVHeaderNotConsumedError {}
#[derive(Debug, Clone)]
pub struct PseudoAlnOnesIsEmpty;
impl std::fmt::Display for PseudoAlnOnesIsEmpty {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `ones` of PseudoAln is set but empty.")
}
}
impl std::error::Error for PseudoAlnOnesIsEmpty {}
#[derive(Debug, Clone)]
pub struct PseudoAlnOnesIsNone;
impl std::fmt::Display for PseudoAlnOnesIsNone {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `ones` of PseudoAln is set but empty.")
}
}
impl std::error::Error for PseudoAlnOnesIsNone {}
#[derive(Debug, Clone)]
pub struct PseudoAlnOnesNamesIsNone;
impl std::fmt::Display for PseudoAlnOnesNamesIsNone {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `ones_names` of PseudoAln is set but empty.")
}
}
impl std::error::Error for PseudoAlnOnesNamesIsNone {}
#[derive(Debug, Clone)]
pub struct PseudoAlnOnesNamesIsEmpty;
impl std::fmt::Display for PseudoAlnOnesNamesIsEmpty {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `ones_names` of PseudoAln is set but empty.")
}
}
impl std::error::Error for PseudoAlnOnesNamesIsEmpty {}
#[derive(Debug, Clone)]
pub struct PseudoAlnQueryNameIsEmpty;
impl std::fmt::Display for PseudoAlnQueryNameIsEmpty {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `query_name` of PseudoAln is set but empty.")
}
}
impl std::error::Error for PseudoAlnQueryNameIsEmpty {}
#[derive(Debug, Clone)]
pub struct PseudoAlnQueryNameIsNone;
impl std::fmt::Display for PseudoAlnQueryNameIsNone {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `query_name` of PseudoAln is set but empty.")
}
}
impl std::error::Error for PseudoAlnQueryNameIsNone {}
#[derive(Debug, Clone)]
pub struct PseudoAlnQueryIdIsEmpty;
impl std::fmt::Display for PseudoAlnQueryIdIsEmpty {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `query_id` of PseudoAln is set but empty.")
}
}
impl std::error::Error for PseudoAlnQueryIdIsEmpty {}
#[derive(Debug, Clone)]
pub struct PseudoAlnQueryIdIsNone;
impl std::fmt::Display for PseudoAlnQueryIdIsNone {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Field `query_id` of PseudoAln is set but empty.")
}
}
impl std::error::Error for PseudoAlnQueryIdIsNone {}
#[derive(Debug, Clone)]
pub struct KeyNotFound {
pub key: Vec<u8>,
pub map_name: String,
}
impl std::fmt::Display for KeyNotFound {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Key {} was not found in map {}.", String::from_utf8(self.key.clone()).unwrap(), self.map_name)
}
}
impl std::error::Error for KeyNotFound {}
#[derive(Debug, Clone)]
pub struct MapDoesNotContainIndex {
pub index: usize,
pub map_name: String,
}
impl std::fmt::Display for MapDoesNotContainIndex {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Map {} does not contain index {}.", self.map_name, self.index)
}
}
impl std::error::Error for MapDoesNotContainIndex {}
#[derive(Debug, Clone)]
pub struct HeaderPromiseNotHonoured {
pub promise: String,
}
impl std::fmt::Display for HeaderPromiseNotHonoured {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "File or block header promised field {} in flags but it was None.", self.promise)
}
}
impl std::error::Error for HeaderPromiseNotHonoured {}
#[derive(Debug, Clone)]
pub struct InvalidConversion {
pub from: String,
pub to: String,
}
impl std::fmt::Display for InvalidConversion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Invalid conversion of {} to {}.", self.from, self.to)
}
}
impl std::error::Error for InvalidConversion {}