seqgra.misc module

Miscellaneous helper functions

Classes:
class MiscHelper[source]

Bases: object

Class with miscellaneous helper functions as static methods

static format_output_dir(output_dir: str)str[source]
static get_valid_file(data_file: str)str[source]
static prepare_path(path: str, allow_exists: bool = True, allow_non_empty: bool = False)str[source]
static print_progress_bar(iteration: int, total: int, prefix: str = '', suffix: str = '', decimals: int = 1, length: int = 100, fill: str = '█', print_end: str = '\r')[source]

Call in a loop to create terminal progress bar

Parameters
  • iteration (int) – current iteration

  • total (list of str, optional) – total iterations

  • prefix (str, optional) – prefix string, defaults to empty string

  • suffix (str, optional) – suffix string, defaults to empty string

  • decimals (int, optional) – positive number of decimals in percent complete, defaults to 1

  • length (dict [str, str], optional) – character length of bar, defaults to 100

  • fill (dict [str, str], optional) – bar fill character, defaults to “█”

  • print_end (str, optional) – end character (e.g. “\r”, “\r\n”), defaults to “\r”

static read_config_file(file_name: str)str[source]
static sanitize_id(unsafe_id: str)str[source]