Metadata-Version: 2.4
Name: alex123-tlg
Version: 0.7.0
Summary: ALEX123-TLG - GUI application for generating target lists for searching FTMS, MS2 and MS3 mass spectrometry data.
Author-email: Sergii Mamedov <sergii.mamedov@embl.de>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: ftms,gui,lipidomics,mass-spectrometry,ms2,ms3,target-list
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: MacOS X
Classifier: Environment :: Win32 (MS Windows)
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Requires-Python: >=3.11
Requires-Dist: pandas~=2.3.0
Requires-Dist: pyside6-essentials~=6.10.0
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-qt; extra == 'test'
Description-Content-Type: text/markdown

# ALEX123-TLG (Target List Generator)

A GUI application for generating target lists for searching FTMS, MS2, and MS3 mass spectrometry data. Part of the ALEX123 lipidomics suite.

## Features

- Multi-criterion filtering with OR logic combination
- Fragment filtering for MS2/MS3 tabs (AND logic)
- Chain index filtering (C/DB/OH) with min/max ranges and even/odd options
- Polarity filtering (positive/negative/neutral)
- Save and load filter configurations (.lxt files)
- Paginated data preview
- Cross-platform support (Windows, macOS, Linux)

## Installation on Windows

1. Create a virtual environment. We recommend a shared `venv` for all ALEX123 modules:

```
cd C:\Users\user_name\alex123_software
python -m venv venv
```

2. Activate the virtual environment:

```
venv\Scripts\activate
```

3. Install the wheel (adjust the path if needed):

```
pip install C:\Users\user_name\Downloads\alex123_tlg-0.6.0-py3-none-any.whl
```

*for Christer:*
```
pip install C:\_MyStuff\ALEX123_software\alex123_tlg-0.6.2a0-py3-none-any.whl
```

All dependencies (PySide6, pandas) will be installed automatically.

## Input Data Files

The application needs three TSV files: `ms1.tsv`, `ms2.tsv`, and `ms3.tsv`.

By default it looks for them in the platform-specific configuration directory:

| OS | Directory                                    |
|----|----------------------------------------------|
| Windows | `%APPDATA%\alex123-tlg\`                     |
| macOS | `~/Library/Application Support/alex123-tlg/` |
| Linux | `~/.config/alex123-tlg/`                     |

Copy `ms1.tsv`, `ms2.tsv`, and `ms3.tsv` into that directory.


## Running the Application

| Method | Command |
|--------|---------|
| Console script (after wheel install) | `alex123-tlg` |
| Python module (from source) | `python -m app` |

On Windows, you can also create a `.cmd` launcher file with the following content and double-click it:

```
@echo off
cd /d "%~dp0"
"C:\Users\user_name\alex123_software\venv\Scripts\alex123-tlg.exe"
```

Replace `C:\Users\user_name\alex123_software` with the actual path to your virtual environment.

## Usage

1. **Select working directory** -- choose the folder where output files will be saved
2. **Switch tab** -- select the MS1, MS2, or MS3 tab
3. **Add filtering criteria** -- configure filters for lipid class, species, adduct, category, and polarity
4. **Set chain index filters** (optional) -- adjust C, DB, and OH index ranges
5. **Configure fragment filters** (MS2/MS3 only) -- set fragment chain index filters
6. **Click "Run"** -- preview filtered results in the table
7. **Click "Save"** -- export the target list and filter configuration

## Output Files

Saved to the selected working directory:

| File | Description |
|------|-------------|
| `targetlist_ms1.txt` | Filtered MS1 target list (TSV) |
| `targetlist_ms2.txt` | Filtered MS2 target list (TSV) |
| `targetlist_ms3.txt` | Filtered MS3 target list (TSV) |
| `targetlist_ms1.lxt` | MS1 filter configuration (JSON) |
| `targetlist_ms2.lxt` | MS2 filter configuration (JSON) |
| `targetlist_ms3.lxt` | MS3 filter configuration (JSON) |

## Development

### Run from source

```bash
uv pip install -r requirement.txt
python -m alex123_tlg
```

### Linters

```bash
uv run isort . --check-only --diff
uv tool run ruff check .
```

### Tests

```bash
uv pip install -r requirements-test.txt
uv run pytest tests/ -v
```

### Build wheel

```bash
uv build --wheel
```
