prokbert.general_utils.get_non_empty_files

prokbert.general_utils.get_non_empty_files(start_path: str, extensions: tuple = ('.fasta', '.fna'))

Generator that yields non-empty files from a specified directory and its subdirectories based on the given extensions.

Parameters
  • start_path (str) – The path to the directory from which to start the search.

  • extensions (tuple) – A tuple of file extensions to look for (default is (‘.fasta’, ‘.fna’)). The function also automatically checks for compressed versions with ‘.gz’.

Returns

Yields filenames that match the specified extensions and are non-empty.

Return type

str