nf_core.modules

Code to handle DSL2 module imports from a GitHub repository

classnf_core.modules.ModulesRepo(repo='nf-core/modules', branch='master')

Bases: object

An object to store details about the repository being used for modules.

Used by the nf-core modules top-level command with -r and -b flags, so that this can be used in the same way by all sucommands.

classnf_core.modules.PipelineModules

Bases: object

check_modules()

download_gh_file(dl_filename, api_url)

Download a file from GitHub using the GitHub API

  • Parameters:
    • dl_filename (string) – Path to save file to
    • api_url (string) – GitHub API URL for file
  • Raises: If a problem**,** raises an error

get_module_file_urls(module)

Fetch list of URLs for a specific module

Takes the name of a module and iterates over the GitHub repo file tree. Loops over items that are prefixed with the path ‘software/<module_name>’ and ignores anything that’s not a blob. Also ignores the test/ subfolder.

Returns a dictionary with keys as filenames and values as GitHub API URIs. These can be used to then download file contents.

get_modules_file_tree()

Fetch the file list from the repo, using the GitHub API

Sets self.modules_file_tree : self.modules_current_hash self.modules_avail_module_names

install(module)

list_modules()

Get available module names from GitHub tree for repo and print as list to stdout

remove(module)

update(module, force=False)