kb_python.compile

Module Contents

Functions

get_latest_github_release_tag(releases_url: str) → str

Get the tag name of the latest GitHub release, given a url to the

get_filename_from_url(url: str) → str

Fetch the filename from a URL.

get_kallisto_url(ref: Optional[str] = None) → str

Get the tarball url of the specified or latest kallisto release.

get_bustools_url(ref: Optional[str] = None) → str

Get the tarball url of the specified or latest bustools release.

find_git_root(path: str) → str

Find the root directory of a git repo by walking.

compile_kallisto(source_dir: str, binary_path: str, cmake_arguments: Optional[str] = None) → str

Compile kallisto from source.

compile_bustools(source_dir: str, binary_path: str, cmake_arguments: Optional[str] = None) → str

Compile bustools from source.

compile(target: typing_extensions.Literal[kallisto, bustools, all], out_dir: Optional[str] = None, cmake_arguments: Optional[str] = None, url: Optional[str] = None, ref: Optional[str] = None, overwrite: bool = False, temp_dir: str = 'tmp') → Dict[str, str]

Compile kallisto and/or bustools binaries by downloading and compiling

exception kb_python.compile.CompileError

Bases: Exception

Common base class for all non-exit exceptions.

kb_python.compile.get_latest_github_release_tag(releases_url: str) str

Get the tag name of the latest GitHub release, given a url to the releases API.

Parameters

releases_url – Url to the releases API

Returns

The tag name

kb_python.compile.get_filename_from_url(url: str) str

Fetch the filename from a URL.

Parameters

url – The url

Returns

The filename

kb_python.compile.get_kallisto_url(ref: Optional[str] = None) str

Get the tarball url of the specified or latest kallisto release.

Parameters

ref – Commit or release tag, defaults to None. By default, the most recent release is used.

Returns

Tarball url

kb_python.compile.get_bustools_url(ref: Optional[str] = None) str

Get the tarball url of the specified or latest bustools release.

Parameters

ref – Commit or release tag, defaults to None. By default, the most recent release is used.

Returns

Tarball url

kb_python.compile.find_git_root(path: str) str

Find the root directory of a git repo by walking.

Parameters

path – Path to start the search

Returns

Path to root of git repo

Raises

CompileError – If the git root could not be found

kb_python.compile.compile_kallisto(source_dir: str, binary_path: str, cmake_arguments: Optional[str] = None) str

Compile kallisto from source.

Parameters
  • source_dir – Path to directory containing root of kallisto git repo

  • binary_path – Path to place compiled binary

  • cmake_arguments – Additional arguments to pass to the cmake command

Returns

Path to compiled binary

kb_python.compile.compile_bustools(source_dir: str, binary_path: str, cmake_arguments: Optional[str] = None) str

Compile bustools from source.

Parameters
  • source_dir – Path to directory containing root of bustools git repo

  • binary_path – Path to place compiled binary

  • cmake_arguments – Additional arguments to pass to the cmake command

Returns

Path to compiled binary

kb_python.compile.compile(target: typing_extensions.Literal[kallisto, bustools, all], out_dir: Optional[str] = None, cmake_arguments: Optional[str] = None, url: Optional[str] = None, ref: Optional[str] = None, overwrite: bool = False, temp_dir: str = 'tmp') Dict[str, str]

Compile kallisto and/or bustools binaries by downloading and compiling a source archive.

Parameters
  • target – Which binary to compile. May be one of kallisto, bustools or all

  • out_dir – Path to output directory, defaults to None

  • cmake_arguments – Additional arguments to pass to the cmake command

  • url – Download the source archive from this url instead, defaults to None

  • ref – Commit hash or tag to use, defaults to None

  • overwrite – Overwrite any existing results, defaults to False

  • temp_dir – Path to temporary directory, defaults to tmp

Returns

Dictionary of results