forked from OpenMS/pyopenms_viz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_peakmap.py
More file actions
23 lines (18 loc) · 791 Bytes
/
Copy pathplot_peakmap.py
File metadata and controls
23 lines (18 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
PeakMap TEMPLATE
================
This shows a peakmap across m/z and retention time. This peakmap is quite clean because signals are extracted across the m/z dimension.
"""
import pandas as pd
from pyopenms_viz.util import download_file
pd.options.plotting.backend = "TEMPLATE"
# GitHub raw URL (primary) with Zenodo as backup
url = "https://raw.githubusercontent.com/OpenMS/pyopenms_viz/main/test/test_data/ionMobilityTestFeatureDf.tsv"
backup_url = (
"https://zenodo.org/records/17904352/files/ionMobilityTestFeatureDf.tsv?download=1"
)
local_path = "ionMobilityTestFeatureDf.tsv"
download_file(url, local_path, backup_url=backup_url)
df = pd.read_csv(local_path, sep="\t")
# Code to plot a peakmap
df.plot(kind="peakmap", x="rt", y="mz", z="int", aggregate_duplicates=True)