ConsensusMap#

class pyopenms.ConsensusMap(*args, **kwargs)#

Bases: ConsensusMap

__init__(*args, **kwargs)#

Overload:

__init__(self) None

Overload:

__init__(self, in_0: ConsensusMap) None

Methods

__init__(*args, **kwargs)

Overload:

appendColumns(self, in_0)

Add consensus map entries as new columns

appendRows(self, in_0)

Add consensus map entries as new rows

clear

Overload:

clearMetaInfo(self)

Removes all meta values

clearRanges(self)

Resets all range dimensions as empty

clearUniqueId(self)

Clear the unique id.

empty(self)

ensureUniqueId(self)

Assigns a valid unique id, but only if the present one is invalid.

getColumnHeaders

getDataProcessing(self)

Returns a const reference to the description of the applied data processing

getExperimentType(self)

Non-mutable access to the experiment type

getIdentifier(self)

Retrieve document identifier (e.g.

getKeys(self, keys)

Fills the given vector with a list of all keys for which a value is set

getLoadedFilePath(self)

Returns the file_name which is the absolute path to the file loaded

getLoadedFileType(self)

Returns the file_type (e.g.

getMaxIntensity(self)

Returns the maximum intensity

getMaxMZ(self)

Returns the maximum m/z

getMaxRT(self)

Returns the maximum RT

getMetaValue(self, in_0)

Returns the value corresponding to a string, or

getMinIntensity(self)

Returns the minimum intensity

getMinMZ(self)

Returns the minimum m/z

getMinRT(self)

Returns the minimum RT

getPrimaryMSRunPath(self, toFill)

Returns the MS run path (stored in ColumnHeaders)

getProteinIdentifications(self)

getUnassignedPeptideIdentifications(self)

getUniqueId(self)

Returns the unique id

get_df()

Generates a pandas DataFrame with both consensus feature meta data and intensities from each sample.

get_intensity_df()

Generates a pandas DataFrame with feature intensities from each sample in long format (over files).

get_metadata_df()

Generates a pandas DataFrame with feature meta data (sequence, charge, mz, RT, quality).

hasInvalidUniqueId(self)

Returns whether the unique id is invalid.

hasValidUniqueId(self)

Returns whether the unique id is valid.

isMetaEmpty(self)

Returns if the MetaInfo is empty

isValid(self, unique_id)

Returns true if the unique_id is valid, false otherwise

metaRegistry(self)

Returns a reference to the MetaInfoRegistry

metaValueExists(self, in_0)

Returns whether an entry with the given name exists

push_back(self, spec)

removeMetaValue(self, in_0)

Removes the DataValue corresponding to name if it exists

reserve(self, s)

setColumnHeaders

setDataProcessing(self, in_0)

Sets the description of the applied data processing

setExperimentType(self, experiment_type)

Mutable access to the experiment type

setIdentifier(self, id)

Sets document identifier (e.g.

setLoadedFilePath(self, file_name)

Sets the file_name according to absolute path of the file loaded, preferably done whilst loading

setLoadedFileType(self, file_name)

Sets the file_type according to the type of the file loaded from, preferably done whilst loading

setMetaValue(self, in_0, in_1)

Sets the DataValue corresponding to a name

setPrimaryMSRunPath

Overload:

setProteinIdentifications(self, in_0)

Sets the protein identifications

setUnassignedPeptideIdentifications(self, in_0)

Sets the unassigned peptide identifications

setUniqueId(self, rhs)

Assigns a new, valid unique id.

setUniqueIds

size(self)

sortByIntensity

Overload:

sortByMZ(self)

Sorts the peaks according to m/z position

sortByMaps(self)

Sorts with respect to the sets of maps covered by the consensus features (lexicographically)

sortByPosition(self)

Lexicographically sorts the peaks by their position (First RT then m/z)

sortByQuality

Overload:

sortByRT(self)

Sorts the peaks according to RT position

sortBySize(self)

Sorts with respect to the size (number of elements)

sortPeptideIdentificationsByMapIndex(self)

Sorts PeptideIdentifications of consensus features with respect to their map index.

updateRanges(self)

appendColumns(self, in_0: ConsensusMap) ConsensusMap#

Add consensus map entries as new columns

appendRows(self, in_0: ConsensusMap) ConsensusMap#

Add consensus map entries as new rows

clear()#

Overload:

clear(self, clear_meta_data: bool) None

Clears all data and meta data

Overload:

clear(self) None
clearMetaInfo(self) None#

Removes all meta values

clearRanges(self) None#

Resets all range dimensions as empty

clearUniqueId(self) int#

Clear the unique id. The new unique id will be invalid. Returns 1 if the unique id was changed, 0 otherwise

empty(self) bool#
ensureUniqueId(self) int#

Assigns a valid unique id, but only if the present one is invalid. Returns 1 if the unique id was changed, 0 otherwise

getColumnHeaders()#
getDataProcessing(self) List[DataProcessing]#

Returns a const reference to the description of the applied data processing

getExperimentType(self) bytes | str | String#

Non-mutable access to the experiment type

getIdentifier(self) bytes | str | String#

Retrieve document identifier (e.g. an LSID)

getKeys(self, keys: List[bytes]) None#

Fills the given vector with a list of all keys for which a value is set

getLoadedFilePath(self) bytes | str | String#

Returns the file_name which is the absolute path to the file loaded

getLoadedFileType(self) int#

Returns the file_type (e.g. featureXML, consensusXML, mzData, mzXML, mzML, …) of the file loaded

getMaxIntensity(self) float#

Returns the maximum intensity

getMaxMZ(self) float#

Returns the maximum m/z

getMaxRT(self) float#

Returns the maximum RT

getMetaValue(self, in_0: bytes | str | String) int | float | bytes | str | List[int] | List[float] | List[bytes]#

Returns the value corresponding to a string, or

getMinIntensity(self) float#

Returns the minimum intensity

getMinMZ(self) float#

Returns the minimum m/z

getMinRT(self) float#

Returns the minimum RT

getPrimaryMSRunPath(self, toFill: List[bytes]) None#

Returns the MS run path (stored in ColumnHeaders)

getProteinIdentifications(self) List[ProteinIdentification]#
getUnassignedPeptideIdentifications(self) List[PeptideIdentification]#
getUniqueId(self) int#

Returns the unique id

get_df()#

Generates a pandas DataFrame with both consensus feature meta data and intensities from each sample.

Returns: pandas.DataFrame: meta data and intensity DataFrame

get_intensity_df()#

Generates a pandas DataFrame with feature intensities from each sample in long format (over files).

For labelled analyses channel intensities will be in one row, therefore resulting in a semi-long/block format. Resulting DataFrame can be joined with result from get_metadata_df by their index ‘id’.

Returns: pandas.DataFrame: intensity DataFrame

get_metadata_df()#

Generates a pandas DataFrame with feature meta data (sequence, charge, mz, RT, quality).

Resulting DataFrame can be joined with result from get_intensity_df by their index ‘id’.

Returns: pandas.DataFrame: DataFrame with metadata for each feature (such as: best identified sequence, charge, centroid RT/mz, fitting quality)

hasInvalidUniqueId(self) int#

Returns whether the unique id is invalid. Returns 1 if the unique id is invalid, 0 otherwise

hasValidUniqueId(self) int#

Returns whether the unique id is valid. Returns 1 if the unique id is valid, 0 otherwise

isMetaEmpty(self) bool#

Returns if the MetaInfo is empty

isValid(self, unique_id: int) bool#

Returns true if the unique_id is valid, false otherwise

metaRegistry(self) MetaInfoRegistry#

Returns a reference to the MetaInfoRegistry

metaValueExists(self, in_0: bytes | str | String) bool#

Returns whether an entry with the given name exists

push_back(self, spec: ConsensusFeature) None#
removeMetaValue(self, in_0: bytes | str | String) None#

Removes the DataValue corresponding to name if it exists

reserve(self, s: int) None#
setColumnHeaders()#
setDataProcessing(self, in_0: List[DataProcessing]) None#

Sets the description of the applied data processing

setExperimentType(self, experiment_type: bytes | str | String) None#

Mutable access to the experiment type

setIdentifier(self, id: bytes | str | String) None#

Sets document identifier (e.g. an LSID)

setLoadedFilePath(self, file_name: bytes | str | String) None#

Sets the file_name according to absolute path of the file loaded, preferably done whilst loading

setLoadedFileType(self, file_name: bytes | str | String) None#

Sets the file_type according to the type of the file loaded from, preferably done whilst loading

setMetaValue(self, in_0: bytes | str | String, in_1: int | float | bytes | str | List[int] | List[float] | List[bytes]) None#

Sets the DataValue corresponding to a name

setPrimaryMSRunPath()#

Overload:

setPrimaryMSRunPath(self, s: List[bytes]) None

Sets the file paths to the primary MS run (stored in ColumnHeaders)

Overload:

setPrimaryMSRunPath(self, s: List[bytes], e: MSExperiment) None
setProteinIdentifications(self, in_0: List[ProteinIdentification]) None#

Sets the protein identifications

setUnassignedPeptideIdentifications(self, in_0: List[PeptideIdentification]) None#

Sets the unassigned peptide identifications

setUniqueId(self, rhs: int) None#

Assigns a new, valid unique id. Always returns 1

setUniqueIds()#
size(self) int#
sortByIntensity()#

Overload:

sortByIntensity(self, reverse: bool) None

Sorts the peaks according to ascending intensity.

Overload:

sortByIntensity(self) None
sortByMZ(self) None#

Sorts the peaks according to m/z position

sortByMaps(self) None#

Sorts with respect to the sets of maps covered by the consensus features (lexicographically)

sortByPosition(self) None#

Lexicographically sorts the peaks by their position (First RT then m/z)

sortByQuality()#

Overload:

sortByQuality(self, reverse: bool) None

Sorts the peaks according to ascending quality.

Overload:

sortByQuality(self) None
sortByRT(self) None#

Sorts the peaks according to RT position

sortBySize(self) None#

Sorts with respect to the size (number of elements)

sortPeptideIdentificationsByMapIndex(self) None#

Sorts PeptideIdentifications of consensus features with respect to their map index.

updateRanges(self) None#