BALSAMIC.utils package¶
Submodules¶
BALSAMIC.utils.cli module¶
-
class
BALSAMIC.utils.cli.
SnakeMake
[source]¶ Bases:
object
To build a snakemake command using cli options
Params:
case_name - analysis case name working_dir - working directory for snakemake configfile - sample configuration file (json) output of balsamic-config-sample run_mode - run mode - cluster or local shell run cluster_config - cluster config json file scheduler - slurm command constructor log_path - log file path script_path - file path for slurm scripts result_path - result directory qos - QOS for sbatch jobs account - scheduler(e.g. slurm) account mail_user - email to account to send job run status forceall - To add ‘–forceall’ option for snakemake run_analysis - To run pipeline use_singularity - To use singularity singularity_bind- Singularity bind path singularity_arg - Singularity arguments to pass to snakemake sm_opt - snakemake additional options
-
BALSAMIC.utils.cli.
add_doc
(docstring)[source]¶ A decorator for adding docstring. Taken shamelessly from stackexchange.
-
BALSAMIC.utils.cli.
convert_defaultdict_to_regular_dict
(inputdict: dict)[source]¶ Recursively convert defaultdict to dict.
-
BALSAMIC.utils.cli.
createDir
(path, interm_path=[])[source]¶ Creates directories by recursively checking if it exists, otherwise increments the number
-
BALSAMIC.utils.cli.
get_file_status_string
(file_to_check)[source]¶ Checks if file exsits. and returns a string with checkmark or redcorss mark if it exists or doesn’t exist respectively. Always assume file doesn’t exist, unless proven otherwise.
-
BALSAMIC.utils.cli.
get_from_two_key
(input_dict, from_key, by_key, by_value, default=None)[source]¶ Given two keys with list of values of same length, find matching index of by_value in from_key from by_key.
from_key and by_key should both exist
-
BALSAMIC.utils.cli.
get_package_split
(condas)[source]¶ Get a list of conda env files, and extract pacakges
input: conda env files output: dict of packages and their version
-
BALSAMIC.utils.cli.
get_packages
(yaml_file)[source]¶ return packages found in a conda yaml file
input: conda yaml file path output: list of packages
-
BALSAMIC.utils.cli.
get_ref_path
(input_json)[source]¶ Set full path to reference files Input: reference config file Return: json file with abspath
-
BALSAMIC.utils.cli.
get_snakefile
(analysis_type, sequencing_type='targeted')[source]¶ Return a string path for variant calling snakefile.
BALSAMIC.utils.exc module¶
BALSAMIC.utils.rule module¶
-
BALSAMIC.utils.rule.
get_chrom
(panelfile)[source]¶ input: a panel bedfile output: list of chromosomes in the bedfile
-
BALSAMIC.utils.rule.
get_conda_env
(yaml_file, pkg)[source]¶ input: balsamic_env output: string of conda env where packge is in
-
BALSAMIC.utils.rule.
get_picard_mrkdup
(config)[source]¶ input: sample config file output from BALSAMIC output: mrkdup or rmdup strings
-
BALSAMIC.utils.rule.
get_result_dir
(config)[source]¶ input: sample config file from BALSAMIC output: string of result directory path
-
BALSAMIC.utils.rule.
get_sample_type
(sample, bio_type)[source]¶ input: sample dictionary from BALSAMIC’s config file output: list of sample type id
-
BALSAMIC.utils.rule.
get_script_path
(script_name: str)[source]¶ Retrieves script path where name is matching {{script_name}}.