polaranges 0.3.2

Rust-first genomic range operations on top of Polars DataFrames
Documentation
use std::path::PathBuf;

use polars_core::prelude::PolarsError;
use thiserror::Error;

use crate::RangeFrameError;

pub type Result<T> = std::result::Result<T, CommandError>;

#[derive(Debug, Error)]
pub enum CommandError {
    #[error(transparent)]
    RangeFrame(#[from] RangeFrameError),

    #[error(transparent)]
    Polars(#[from] PolarsError),

    #[error(transparent)]
    Io(#[from] std::io::Error),

    #[error("input file not found: {path}")]
    MissingInputFile { path: PathBuf },

    #[error(
        "unsupported input format for `{path}`; supported extensions are .bed, .csv, .tsv, .tab, and .parquet"
    )]
    UnsupportedInputFormat { path: PathBuf },

    #[error("missing required column `{column}` in `{path}`")]
    MissingRequiredColumn { path: PathBuf, column: String },

    #[error("missing required strand column `{column}` in `{path}`")]
    MissingRequiredStrandColumn { path: PathBuf, column: String },

    #[error("`--same-strand` and `--opposite-strand` cannot be used together")]
    InvalidStrandConstraint,

    #[error("compat mode is planned as a thin translation layer, but it is not implemented yet")]
    CompatModeNotYetImplemented,
}