gratools Package

Main package module for gratools.

no-index:

Contains core classes and functions for GraTools.

Functions

configure_logger(name, log_dir_path, ...[, ...])

Configures and returns a logger instance with specified settings.

update_logger_file_suffix(logger, ...)

Updates file handlers of a logger to use a new file suffix.

validate_percentage_or_int(ctx, param, value)

Click callback for validating that an option's value is either an integer or a float representing a percentage (between 0.0 and 1.0 inclusive).

Classes

AsyncGfaDatabase(db_file[, timeout])

Manage an asynchronous SQLite database for storing and querying GFA link data.

SubGraph(bam_path, bed_path[, logger, ...])

A class representing a subgraph in a genomic analysis pipeline.

GFA(gfa_path[, threads, logger, gfa_name, ...])

Manage parsing of a GFA (Graphical Fragment Assembly) file, compute statistics, and generate related files such as BAM-containing segments files and BED files for path per sample.

GratoolsBam(bam_path[, threads, logger, ...])

Handles operations related to BAM files in the GraTools context, such as indexing, extracting segment information, tagging segments, and performing various analyses (core/dispensable ratio, depth statistics, etc.).

ThreadedRichHandler(*args, **kwargs)

Custom RichHandler that processes log records in a separate thread to prevent blocking the main application thread, especially during I/O-bound logging operations (like writing to console or complex formatting).

CustomCommand(*args, **kwargs)

Custom Command class that applies global context settings (for help formatting) and prepends a specific header to the help message of individual commands.

CustomGroup(*args, **kwargs)

Custom Group class that applies global context settings, prepends a header to its own help message, and ensures that all subcommands added via its command decorator use CustomCommand by default.