SnakeInstaller

class snakecdysis.snake_wrapper.SnakeInstaller(soft_path=None, url=None, docs=None, description_tool=None, singularity_url_files=None, datatest_url_files=None, **kargs)[source]

Bases: object

This class is used to install Snakemake workflows.

Parameters:
  • soft_path (str) – The path of the wrapped workflow installation.

  • url (str) – URL of versioning repository (GitHub or GitLab).

  • docs (str) – URL of documentation.

  • description_tool (str) – The header printed on the terminal when running the program. Please include string values ‘VERSION’, ‘GIT_URL’, and ‘DOCS’, and the wrapper automatically replaces them with the correct values.

  • singularity_url_files (list(tuple())) – List of tuples with downloaded URL and install destination with INSTALL_PATH, like INSTALL_PATH/containers/Singularity.CulebrONT_tools.sif.

  • datatest_url_files (tuple) – Tuple with 2 values, first the URL of datatest, second download name.

  • snakefile (str) – Path to the main Snakemake script file (default: snakefiles/snakefile).

  • snakemake_scripts (str) – Path to the main Snakemake script file (default: snakefiles/snakefile).

  • default_profile (str) – Path to create the cluster ‘default_profile’ directory (default: default_profile/).

  • git_config_path (str) – Path to the default config file YAML (default: install_files/config.yaml).

  • git_tools_path (str) – Path to the default tools config YAML (default: install_files/tools_path.yaml).

  • git_cluster_config (str) – Path to the SLURM cluster config file (default: install_files/cluster_config_SLURM.yaml).

  • tools_version_path (str) – Path to the csv with soft and command to get version (default: report_template/versions.csv).

Attributes Summary

args_cluster_config

Path to the snakemake args cluster config setting.

args_tools_path

Path to the user tools path setting.

datatest_url_files

Tuple with 2 values, first the url of datatest, second download name.

default_profile

Path to the directory of cluster coockiecutter default profile.

description_tool

The header print on terminal when run programme

docs

Url of documentation

get_active_tools_path

return the active path of tools config

git_config_path

Path to the directory of default config.yaml file.

git_tools_path

Path to the directory of default config.yaml file.

git_url

Url of versioning repository (GitHub or GitLab)

install_mode

Detect install mode of the soft, can be 'No install', 'local' or 'cluster'

install_path

The path of wrapped workflow installation.

latest_version

The latest workflow version, read on repository

singularity_url_files

List of tuple with downloaded url and install destination with INSTALL_PATH.

snakecdysis_version

The current workflow version, read on VERSION file

snakefile

Path to the main snakemake file.

snakemake_scripts

Path to the scripts used on snakemake rules.

soft_name

The wrapped workflow name.

tools_mode

Detect install mode of the tools soft, can be 'modules' or 'singularity'

user_cluster_config

Path to the user cluster config path setting.

user_tools_path

Path to the user tools path setting.

version

The current workflow version, read on VERSION file

Methods Summary

check_and_download_singularity()

Download singularity/apptainer files if provided

clean_home()

Reset home's parameters of previous installation

create_bash_completion()

Add bash completion for version > 4.4

fail()

If installation fail, reset already install files

get_epilog()

Function for know the last version of program (can be GitHub or GitLab repository)

get_last_version()

Function for know the last version of program (can be GitHub or GitLab repository)

get_tool_configfile()

Test path of tools_path.yaml on default install path, home or argument

tools_version_to_df([csv_file, ...])

check how tools install and get version to save on file

write_user_tools_path()

Check if file is created and then write with modification of singularity path

Attributes Documentation

args_cluster_config

Path to the snakemake args cluster config setting. default to ~/.config/SOFTNAME/cluster_config_args.yaml

args_tools_path

Path to the user tools path setting. default to ~/.config/SOFTNAME/tools_path_args.yaml

datatest_url_files

Tuple with 2 values, first the url of datatest, second download name.

default_profile

Path to the directory of cluster coockiecutter default profile. install on INSTALL_PATH/default_profile

description_tool

The header print on terminal when run programme

Please add string values ‘VERSION’, ‘GIT_URL’ and ‘DOCS’ and wrapper automatically replace by the good values

docs

Url of documentation

get_active_tools_path

return the active path of tools config

git_config_path

Path to the directory of default config.yaml file. default to INSTALL_PATH/install_files/config.yaml

git_tools_path

Path to the directory of default config.yaml file. default to INSTALL_PATH/install_files/tools_path.yaml

git_url

Url of versioning repository (GitHub or GitLab)

install_mode

Detect install mode of the soft, can be ‘No install’, ‘local’ or ‘cluster’

install_path

The path of wrapped workflow installation.

latest_version

The latest workflow version, read on repository

singularity_url_files

List of tuple with downloaded url and install destination with INSTALL_PATH. like INSTALL_PATH/containers/Singularity.CulebrONT_tools.sif

snakecdysis_version

The current workflow version, read on VERSION file

snakefile

Path to the main snakemake file. Search on INSTALL_PATH/snakefiles/snakefile

snakemake_scripts

Path to the scripts used on snakemake rules. Search on INSTALL_PATH/snakemake_scripts

soft_name

The wrapped workflow name.

tools_mode

Detect install mode of the tools soft, can be ‘modules’ or ‘singularity’

user_cluster_config

Path to the user cluster config path setting. default to ~/.config/SOFTNAME/cluster_config.yaml

user_tools_path

Path to the user tools path setting. default to ~/.config/SOFTNAME/tools_path.yaml

version

The current workflow version, read on VERSION file

Methods Documentation

check_and_download_singularity()[source]

Download singularity/apptainer files if provided

clean_home()[source]

Reset home’s parameters of previous installation

create_bash_completion()[source]

Add bash completion for version > 4.4

fail()[source]

If installation fail, reset already install files

get_epilog() str[source]
Function for know the last version of program (can be GitHub or GitLab repository)

check every 30 days to skip request of if no internet connection

Return: epilogTool print at the end of header

get_last_version() str[source]

Function for know the last version of program (can be GitHub or GitLab repository)

get_tool_configfile()[source]

Test path of tools_path.yaml on default install path, home or argument

tools_version_to_df(csv_file=None, active_tools_list=None, output_file=None)[source]

check how tools install and get version to save on file

write_user_tools_path()[source]

Check if file is created and then write with modification of singularity path