Skip to content

Utilities

Utility scripts that are not part of the main Snakemake workflow. These include helper tools for data management, file handling, and the Monte Carlo analysis feature.


Data Bundle CLI

databundle_cli

This script provides a command-line interface (CLI) for checking the status of files in a databundle and retrieving missing files. It uses the rich library to display markdown and tables in the console, making it easier for users to understand which files are missing and how to retrieve them. The script checks the configuration of the databundles, identifies missing files, and offers options for retrieving them either automatically or manually. It also allows users to update the checklist after retrieving files to ensure that all necessary data is available for their snakemake workflow.

console_markdown(markdown, lvl=1)

Print markdown text to the console with optional indentation.

Parameters

markdown : str The markdown text to be printed. lvl : int The level of indentation (number of times to dedent the markdown text). Default is 1.

Returns

None The function prints the markdown text to the console and does not return anything.

console_table(dataframe, table_kw={})

Print a DataFrame as a rich table in the console.

Parameters

dataframe : pd.DataFrame The DataFrame to be printed as a table. table_kw : dict Keyword arguments for customizing the table appearance.

Returns

None The function prints the table to the console and does not return anything.

databundle_check(bundles_to_download, config_databundles)

Check the status of the files in the databundle and print a checklist to the console.

Parameters

bundles_to_download : list A list of databundle names to check. config_databundles : dict A dictionary containing the configuration for each databundle.

Returns

list A list of missing databundle names.


Zenodo Handler

zenodo_handler

Uploads local files to Zenodo or sandbox.Zenodo.

Requirements

  • Install zenodopy: pip git+https://github.com/pz-max/zenodopy@patch-4

  • Setup zenodopy (token): https://github.com/pz-max/zenodopy/tree/patch-4#using-the-package

  • Be aware of Zenodo REST API e.g. for metadata modifications: https://developers.zenodo.org/#introduction

Relevant Settings


Zip Folder

zip_folder

Module to zip the desired folders to be stored in google drive, or equivalent.