Update VCFparser.py
Browse files- VCFparser.py +0 -10
VCFparser.py
CHANGED
|
@@ -435,12 +435,10 @@ def create_parser_from_config(config_manager: ConfigManager) -> VCFParser:
|
|
| 435 |
"""Create VCF parser from configuration manager."""
|
| 436 |
config = config_manager.data_config
|
| 437 |
|
| 438 |
-
# Initialize gene annotator
|
| 439 |
gene_annotator = None
|
| 440 |
if config.gene_annotation_path:
|
| 441 |
gene_annotator = GeneAnnotationManager(config.gene_annotation_path)
|
| 442 |
|
| 443 |
-
# Initialize pathway mapper
|
| 444 |
pathway_mapper = None
|
| 445 |
if config.pathway_mapping_path:
|
| 446 |
pathway_mapper = PathwayMapper(config.pathway_mapping_path)
|
|
@@ -451,29 +449,21 @@ def create_parser_from_config(config_manager: ConfigManager) -> VCFParser:
|
|
| 451 |
pathway_mapper=pathway_mapper
|
| 452 |
)
|
| 453 |
|
| 454 |
-
|
| 455 |
-
# Example usage
|
| 456 |
if __name__ == "__main__":
|
| 457 |
-
# Example usage with configuration
|
| 458 |
config_manager = ConfigManager()
|
| 459 |
|
| 460 |
-
# Set up file paths
|
| 461 |
config_manager.data_config.vcf_file_path = "example.vcf"
|
| 462 |
config_manager.data_config.gene_annotation_path = "gene_annotations.json"
|
| 463 |
config_manager.data_config.pathway_mapping_path = "pathway_mappings.json"
|
| 464 |
|
| 465 |
-
# Create parser
|
| 466 |
parser = create_parser_from_config(config_manager)
|
| 467 |
|
| 468 |
-
# Parse VCF file
|
| 469 |
try:
|
| 470 |
hierarchical_data = parser.parse_vcf_file(config_manager.data_config.vcf_file_path)
|
| 471 |
|
| 472 |
-
# Print statistics
|
| 473 |
stats = parser.get_parsing_statistics()
|
| 474 |
print(f"Parsing Statistics: {stats}")
|
| 475 |
|
| 476 |
-
# Export results
|
| 477 |
parser.export_parsed_data(
|
| 478 |
hierarchical_data,
|
| 479 |
"parsed_vcf_data.json",
|
|
|
|
| 435 |
"""Create VCF parser from configuration manager."""
|
| 436 |
config = config_manager.data_config
|
| 437 |
|
|
|
|
| 438 |
gene_annotator = None
|
| 439 |
if config.gene_annotation_path:
|
| 440 |
gene_annotator = GeneAnnotationManager(config.gene_annotation_path)
|
| 441 |
|
|
|
|
| 442 |
pathway_mapper = None
|
| 443 |
if config.pathway_mapping_path:
|
| 444 |
pathway_mapper = PathwayMapper(config.pathway_mapping_path)
|
|
|
|
| 449 |
pathway_mapper=pathway_mapper
|
| 450 |
)
|
| 451 |
|
|
|
|
|
|
|
| 452 |
if __name__ == "__main__":
|
|
|
|
| 453 |
config_manager = ConfigManager()
|
| 454 |
|
|
|
|
| 455 |
config_manager.data_config.vcf_file_path = "example.vcf"
|
| 456 |
config_manager.data_config.gene_annotation_path = "gene_annotations.json"
|
| 457 |
config_manager.data_config.pathway_mapping_path = "pathway_mappings.json"
|
| 458 |
|
|
|
|
| 459 |
parser = create_parser_from_config(config_manager)
|
| 460 |
|
|
|
|
| 461 |
try:
|
| 462 |
hierarchical_data = parser.parse_vcf_file(config_manager.data_config.vcf_file_path)
|
| 463 |
|
|
|
|
| 464 |
stats = parser.get_parsing_statistics()
|
| 465 |
print(f"Parsing Statistics: {stats}")
|
| 466 |
|
|
|
|
| 467 |
parser.export_parsed_data(
|
| 468 |
hierarchical_data,
|
| 469 |
"parsed_vcf_data.json",
|