agentsclimarketplace

Pandas dataframe manipulation ms columns

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/pandas-dataframe-manipulation-ms-columns

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill pandas-dataframe-manipulation-ms-columns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when when you have raw mass spectrometry data (from mzML, Bruker .d, or CSV format) loaded into a Pandas DataFrame and need to ensure it has the correct column structure (m/z, retention time, intensity) before invoking pyOpenMS-Viz plotting functions like .plot(kind='spectrum'), .

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

6.7 KB, as published. Nobody here has run it

pandas-dataframe-manipulation-ms-columns

Summary

Prepare and structure mass spectrometry data within Pandas DataFrames by organizing and selecting columns for m/z, retention time, and intensity dimensions required by pyOpenMS-Viz plotting methods. This skill ensures data is in the correct format and column names are compatible with the visualization backend.

When to use

When you have raw mass spectrometry data (from mzML, Bruker .d, or CSV format) loaded into a Pandas DataFrame and need to ensure it has the correct column structure (m/z, retention time, intensity) before invoking pyOpenMS-Viz plotting functions like .plot(kind='spectrum'), .plot(kind='peakmap'), or .plot(kind='chromatogram').

When NOT to use

  • Data is already in a specialized mass spectrometry object format (e.g., pyOpenMS MSSpectrum, MSChromatogram) that does not need DataFrame conversion
  • Column structure and naming are already validated and match pyOpenMS-Viz expectations
  • Input is binary or proprietary mass spectrometry data that requires vendor-specific parsers before any DataFrame creation

Inputs

  • Pandas DataFrame with mass spectrometry data (loaded from mzML, Bruker .d, CSV, or similar format)
  • Column names and data types present in the DataFrame
  • Target plot type (spectrum, chromatogram, peakmap, mobilogram)

Outputs

  • Prepared Pandas DataFrame with correctly named and typed columns (m/z, retention time, intensity)
  • DataFrame ready for input to pyOpenMS-Viz .plot() method

How to apply

Load mass spectrometry data into a Pandas DataFrame using appropriate readers (PyOpenMS, pymzML, pyteomics for mzML, or alphatims for Bruker .d format), ensuring the resulting DataFrame contains columns for m/z (mass-to-charge ratio), retention time (rt), and intensity values. Inspect and rename columns as needed to match the expected names used by pyOpenMS-Viz (typically 'x', 'y', 'z' or domain-specific names like 'm/z', 'rt', 'intensity'). Use the 'versatile column selection' feature documented in pyOpenMS-Viz to map your DataFrame columns to the required dimensions for your chosen plot type. Verify column data types are numeric (float or int) before passing the DataFrame to the plotting method. This standardization enables seamless backend switching and ensures consistent API behavior across matplotlib, Bokeh, and Plotly backends.

Related tools

  • Pandas (DataFrame data structure and column manipulation for organizing m/z, retention time, and intensity columns)
  • PyOpenMS (Loading and parsing mass spectrometry data from mzML and native OpenMS formats into Pandas-compatible structures)
  • pymzML (Alternative parser for mzML mass spectrometry files into DataFrame-ready format)
  • pyteomics (Alternative parser for mzML mass spectrometry files into DataFrame-ready format)
  • alphatims (Parser for Bruker .d format mass spectrometry files into DataFrame-ready format)
  • pyOpenMS-Viz (Visualization library that consumes prepared DataFrames with correctly named m/z, retention time, and intensity columns via the .plot() method) — https://github.com/OpenMS/pyopenms_viz

Examples

ms_data = pd.read_csv('path/to/ms_data.csv')
ms_data.plot(x='m/z', y='intensity', kind='spectrum')

Evaluation signals

  • DataFrame contains numeric columns for m/z (mass-to-charge ratio), retention time (rt), and intensity with appropriate float or int dtypes
  • Column names match pyOpenMS-Viz expectations or are explicitly mapped to plot method parameters (x, y, z or specific dimension names)
  • DataFrame.plot(x='m/z', y='intensity', kind='spectrum') or equivalent call executes without KeyError or TypeError exceptions
  • Subsequent .plot(kind='peakmap', plot_3d=True) or other pyOpenMS-Viz plotting methods receive the DataFrame without schema validation errors
  • Interactive HTML output from fig.write_html() or static plot objects are successfully generated without data dimension mismatches

Limitations

  • pyOpenMS-Viz 3D PeakMap visualization (plot_3d=True) is only supported by Plotly backend, not matplotlib or Bokeh, so DataFrame structure alone does not guarantee 3D rendering success
  • Column selection flexibility requires manual mapping if input data uses non-standard column names; no automatic column detection is guaranteed across all input formats
  • Data quality issues (missing values, outliers, non-numeric entries in intensity or m/z columns) are not automatically handled by DataFrame preparation and may cause visualization failures downstream

Evidence

  • [other] Load mass spectrometry data from an mzML or Bruker .d file into a pandas DataFrame using PyOpenMS, pymzML, pyteomics (for mzML) or alphatims (for .d format), ensuring columns for m/z, retention time, and intensity are present.: "Load mass spectrometry data from an mzML or Bruker .d file into a pandas DataFrame using PyOpenMS, pymzML, pyteomics (for mzML) or alphatims (for .d format), ensuring columns for m/z, retention time,"
  • [readme] Versatile column selection for easy adaptation to different data formats: "Versatile column selection for easy adaptation to different data formats"
  • [readme] Flexible plotting API that interfaces directly with Pandas DataFrames: "Flexible plotting API that interfaces directly with Pandas DataFrames"
  • [readme] pyOpenMS-Viz is a Python library that provides a simple interface for extending the plotting capabilities of Pandas DataFrames for creating static or interactive visualizations of mass spectrometry data.: "pyOpenMS-Viz is a Python library that provides a simple interface for extending the plotting capabilities of Pandas DataFrames for creating static or interactive visualizations of mass spectrometry"

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.