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.1.tar.gz (58.6 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.1-py3-none-any.whl (85.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for advancedanalysisfileparser-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6c9fadd815e035ce0c7699f49a919e3cab3a7e5c7bec20ef8f32a543415f5713
MD5 4ad755cd593472fb9df685c9f2174d0c
BLAKE2b-256 5677b55ff6c718da731bae33eb7956d5d84485782eff2211ef029e69c0dfb7b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for advancedanalysisfileparser-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb47e6fa23a0b85c5b0117baee12b7e21748025d36540c231abaae51d5fa5e47
MD5 d121f8720a832ca175dc7795669c8370
BLAKE2b-256 86c8d6246f85426d6467d876652c98bd9218c3365b6b9fc5f0e9f07ba5a687c1

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