Skip to main content

Parse Illumina-DRAGEN TSV/JSON outputs to unified geneyx JSON with warnings.

Project description

AdvancedAnalysisFileParser

PyPI version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

advancedanalysisfileparser-0.1.0.tar.gz (56.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

advancedanalysisfileparser-0.1.0-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

Details for the file advancedanalysisfileparser-0.1.0.tar.gz.

File metadata

File hashes

Hashes for advancedanalysisfileparser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 951a8d52f8a3a3ac8f384b1d0c14c04c0c28e5ba6e9d0267b368f16a1ac56f78
MD5 84aad0fa27fd7c6382bc8cb39cff5314
BLAKE2b-256 13b86560bb033eae4c46fdfb4bd3746ec944f86a309b2af9a6376cabe1349cf1

See more details on using hashes here.

File details

Details for the file advancedanalysisfileparser-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for advancedanalysisfileparser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcc274e78372525d91f737dcea476678c10ad64e8ad81bc1669a37b601f262c9
MD5 2826dce302e80efe84943ffe7d802f12
BLAKE2b-256 2cfea5875b66fa19ae89a33d8d978b25cee9a301c38a25bc4514a3c7c7dfb66e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page