SourceFile#

class pyopenms.SourceFile#

Bases: CVTermList

OpenMS class SourceFile

__init__() → None#
__init__(arg: pyopenms.SourceFile, /) → None

Methods

__init__()

addCVTerm(term)

Adds a CV term

clearMetaInfo()

Removes all meta values

consumeCVTerms(cv_term_map)

Merges the given map into the member map, no duplicate checking

empty()

getAllNamesOfChecksumType()

Returns all checksum type names known to OpenMS

getCVTerms()

Returns a copy of the CV terms, keyed by CV accession

getChecksum()

Returns the file's checksum

getChecksumType()

Returns the checksum type

getFileSize()

Returns the file size in MB

getFileType()

Returns the file type

getKeys(keys)

Overloaded function.

getMetaValue(name)

Returns the value corresponding to a string, or DataValue::EMPTY if not found

getNameOfFile()

Returns the file name

getNativeIDType()

Returns the native ID type of the spectra

getNativeIDTypeAccession()

Returns the nativeID of the spectra

getPathToFile()

Returns the file path

hasCVTerm(accession)

isMetaEmpty()

Returns if the MetaInfo is empty

metaRegistry()

Returns a reference to the MetaInfoRegistry

metaValueExists(name)

Returns whether an entry with the given name exists

removeMetaValue(name)

Removes the DataValue corresponding to name if it exists

replaceCVTerm(cv_term)

Replaces the specified CV term

replaceCVTerms(cv_term_map)

setCVTerms(terms)

Sets the CV terms from a vector

setChecksum(checksum, type)

Sets the file's checksum

setFileSize(file_size)

Sets the file size in MB

setFileType(file_type)

Sets the file type

setMetaValue(name, value)

Sets the DataValue corresponding to a name

setNameOfFile(name_of_file)

Sets the file name

setNativeIDType(type)

Sets the native ID type of the spectra

setNativeIDTypeAccession(accesssion)

Sets the native ID of the spectra

setPathToFile(path_path_to_file)

Sets the file path

class ChecksumType(*values)#

Bases: Enum

Type of file checksum

MD5 = 2#
SHA1 = 1#
SIZE_OF_CHECKSUMTYPE = 3#
UNKNOWN_CHECKSUM = 0#
getMapping()#

Returns a dict mapping int values to enum member name strings.

addCVTerm(term: pyopenms.CVTerm) → None#

Adds a CV term

clearMetaInfo() → None#

Removes all meta values

consumeCVTerms(cv_term_map: dict[str, collections.abc.Sequence[pyopenms.CVTerm]]) → None#

Merges the given map into the member map, no duplicate checking

empty() → bool#
static getAllNamesOfChecksumType() → list[str]#

Returns all checksum type names known to OpenMS

getCVTerms() → dict[str, list[pyopenms.CVTerm]]#

Returns a copy of the CV terms, keyed by CV accession

getChecksum() → str#

Returns the file’s checksum

getChecksumType() → pyopenms.SourceFile.ChecksumType#

Returns the checksum type

getFileSize() → float#

Returns the file size in MB

getFileType() → str#

Returns the file type

getKeys(keys: list) → None#
getKeys() → list

Overloaded function.

  1. getKeys(keys: list) -> None

Fills the given list with all meta value keys

  1. getKeys() -> list

Returns all meta value keys as a list

getMetaValue(name: str) → None | int | float | str | bytes | list[str] | list[int] | list[float]#

Returns the value corresponding to a string, or DataValue::EMPTY if not found

getNameOfFile() → str#

Returns the file name

getNativeIDType() → str#

Returns the native ID type of the spectra

getNativeIDTypeAccession() → str#

Returns the nativeID of the spectra

getPathToFile() → str#

Returns the file path

hasCVTerm(accession: str) → bool#
isMetaEmpty() → bool#

Returns if the MetaInfo is empty

static metaRegistry() → pyopenms.MetaInfoRegistry#

Returns a reference to the MetaInfoRegistry

metaValueExists(name: str) → bool#

Returns whether an entry with the given name exists

removeMetaValue(name: str) → None#

Removes the DataValue corresponding to name if it exists

replaceCVTerm(cv_term: pyopenms.CVTerm) → None#

Replaces the specified CV term

replaceCVTerms(cv_term_map: dict[str, collections.abc.Sequence[pyopenms.CVTerm]]) → None#
setCVTerms(terms: collections.abc.Sequence[pyopenms.CVTerm]) → None#

Sets the CV terms from a vector

setChecksum(checksum: str, type: pyopenms.SourceFile.ChecksumType) → None#

Sets the file’s checksum

setFileSize(file_size: float) → None#

Sets the file size in MB

setFileType(file_type: str) → None#

Sets the file type

setMetaValue(name: str, value: None | int | float | str | bytes | list[str] | list[int] | list[float]) → None#

Sets the DataValue corresponding to a name

setNameOfFile(name_of_file: str) → None#

Sets the file name

setNativeIDType(type: str) → None#

Sets the native ID type of the spectra

setNativeIDTypeAccession(accesssion: str) → None#

Sets the native ID of the spectra

setPathToFile(path_path_to_file: str) → None#

Sets the file path