panorama package#

Subpackages#

Submodules#

panorama.geneFamily module#

This module provides classes to represent gene families and study them

GeneFamily

Represents a single gene family.

Akin

Represents a group of gene families that are similar across multiple pangenomes.

panorama.main module#

The script serves as the entry point for the Panorama software, a bioinformatics tool for analyzing pangenomes. It provides a command-line interface for various functionalities such as annotation, system detection, alignment, comparison, formatting, and utility workflows.

The script constructs a comprehensive command-line utility with subcommands and their corresponding options, encompassing bioinformatic tools ranging from annotations to workflows. A help system is embedded to guide users through the available subcommands and their usage.

panorama.main.cmd_line()#

Configures and executes the command-line interface for the Panorama software package.

Returns:

argparse.Namespace – Parsed command-line arguments and options for execution.

Raises:

SystemExit – If invalid arguments are provided, or the help message needs to be displayed.

panorama.main.main()#

The main function is the entry point for the panorama command line tool. It parses arguments and calls subcommands as appropriate.

Returns:

The exit status

panorama.pangenomes module#

This module provides classes to represent a pangenome or a set of pangenomes

Pangenome

This is a class representing pangenome based on PPanGGOLLiN class.

Pangenomes

A collection of pangenome objects.

panorama.region module#

This module contains classes to represent regions, spots, conserved spots, and modules in a pangenome.

Region

Represents a region in a pangenome.

Spot

Represents a spot in a pangenome.

ConservedSpots

Represents a set of conserved spots across multiple pangenomes.

Module

Represents a module in a pangenome.

GeneContext

A class used to represent a gene context

panorama.utils module#

This module contains functions for managing files and directories, and checking the sanity of a TSV file.

panorama.utils.add_common_arguments(subparser)#

Add common argument to the input subparser.

Parameters:

subparser (ArgumentParser) – A subparser object from any subcommand.

Return type:

None

panorama.utils.check_log(name)#

Check if the output log is writable

Parameters:

name (str) – Path to the log output

Return type:

TextIO

Returns:

file object to write log

panorama.utils.check_tsv_sanity(tsv_path)#

Check if the given TSV file is readable for the next PANORAMA step.

Parameters:

tsv_path (Path) – The path to the TSV file with the list of pangenomes.

Returns:

Dict[str, Dict[str, Union[int, str, Path]]] – A dictionary with pangenome name as key and a dictionary with path and taxid as values.

Raises:
  • SyntaxError – If the TSV file has less than 2 columns.

  • ValueError – If there is a line with no value in pangenome name or if the pangenome names contain spaces.

  • FileNotFoundError – If unable to locate one or more pangenomes in the TSV file.

Return type:

Dict[str, Dict[str, Union[int, str, Path]]]

panorama.utils.init_lock(lock=None)#

Initialize the loading lock.

Parameters:

lock (Lock) – The lock object to be assigned to loading_lock. Defaults to None.

Returns:

Lock – The lock object assigned to loading_lock.

panorama.utils.is_empty(filepath)#

Checks if a file is empty.

Parameters:

filepath (str) – The path to the file to check.

Returns:

bool – True if the file is empty, False otherwise.

panorama.utils.is_true_value(value)#

Check if a value represents a true condition.

True conditions are: 1, “True” or True

Parameters:

value (Union[str, int, bool]) – Value to check

Returns:

True if value represents a true condition

Return type:

bool

panorama.utils.mkdir(output, force=False, erase=False)#

Create a directory at the given path.

Parameters:
  • output (Path) – The path to the output directory

  • force (bool) – Whether to raise an exception if the directory already exists. Defaults to False

  • erase (bool) – Whether to erase the directory if it already exists and force is True. Defaults to False

Returns:

Path – The path to the output directory.

Raises:
  • FileExistsError – If the directory already exists and force is False.

  • Exception – If an unexpected error occurs.

Return type:

Path

panorama.utils.pop_specific_action_grp(sub, title)#
Return type:

_SubParsersAction

panorama.utils.resolve_path(path, relative_directory)#

Try the path from cwd first, then relative to the file location

Parameters:
  • path (Path) – path to solve

  • relative_directory (Path) – directory to resolve relative paths from

Returns:

Path – resolved path

Return type:

Path

panorama.utils.set_verbosity_level(args)#

Set the verbosity level

Parameters:

args (Namespace) – argument pass by command line

Return type:

None