tacco.benchmarking.benchmark_annotate

benchmark_annotate(adata, reference, working_directory=None, verbose=0, **kw_args)[source]

Benchmarks time and memory consumption of an annotation run. This will run tacco.tools.annotate() within an isolated script, in a separate python session on serialized adata and reference data sets. Due to this setup, adata and reference will not be changed by this call (in contrast to calling annotate() directly). This removes all interactions between consecutive calls to this function.

Parameters:
  • adata – An AnnData including expression data in .X.

  • reference – Reference data to get the annotation definition from.

  • working_directory – The directory where to execute the command. If None, a temporary directory is used and cleaned in the end.

  • verbose – Whether to print stderr and stdout of the command run.

  • **kw_args – All extra arguments are forwarded to the annotate() call.

Returns:

Returns a dict containing the runtime of the wrapper script including I/O for reading data in seconds under the key “shell_time_s”, the runtime of the call to annotate() under the key “annotation_time_s”, the memory usage under “max_mem_usage_GB”, the annotation result under “annotation”, and the runtime of the call to benchmark_annotate() including I/O for writing and reading data under the key “benchmark_time_s”.