Enhance Van Krevelen and DBE plots with all-class view#31
Enhance Van Krevelen and DBE plots with all-class view#31robertyoung3 wants to merge 2 commits intoEMSL-Computing:masterfrom
Conversation
Make classe parameter optional in plot_van_krevelen() and plot_dbe_vs_carbon_number(). When omitted, plots all assigned classes using existing atoms_ratio_all/carbon_number_all/dbe_all helper methods. New parameters: - log_abundance: log10 color scaling for high dynamic range data - alpha: configurable point transparency Also adds abundance-based z-ordering (higher values on top), colorbars, and grid lines. Fully backward-compatible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@robertyoung3; this seems pretty interesting - can you add some before/after examples (with code and figures) to the PR for easier review? Ideally using some of the test data shipped. This functionality would also be good to be integrated into one of the tests for CI/CD (see tests/ folder). |
Test backward-compatible single-class plots, new all-classes view, and log10 abundance scaling for both plot_van_krevelen() and plot_dbe_vs_carbon_number(). Uses shipped Bruker SRFA test data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
DirectInfusion_FTICR_Tutorial.ipynb Thanks for the guidance. I have attached a Jupyter notebook based on the DirectInfusion_FTICR_Tutorial. I just changed the hard-coded datafile locations to something Path-based, and used ESI_NEG_SRFA_Auto.d in place of ESI_NEG_SRFA.d. The different plots are at the end of the notebook. I also added tests as you requested using the classified_mass_spectrum fixture, and ran the full test suite. All tests passed. The added tests would run a little faster if the fixture was shared between the functions, but I didn't want to touch anything outside the test file. I'll follow the same pattern with future enhancements. Thank you! |
Summary
classeparameter optional inplot_van_krevelen()andplot_dbe_vs_carbon_number()— when omitted, plots all assigned classes using existingatoms_ratio_all/carbon_number_all/dbe_allhelper methodslog_abundanceparameter for log10 color scaling (useful for high dynamic range mass spec data)alphaparameter for configurable point transparencyplot_van_krevelen("O2")calls work unchangedTest plan
plot_van_krevelen("O2")still works (single class, backward compat)plot_van_krevelen()plots all assigned classesplot_van_krevelen(log_abundance=True)applies log10 scalingplot_dbe_vs_carbon_number()works with same parameter options🤖 Generated with Claude Code