Parse Illumina-DRAGEN TSV/JSON outputs to unified geneyx JSON with warnings.
Project description
AdvancedAnalysisFileParser
A Python package to parse Illumina-DRAGEN "special caller" outputs (TSV/JSON) into a unified JSON format, with automatic warnings based on user-defined or default conditions. Supports oncology, GBA, SMN, HBA, and more.
Features
- Unified JSON output for multiple DRAGEN caller types (TSV/JSON)
- Automatic warnings for each file type, based on config or defaults
- Pluggable parser architecture for new file types
- CLI and Python API usage
- Example configs and test data included
Installation
Install from PyPI (recommended):
pip install AdvancedAnalysisFileParser
Or from source:
git clone https://github.com/geneyx/geneyx.analysis.api.git
cd geneyx.analysis.api/scripts/AdvancedAnalysisFileParser
pip install -e .
Quickstart
Python API Usage
from AdvancedAnalysisFileParser.AdvancedAnalysisParser import AdvancedAnalysisParser
request = {
"input_dir": "./Test",
"output_dir": "./Test",
"output_json": "adv_output.json",
# Optionally, you can specify input_files or map_files for custom configs
}
parser = AdvancedAnalysisParser(request)
parser.run() # writes output to adv_output.json
# Or get result as dict:
result = parser.run(return_dict=True)
print(result)
Command-Line Usage
Create a config file (e.g. config.json):
{
"input_dir": "./Test",
"output_dir": "./Test",
"output_json": "adv_output.json"
}
Then run:
python -m AdvancedAnalysisFileParser.AdvancedAnalysisParser -c config.json
Configuration
The parser uses config files (JSON) to define how to parse and warn for each file type. Default configs are provided for:
- GBA:
gba_tsv_config.json - SMN:
smn_tsv_config.json - Oncology:
dragen_500_tsv_config.json - JSON:
advConfig.json
You can override or extend these by providing your own config in the map_files key of the request.
Example request/config structure
| Key | Type | Description |
|---|---|---|
output_json |
string | Filename for the generated JSON (default: adv_analysis_output.json) |
input_dir |
string | Directory containing all input files |
input_files |
list | (Optional) List of files to parse |
map_files |
object | (Optional) Mapping of filenames → caller definitions |
Warnings
Warnings are generated automatically for each caller/file type, based on the config. Each config defines conditions for warnings (see *_config.json files for examples). You can customize these for your use case.
Testing
Run the test suite to validate all parsing and warning logic:
pytest AdvancedAnalysisFileParser/Test_AdvancedAnalysisParser.py
Or run the test script:
python AdvancedAnalysisFileParser/run_test_parser.py
Example Data
See the Test/ folder for example input files (TSV/JSON) and expected outputs.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file advancedanalysisfileparser-0.1.2.tar.gz.
File metadata
- Download URL: advancedanalysisfileparser-0.1.2.tar.gz
- Upload date:
- Size: 58.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42db0f422b75e3b9ca11681c8f28af07fc3fa31cf299d7bdae756691062e553a
|
|
| MD5 |
50f243b2b4592d5a257feb6ae9b4ef3a
|
|
| BLAKE2b-256 |
ee59531a320581f03e6b35b0fc3b1507e31b7ac9d38c0cfe316cef9990354ea0
|
File details
Details for the file advancedanalysisfileparser-0.1.2-py3-none-any.whl.
File metadata
- Download URL: advancedanalysisfileparser-0.1.2-py3-none-any.whl
- Upload date:
- Size: 85.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de2e426f2d509acc85e940ec705626330e8f61dbf6bf77172ea2ade8214d9e13
|
|
| MD5 |
fbc02ff3cfca6b42ea58004b8849783d
|
|
| BLAKE2b-256 |
74ab04f877d0c96173fc1065154f736987128e80f04c74561daa0c9300d19e6d
|