FeatureMapDF

class pyopenms.dataframes.FeatureMapDF(*args, **kwargs)

Bases: pyopenms.pyopenms_1.FeatureMap

__init__(*args, **kwargs)
  • Cython signature: void FeatureMap()

  • Cython signature: void FeatureMap(FeatureMap &)

Methods

__init__(*args, **kwargs)

  • Cython signature: void FeatureMap()

clear

  • Cython signature: void clear()

clearMetaInfo

Cython signature: void clearMetaInfo() Removes all meta values

clearRanges

Cython signature: void clearRanges() Resets all range dimensions as empty

clearUniqueId

Cython signature: size_t clearUniqueId() Clear the unique id.

ensureUniqueId

Cython signature: size_t ensureUniqueId() Assigns a valid unique id, but only if the present one is invalid.

getDataProcessing

Cython signature: libcpp_vector[DataProcessing] getDataProcessing()

getIdentifier

Cython signature: String getIdentifier() Retrieve document identifier (e.g.

getKeys

Cython signature: void getKeys(libcpp_vector[String] & keys) Fills the given vector with a list of all keys for which a value is set

getLoadedFilePath

Cython signature: String getLoadedFilePath() Returns the file_name which is the absolute path to the file loaded

getLoadedFileType

Cython signature: int getLoadedFileType() Returns the file_type (e.g.

getMaxIntensity

Cython signature: double getMaxIntensity() Returns the maximum intensity

getMaxMZ

Cython signature: double getMaxMZ() Returns the maximum m/z

getMaxRT

Cython signature: double getMaxRT() Returns the maximum RT

getMetaValue

Cython signature: DataValue getMetaValue(String) Returns the value corresponding to a string, or

getMinIntensity

Cython signature: double getMinIntensity() Returns the minimum intensity

getMinMZ

Cython signature: double getMinMZ() Returns the minimum m/z

getMinRT

Cython signature: double getMinRT() Returns the minimum RT

getPrimaryMSRunPath

Cython signature: void getPrimaryMSRunPath(StringList & toFill) Returns the file path to the first MS run

getProteinIdentifications

Cython signature: libcpp_vector[ProteinIdentification] getProteinIdentifications()

getUnassignedPeptideIdentifications

Cython signature: libcpp_vector[PeptideIdentification] getUnassignedPeptideIdentifications()

getUniqueId

Cython signature: size_t getUniqueId() Returns the unique id

get_assigned_peptide_identifications()

Generates a list with peptide identifications assigned to a feature.

get_df([meta_values, ...])

Generates a pandas DataFrame with information contained in the FeatureMap.

hasInvalidUniqueId

Cython signature: size_t hasInvalidUniqueId() Returns whether the unique id is invalid.

hasValidUniqueId

Cython signature: size_t hasValidUniqueId() Returns whether the unique id is valid.

isMetaEmpty

Cython signature: bool isMetaEmpty() Returns if the MetaInfo is empty

isValid

Cython signature: bool isValid(uint64_t unique_id) Returns true if the unique_id is valid, false otherwise

metaRegistry

Cython signature: MetaInfoRegistry metaRegistry() Returns a reference to the MetaInfoRegistry

metaValueExists

Cython signature: bool metaValueExists(String) Returns whether an entry with the given name exists

push_back

  • Cython signature: void push_back(Feature spec)

removeMetaValue

Cython signature: void removeMetaValue(String) Removes the DataValue corresponding to name if it exists

setDataProcessing

Cython signature: void setDataProcessing(libcpp_vector[DataProcessing]) Sets the description of the applied data processing

setIdentifier

Cython signature: void setIdentifier(String id) Sets document identifier (e.g.

setLoadedFilePath

Cython signature: void setLoadedFilePath(String file_name) Sets the file_name according to absolute path of the file loaded, preferably done whilst loading

setLoadedFileType

Cython signature: void setLoadedFileType(String file_name) Sets the file_type according to the type of the file loaded from, preferably done whilst loading

setMetaValue

Cython signature: void setMetaValue(String, DataValue) Sets the DataValue corresponding to a name

setPrimaryMSRunPath

  • Cython signature: void setPrimaryMSRunPath(StringList & s)

setProteinIdentifications

Cython signature: void setProteinIdentifications(libcpp_vector[ProteinIdentification]) Sets the protein identifications

setUnassignedPeptideIdentifications

Cython signature: void setUnassignedPeptideIdentifications(libcpp_vector[PeptideIdentification]) Sets the unassigned peptide identifications

setUniqueId

Cython signature: void setUniqueId(uint64_t rhs) Assigns a new, valid unique id.

setUniqueIds

size

Cython signature: int size()

sortByIntensity

  • Cython signature: void sortByIntensity()

sortByMZ

Cython signature: void sortByMZ() Sorts features by m/z position

sortByOverallQuality

Cython signature: void sortByOverallQuality() Sorts features by ascending overall quality.

sortByPosition

Cython signature: void sortByPosition() Sorts features by position.

sortByRT

Cython signature: void sortByRT() Sorts features by RT position

swap

Cython signature: void swap(FeatureMap &)

swapFeaturesOnly

Cython signature: void swapFeaturesOnly(FeatureMap swapfrom) Swaps the feature content (plus its range information) of this map

updateRanges

Cython signature: void updateRanges()

clear()
  • Cython signature: void clear() Clears all data and meta data

  • Cython signature: void clear(bool clear_meta_data) Clears all data and meta data. If ‘true’ is passed as an argument, all meta data is cleared in addition to the data

clearMetaInfo()

Cython signature: void clearMetaInfo() Removes all meta values

clearRanges()

Cython signature: void clearRanges() Resets all range dimensions as empty

clearUniqueId()

Cython signature: size_t clearUniqueId() Clear the unique id. The new unique id will be invalid. Returns 1 if the unique id was changed, 0 otherwise

ensureUniqueId()

Cython signature: size_t ensureUniqueId() Assigns a valid unique id, but only if the present one is invalid. Returns 1 if the unique id was changed, 0 otherwise

getDataProcessing()

Cython signature: libcpp_vector[DataProcessing] getDataProcessing()

getIdentifier()

Cython signature: String getIdentifier() Retrieve document identifier (e.g. an LSID)

getKeys()

Cython signature: void getKeys(libcpp_vector[String] & keys) Fills the given vector with a list of all keys for which a value is set

getLoadedFilePath()

Cython signature: String getLoadedFilePath() Returns the file_name which is the absolute path to the file loaded

getLoadedFileType()

Cython signature: int getLoadedFileType() Returns the file_type (e.g. featureXML, consensusXML, mzData, mzXML, mzML, …) of the file loaded

getMaxIntensity()

Cython signature: double getMaxIntensity() Returns the maximum intensity

getMaxMZ()

Cython signature: double getMaxMZ() Returns the maximum m/z

getMaxRT()

Cython signature: double getMaxRT() Returns the maximum RT

getMetaValue()

Cython signature: DataValue getMetaValue(String) Returns the value corresponding to a string, or

getMinIntensity()

Cython signature: double getMinIntensity() Returns the minimum intensity

getMinMZ()

Cython signature: double getMinMZ() Returns the minimum m/z

getMinRT()

Cython signature: double getMinRT() Returns the minimum RT

getPrimaryMSRunPath()

Cython signature: void getPrimaryMSRunPath(StringList & toFill) Returns the file path to the first MS run

getProteinIdentifications()

Cython signature: libcpp_vector[ProteinIdentification] getProteinIdentifications()

getUnassignedPeptideIdentifications()

Cython signature: libcpp_vector[PeptideIdentification] getUnassignedPeptideIdentifications()

getUniqueId()

Cython signature: size_t getUniqueId() Returns the unique id

get_assigned_peptide_identifications()

Generates a list with peptide identifications assigned to a feature.

Adds ‘ID_native_id’ (feature spectrum id), ‘ID_filename’ (primary MS run path of corresponding ProteinIdentification) and ‘feature_id’ (unique ID of corresponding Feature) as meta values to the peptide hits. A DataFrame from the assigned peptides generated with peptide_identifications_to_df(assigned_peptides) can be merged with the FeatureMap DataFrame with: merged_df = pd.merge(feature_df, assigned_peptide_df, on=[‘feature_id’, ‘ID_native_id’, ‘ID_filename’])

Returns: [PeptideIdentification]: list of PeptideIdentification objects

get_df(meta_values=None, export_peptide_identifications=True)

Generates a pandas DataFrame with information contained in the FeatureMap.

Optionally the feature meta values and information for the assigned PeptideHit can be exported.

Parameters: meta_values: meta values to include (None, [custom list of meta value names] or ‘all’)

export_peptide_identifications (bool): export sequence and score for best PeptideHit assigned to a feature. Additionally the ID_filename (file name of the corresponding ProteinIdentification) and the ID_native_id (spectrum ID of the corresponding Feature) are exported. They are also annotated as meta values when collecting all assigned PeptideIdentifications from a FeatureMap with FeatureMap.get_assigned_peptide_identifications(). A DataFrame from the assigned peptides generated with peptide_identifications_to_df(assigned_peptides) can be merged with the FeatureMap DataFrame with: merged_df = pd.merge(feature_df, assigned_peptide_df, on=[‘feature_id’, ‘ID_native_id’, ‘ID_filename’])

Returns: pandas.DataFrame: feature information stored in a DataFrame

hasInvalidUniqueId()

Cython signature: size_t hasInvalidUniqueId() Returns whether the unique id is invalid. Returns 1 if the unique id is invalid, 0 otherwise

hasValidUniqueId()

Cython signature: size_t hasValidUniqueId() Returns whether the unique id is valid. Returns 1 if the unique id is valid, 0 otherwise

isMetaEmpty()

Cython signature: bool isMetaEmpty() Returns if the MetaInfo is empty

isValid()

Cython signature: bool isValid(uint64_t unique_id) Returns true if the unique_id is valid, false otherwise

metaRegistry()

Cython signature: MetaInfoRegistry metaRegistry() Returns a reference to the MetaInfoRegistry

metaValueExists()

Cython signature: bool metaValueExists(String) Returns whether an entry with the given name exists

push_back()
  • Cython signature: void push_back(Feature spec)

  • Cython signature: void push_back(MRMFeature spec)

removeMetaValue()

Cython signature: void removeMetaValue(String) Removes the DataValue corresponding to name if it exists

setDataProcessing()

Cython signature: void setDataProcessing(libcpp_vector[DataProcessing]) Sets the description of the applied data processing

setIdentifier()

Cython signature: void setIdentifier(String id) Sets document identifier (e.g. an LSID)

setLoadedFilePath()

Cython signature: void setLoadedFilePath(String file_name) Sets the file_name according to absolute path of the file loaded, preferably done whilst loading

setLoadedFileType()

Cython signature: void setLoadedFileType(String file_name) Sets the file_type according to the type of the file loaded from, preferably done whilst loading

setMetaValue()

Cython signature: void setMetaValue(String, DataValue) Sets the DataValue corresponding to a name

setPrimaryMSRunPath()
  • Cython signature: void setPrimaryMSRunPath(StringList & s) Sets the file path to the primary MS run (usually the mzML file obtained after data conversion from raw files)

  • Cython signature: void setPrimaryMSRunPath(StringList & s, MSExperiment & e) Sets the file path to the primary MS run using the mzML annotated in the MSExperiment argument e

setProteinIdentifications()

Cython signature: void setProteinIdentifications(libcpp_vector[ProteinIdentification]) Sets the protein identifications

setUnassignedPeptideIdentifications()

Cython signature: void setUnassignedPeptideIdentifications(libcpp_vector[PeptideIdentification]) Sets the unassigned peptide identifications

setUniqueId()

Cython signature: void setUniqueId(uint64_t rhs) Assigns a new, valid unique id. Always returns 1

setUniqueIds()
size()

Cython signature: int size()

sortByIntensity()
  • Cython signature: void sortByIntensity() Sorts the peaks according to ascending intensity

  • Cython signature: void sortByIntensity(bool reverse) Sorts the peaks according to ascending intensity. Order is reversed if argument is true ( reverse = true )

sortByMZ()

Cython signature: void sortByMZ() Sorts features by m/z position

sortByOverallQuality()

Cython signature: void sortByOverallQuality() Sorts features by ascending overall quality. Order is reversed if argument is true ( reverse = true )

sortByPosition()

Cython signature: void sortByPosition() Sorts features by position. Lexicographical comparison (first RT then m/z) is done

sortByRT()

Cython signature: void sortByRT() Sorts features by RT position

swap()

Cython signature: void swap(FeatureMap &)

swapFeaturesOnly()

Cython signature: void swapFeaturesOnly(FeatureMap swapfrom) Swaps the feature content (plus its range information) of this map

updateRanges()

Cython signature: void updateRanges()