D4Xgui 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- d4xgui-1.0.0/.gitignore +38 -0
- d4xgui-1.0.0/CHANGELOG.md +22 -0
- d4xgui-1.0.0/D4Xgui/.streamlit/config.toml +15 -0
- d4xgui-1.0.0/D4Xgui/.streamlit/secrets.toml +0 -0
- d4xgui-1.0.0/D4Xgui/Welcome.py +115 -0
- d4xgui-1.0.0/D4Xgui/__init__.py +3 -0
- d4xgui-1.0.0/D4Xgui/pages/01_Data_IO.py +508 -0
- d4xgui-1.0.0/D4Xgui/pages/03_Baseline_correction.py +821 -0
- d4xgui-1.0.0/D4Xgui/pages/04_Processing.py +2049 -0
- d4xgui-1.0.0/D4Xgui/pages/05_Standardization_Results.py +880 -0
- d4xgui-1.0.0/D4Xgui/pages/06_Dual_Clumped_Space.py +826 -0
- d4xgui-1.0.0/D4Xgui/pages/07_Discover_Results.py +749 -0
- d4xgui-1.0.0/D4Xgui/pages/08_D47crunch_plots.py +308 -0
- d4xgui-1.0.0/D4Xgui/pages/100_Save_and_Reload.py +229 -0
- d4xgui-1.0.0/D4Xgui/pages/97_Database_Management.py +630 -0
- d4xgui-1.0.0/D4Xgui/pages/99_st.session_state.py_not +16 -0
- d4xgui-1.0.0/D4Xgui/pages/__init__.py +0 -0
- d4xgui-1.0.0/D4Xgui/run.py +133 -0
- d4xgui-1.0.0/D4Xgui/static/D4Xgui_logo_master_red08.png +0 -0
- d4xgui-1.0.0/D4Xgui/static/SampleDatabase.xlsx +0 -0
- d4xgui-1.0.0/D4Xgui/static/exampleIntensities_anonymized.xlsx +0 -0
- d4xgui-1.0.0/D4Xgui/static/exampleReplicates_anonymized.xlsx +0 -0
- d4xgui-1.0.0/D4Xgui/tools/Pysotope_fork.py +690 -0
- d4xgui-1.0.0/D4Xgui/tools/__init__.py +2 -0
- d4xgui-1.0.0/D4Xgui/tools/authenticator.py +160 -0
- d4xgui-1.0.0/D4Xgui/tools/calc_temperature.py +195 -0
- d4xgui-1.0.0/D4Xgui/tools/commons.py +477 -0
- d4xgui-1.0.0/D4Xgui/tools/database.py +355 -0
- d4xgui-1.0.0/D4Xgui/tools/init_params.py +200 -0
- d4xgui-1.0.0/D4Xgui/tools/page_config.py +160 -0
- d4xgui-1.0.0/D4Xgui/tools/sidebar_logo.py +54 -0
- d4xgui-1.0.0/D4Xgui.egg-info/PKG-INFO +103 -0
- d4xgui-1.0.0/D4Xgui.egg-info/SOURCES.txt +43 -0
- d4xgui-1.0.0/D4Xgui.egg-info/dependency_links.txt +1 -0
- d4xgui-1.0.0/D4Xgui.egg-info/entry_points.txt +2 -0
- d4xgui-1.0.0/D4Xgui.egg-info/requires.txt +41 -0
- d4xgui-1.0.0/D4Xgui.egg-info/top_level.txt +1 -0
- d4xgui-1.0.0/INSTALLATION.md +123 -0
- d4xgui-1.0.0/LICENSE +21 -0
- d4xgui-1.0.0/MANIFEST.in +11 -0
- d4xgui-1.0.0/PKG-INFO +103 -0
- d4xgui-1.0.0/README.md +36 -0
- d4xgui-1.0.0/pyproject.toml +60 -0
- d4xgui-1.0.0/requirements.txt +59 -0
- d4xgui-1.0.0/setup.cfg +4 -0
d4xgui-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
venv/
|
|
3
|
+
env/
|
|
4
|
+
ENV/
|
|
5
|
+
.venv/
|
|
6
|
+
.env
|
|
7
|
+
.env.local
|
|
8
|
+
.env.*.local
|
|
9
|
+
|
|
10
|
+
.streamlit/secrets.toml
|
|
11
|
+
.streamlit/cache/
|
|
12
|
+
.streamlit/config.toml.local
|
|
13
|
+
test_assertion_results.txt
|
|
14
|
+
|
|
15
|
+
docs/build/
|
|
16
|
+
|
|
17
|
+
__pycache__/
|
|
18
|
+
.idea/
|
|
19
|
+
.vscode/
|
|
20
|
+
*.code-workspace
|
|
21
|
+
.ipynb_checkpoints
|
|
22
|
+
*.ipynb
|
|
23
|
+
|
|
24
|
+
.DS_Store
|
|
25
|
+
._*
|
|
26
|
+
.fseventsd
|
|
27
|
+
.Spotlight-V100
|
|
28
|
+
.TemporaryItems
|
|
29
|
+
.Trashes
|
|
30
|
+
.VolumeIcon.icns
|
|
31
|
+
|
|
32
|
+
*.db
|
|
33
|
+
|
|
34
|
+
*~
|
|
35
|
+
.~*
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
*.pyc
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.0.0] - 2025-12-01 – Initial commit
|
|
4
|
+
|
|
5
|
+
+ Initial release of D4Xgui
|
|
6
|
+
+ Data I/O functionality for uploading replicate and intensity data
|
|
7
|
+
+ Baseline correction using m/z47.5 half-mass cup
|
|
8
|
+
+ Processing capabilities for D47, D48, and D49 clumped isotopes
|
|
9
|
+
+ Standardization results visualization
|
|
10
|
+
+ Dual clumped space plotting
|
|
11
|
+
+ Interactive data discovery and analysis
|
|
12
|
+
+ D47crunch integration for data processing
|
|
13
|
+
+ Database management for storing and retrieving pre-processed d45-d49 data
|
|
14
|
+
+ Save and reload functionality for session states
|
|
15
|
+
+ Support for multiple calibration methods using D47calib
|
|
16
|
+
+ Temperature calculation from D47 values
|
|
17
|
+
+ Excel export functionality for results
|
|
18
|
+
|
|
19
|
+
## [1.0.1] - 2025-12-04
|
|
20
|
+
|
|
21
|
+
+ exclude `Session` and `Sample` from smart_numeric_conversion()
|
|
22
|
+
+ Publish D4Xgui to PyPI
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[theme]
|
|
2
|
+
base="dark"
|
|
3
|
+
primaryColor= '#aa80f7'#aa80f7'#"#7070A0" # Dark Purple-Blue primaryColor="#3B4A59" # Dark Blue for primary elements
|
|
4
|
+
backgroundColor='#0E1117'#"#121212" # Very Dark Gray for background
|
|
5
|
+
secondaryBackgroundColor="#262730" # Darker Gray for secondary background
|
|
6
|
+
textColor="#FAFAFA" # Lightest Gray for text
|
|
7
|
+
font="sans serif"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
[browser]
|
|
11
|
+
gatherUsageStats = false
|
|
12
|
+
|
|
13
|
+
[server]
|
|
14
|
+
showEmailPrompt = false
|
|
15
|
+
port = 1337
|
|
File without changes
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
import os.path
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Dict, Any
|
|
6
|
+
|
|
7
|
+
import streamlit as st
|
|
8
|
+
import D47crunch
|
|
9
|
+
|
|
10
|
+
from tools.page_config import set_page_config
|
|
11
|
+
from tools import sidebar_logo
|
|
12
|
+
from tools.database import init_db
|
|
13
|
+
from tools.init_params import INIT_PARAMS
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class WelcomePageManager:
|
|
18
|
+
"""Manages the welcome page content and initialization."""
|
|
19
|
+
|
|
20
|
+
def __init__(self):
|
|
21
|
+
"""Initialize the welcome page manager."""
|
|
22
|
+
self.app_dir = Path(__file__).parent.absolute()
|
|
23
|
+
self.session_state = st.session_state
|
|
24
|
+
self._setup_page()
|
|
25
|
+
self._initialize_database()
|
|
26
|
+
self._initialize_session_state()
|
|
27
|
+
|
|
28
|
+
def _setup_page(self) -> None:
|
|
29
|
+
"""Set up the page configuration and sidebar."""
|
|
30
|
+
set_page_config(0)
|
|
31
|
+
sidebar_logo.add_logo()
|
|
32
|
+
|
|
33
|
+
def _initialize_database(self) -> None:
|
|
34
|
+
"""Initialize the application database."""
|
|
35
|
+
init_db()
|
|
36
|
+
|
|
37
|
+
def _initialize_session_state(self) -> None:
|
|
38
|
+
"""Initialize session state with default parameters if not present."""
|
|
39
|
+
if 'standards_nominal' not in self.session_state:
|
|
40
|
+
self.session_state['standards_nominal'] = {**INIT_PARAMS['standards_nominal']}
|
|
41
|
+
#self.session_state['working_gas'] = {**INIT_PARAMS['working_gas']}
|
|
42
|
+
|
|
43
|
+
def _get_info_content(self) -> str:
|
|
44
|
+
"""Generate the welcome page information content.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
Formatted markdown string with welcome information.
|
|
48
|
+
"""
|
|
49
|
+
return rf"""## Welcome to D4Xgui v1.0.0!
|
|
50
|
+
|
|
51
|
+
[D4Xgui](https://github.com/itsMig/D4Xgui) is developed to enable easy access to state-of-the-art CO₂ clumped isotope (∆₄₇, ∆₄₈ and ∆₄₉) data processing.
|
|
52
|
+
A recently developed optimizer algorithm allows pre-processing of mass spectrometric raw intensities utilizing a m/z47.5 half-mass Faraday cup correction to account for the effect of a negative pressure baseline, which is essential for accurate and highest precision clumped isotope analysis of CO₂ ([Bernecker et al., 2023](https://doi.org/10.1016/j.chemgeo.2023.121803)).
|
|
53
|
+
It is backed with the recently published processing tool [D47crunch (v.{D47crunch.__version__})](https://github.com/mdaeron/D47crunch) (following the methodology outlined in [Daeron, 2021](https://doi.org/10.1029/2020GC009592)), which allows standardization under consideration of full error propagation and has been used for the InterCarb community effort ([Bernasconi et al., 2021](https://doi.org/10.1029/2020GC009588)).
|
|
54
|
+
This web-app allows users to discover replicate- or sample-based processing results in interactive spreadsheets and plots.
|
|
55
|
+
|
|
56
|
+
<br>
|
|
57
|
+
|
|
58
|
+
Example data is accessible from the Data-IO page, or can be downloaded from [GitHub](https://github.com/itsMig/D4Xgui/tree/main/D4Xgui/static).
|
|
59
|
+
|
|
60
|
+
<br>
|
|
61
|
+
|
|
62
|
+
In order to process post-background corrected data (Data-IO page, Upload δ⁴⁵-δ⁴⁹ replicates tab), the following columns need to be provided (`.xlsx`, `.csv`):
|
|
63
|
+
|
|
64
|
+
| `UID` | `Sample` | `Session` | `Timetag` | `d45` | `d46` | `d47` | `d48` | `d49` |
|
|
65
|
+
|----|----|----|----|----|----|----|----|----|
|
|
66
|
+
|
|
67
|
+
$~$
|
|
68
|
+
|
|
69
|
+
Baseline correction can be performed using a m/z47.5 half-mass cup. For this purpose either a set of equilibrated gases (via heated-gas-line), or carbonate standards (via target values) is used to determine m/z47, m/z48 and m/z49-specific scaling factors. Please upload a cycle-based spreadsheet (`.xlsx`, `.csv`) including the following columns (Data-IO page, Upload m/z44-m/z49 intensities tab):
|
|
70
|
+
|
|
71
|
+
| `UID` | `Sample` | `Session` | `Timetag` | `Replicate` |
|
|
72
|
+
|----|----|----|----|----|
|
|
73
|
+
|
|
74
|
+
| `raw_r44` | `raw_r45` | `raw_r46` | `raw_r47` | `raw_r48` | `raw_r49` | `raw_r47.5` |
|
|
75
|
+
|----|----|----|----|----|----|----|
|
|
76
|
+
|
|
77
|
+
| `raw_s44` | `raw_s45` | `raw_s46` | `raw_s47` | `raw_s48` | `raw_s49` | `raw_s47.5` |
|
|
78
|
+
|----|----|----|----|----|----|----|
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<br><br>
|
|
82
|
+
Please find the [code documentation here](https://itsmig.github.io/D4Xgui/index.html).
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
def _save_readme(self, content: str) -> None:
|
|
86
|
+
"""Save the welcome content to README.md file.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
content: Content to save to README.md.
|
|
90
|
+
"""
|
|
91
|
+
try:
|
|
92
|
+
with open(os.path.join(self.app_dir,'../INSTALLATION.md', ),'r') as file:
|
|
93
|
+
content += f"\n" + file.read()
|
|
94
|
+
|
|
95
|
+
readme_path = Path('../README.md')
|
|
96
|
+
readme_path.write_text(content, encoding='utf-8')
|
|
97
|
+
except Exception as e:
|
|
98
|
+
st.warning(f"Could not save README.md: {e}")
|
|
99
|
+
|
|
100
|
+
def display_welcome_page(self) -> None:
|
|
101
|
+
"""Display the welcome page content."""
|
|
102
|
+
|
|
103
|
+
info_content = self._get_info_content()
|
|
104
|
+
# self._save_readme(info_content)
|
|
105
|
+
st.markdown(info_content, unsafe_allow_html=True)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def main():
|
|
109
|
+
"""Main function to run the welcome page."""
|
|
110
|
+
welcome_manager = WelcomePageManager()
|
|
111
|
+
welcome_manager.display_welcome_page()
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
if __name__ == "__main__":
|
|
115
|
+
main()
|