API Reference

msp2lib.core

Convert an MSP file representing one or more Mass Spectra to a NIST MS Search user library.

Docker must be installed to use this program.

The first time this script is run it will download the latest version of the docker image automatically.

This can also be done manually, such as to upgrade to the latest version, by running with the --get-docker-image flag.

Functions:

main()

Entry point for running from the command line.

msp2lib(msp_file, output_dir[, lib_name])

Convert the provided MSP file to a NIST User Library, and store the newly created library in the given output directory.

main()[source]

Entry point for running from the command line.

msp2lib(msp_file, output_dir, lib_name=None)[source]

Convert the provided MSP file to a NIST User Library, and store the newly created library in the given output directory.

Parameters
  • msp_file (Union[str, Path, PathLike]) – The MSP file to convert to a NIST User Library

  • output_dir (Union[str, Path, PathLike]) – The directory to store the NIST User Library in

  • lib_name (Optional[str]) – The name of the NIST User Library. If None this will be the filename of the MSP file without the extension. Default None.

msp2lib.utils

utilities for msp2lib.

Functions:

about()

Prints information about msp2lib.

build_docker_image()

Build the lib2nist-wine docker image from the Dockerfile.

download_docker_image()

Pull the lib2nist-wine docker image from dockerhub.

subprocess_with_log(command)

The command with subprocess.Popen, printing any stdout from the command.

test_docker()

Returns whether Docker is installed on the system.

version()

Prints the version number of msp2lib.

about()[source]

Prints information about msp2lib.

Return type

str

build_docker_image()[source]

Build the lib2nist-wine docker image from the Dockerfile.

Return type

int

Returns

The return code of the docker build command

download_docker_image()[source]

Pull the lib2nist-wine docker image from dockerhub.

Return type

int

Returns

The return code of the docker pull command

subprocess_with_log(command)[source]

The command with subprocess.Popen, printing any stdout from the command.

Parameters

command (Union[str, Sequence[str]]) – The command to run

Return type

Popen

Returns

test_docker()[source]

Returns whether Docker is installed on the system.

Return type

bool

Returns

True if Docker is installed, False otherwise.

version()[source]

Prints the version number of msp2lib.

Return type

str