ideal_genom.Helpers

ideal_genom.Helpers.arg_parser() dict
ideal_genom.Helpers.delete_temp_files(files_to_keep: list, path_to_folder: str) None

Function to delete temporary files that were created during the pipeline execution. Moreover, it creates a directory called ‘log_files’ to save al .log files originated from the pipeline execution.

Parameters:
  • files_to_keep (list) – list of strings where its elements are the names of files and folders that should be kept.

  • path_to_folder (str) – full path to the folder where the temporary files are located.

ideal_genom.Helpers.download_file(url: str, local_filename: Path) None
ideal_genom.Helpers.extract_gz_file(gz_file: Path, out_dir: Path, remove_gz: bool = False) Path

Extracts a .gz file and saves the decompressed content in the same directory.

Args:

gz_file (str): Path to the .gz file. out_dir (str): Directory where the decompressed file will be saved. remove_gz (bool): If True, delete the .gz file after extraction.

Returns:

Path: Path to the extracted file.

ideal_genom.Helpers.shell_do(command, print_cmd=False, log=False, return_log=False, err=False)

From GenoTools

ideal_genom.Helpers.unzip_file_flat(in_file: Path, target_file: str, out_dir: Path, remove_zip: bool = False) Path

Extracts a specific file from a ZIP archive, decompresses it if it’s a .gz file, and optionally deletes original files.

Args:

in_file (str): Path to the ZIP file. target_file (str): The file inside the ZIP to extract. out_dir (str): Directory where the extracted file will be saved. remove_zip (bool): If True, delete the original ZIP file after extraction. remove_gz (bool): If True, delete the .gz file after decompression.

Returns:

Path: Path to the final extracted file.