bioflow.utils.general_utils package

Submodules

bioflow.utils.general_utils.debug_scripts module

bioflow.utils.general_utils.deprecated_id_translations module

bioflow.utils.general_utils.dict_like_configs_parser module

bioflow.utils.general_utils.high_level_os_io module

Saner io and filesystem manipulation compared to python defaults

bioflow.utils.general_utils.high_level_os_io.copy_if_doesnt_exist(source, destination)[source]

Copies a file if it does not exist

Parameters:
  • source
  • destination
Returns:

bioflow.utils.general_utils.high_level_os_io.mkdir_recursive(path)[source]

Recursively creates a directory that would contain a file given win-like filename (xxx.xxx) or directory name :param path: :return:

bioflow.utils.general_utils.high_level_os_io.wipe_dir(path)[source]

wipes the indicated directory :param path: :return: True on success

bioflow.utils.general_utils.id_translations module

bioflow.utils.general_utils.internet_io module

Module responsible for retrieval of files stored on the internet. Requires some refactoring before can be considered a library in its onw right.

bioflow.utils.general_utils.internet_io.check_hash(file_path, expected_hash, hasher)[source]

Checks a expected_hash of a file :param file_path: :param expected_hash: :param hash_type: :return:

bioflow.utils.general_utils.internet_io.marbach_post_proc(local_directory)[source]

Function to post-process a specific online database that is rather quite unfriendly

Returns:
bioflow.utils.general_utils.internet_io.url_to_local(url, path, rename=None)[source]

Copies a file from an http or ftp url to a local destination provided in path while choosing a good decompression algorithm so far, only gunzipped ftp url downloads and path autocompletion only for non-compressed files are supported

Parameters:
  • url
  • path
Raises:

Exception – renaming for gunzip and zipped files is not supported

Returns:

bioflow.utils.general_utils.internet_io.url_to_local_p_gz(url, path)[source]

Copies a file from an http or ftp url to a local destination provided in path :param url: :param path: :raise Exception: something is wrong with the uri :return:

bioflow.utils.general_utils.internet_io.url_to_local_p_zip(url, path)[source]

Copies a file from an http url to a local folder provided in path :param url: :param path: :raise Exception: something is wrong with the path :raise Exception: something is wrong with the uri :return:

bioflow.utils.general_utils.internet_io.url_to_local_path(url, path, rename=None)[source]

Copies a file from an http url to a local destination provided in path. Performs file-to-folder converstion :param url: :param path: :raise Exception: something is wrong with the uri :return:

bioflow.utils.general_utils.useful_wrappers module

Contains a set of wrappers that are useful for debugging and operation profiling

bioflow.utils.general_utils.useful_wrappers.debug_wrapper(function_of_interest)[source]

Convenient wrapper inspecting the results of a function returning a single matrix

Parameters:function_of_interest
Returns:wrapped functions with copied name and documentation
bioflow.utils.general_utils.useful_wrappers.my_timer(message='', previous_time=[])[source]

A small timer to be used in code to measure the execution duration of elements of code

Parameters:
  • message
  • previous_time
Returns:

bioflow.utils.general_utils.useful_wrappers.render_2d_matrix(matrix, name)[source]

Subroutine requried by the rendering wrapper.

Parameters:
  • matrix
  • name
Returns:

bioflow.utils.general_utils.useful_wrappers.time_it_wrapper(function_of_interest)[source]

Convenient wrapper for timing the execution time of functions :param function_of_interest: :return: wrapped functions with copied name and documentation

Module contents