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: dragen_targeted_config.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.3.tar.gz (1.3 MB 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.3-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for advancedanalysisfileparser-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1346c23a4bdb67c58cecf8adaf50dd438fc519364ce9bdac9c0c7ef5b03c3916
MD5 0a693ece1cb51fb4afcbb736da561668
BLAKE2b-256 9fb2cf365c0a67c521bf88484af07a5bacd82072795d13614b1f8712e111d885

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for advancedanalysisfileparser-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 77e10548e1d5643a593ead256f0d245a14a8a96594d0f3886e72103739b1d59a
MD5 20ea3865ace65449a392fd35aa6a8440
BLAKE2b-256 4c694d8e7c9e3c6901cb08f19508910984923ca85197a4d77e39c0de7f631548

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