|
2 | 2 | Utilities for harmonizing tandem repeat VCF records.
|
3 | 3 | Handles VCFs generated by various TR genotyping tools
|
4 | 4 | """
|
| 5 | + |
5 | 6 | import re
|
6 | 7 | import math
|
7 | 8 | import enum
|
@@ -462,8 +463,7 @@ def _HarmonizeHipSTRRecord(vcfrecord: cyvcf2.Variant):
|
462 | 463 | ):
|
463 | 464 | raise TypeError(
|
464 | 465 | "Record at {}:{} is missing one of the mandatory HipSTR info fields START,"
|
465 |
| - " END, PERIOD. ".format(vcfrecord.CHROM, vcfrecord.POS) |
466 |
| - + _beagle_error |
| 466 | + " END, PERIOD. ".format(vcfrecord.CHROM, vcfrecord.POS) + _beagle_error |
467 | 467 | )
|
468 | 468 | # determine full alleles and trimmed alleles
|
469 | 469 | pos = int(vcfrecord.POS)
|
@@ -536,8 +536,7 @@ def _HarmonizeAdVNTRRecord(vcfrecord: cyvcf2.Variant):
|
536 | 536 | if vcfrecord.INFO.get("RU") is None or vcfrecord.INFO.get("VID") is None:
|
537 | 537 | raise TypeError(
|
538 | 538 | "Record at {}:{} is missing one of the mandatory ADVNTR info fields RU,"
|
539 |
| - " VID. ".format(vcfrecord.CHROM, vcfrecord.POS) |
540 |
| - + _beagle_error |
| 539 | + " VID. ".format(vcfrecord.CHROM, vcfrecord.POS) + _beagle_error |
541 | 540 | )
|
542 | 541 | ref_allele = vcfrecord.REF.upper()
|
543 | 542 | if vcfrecord.ALT:
|
@@ -651,8 +650,7 @@ def _HarmonizeEHRecord(vcfrecord: cyvcf2.Variant):
|
651 | 650 | if vcfrecord.INFO.get("VARID") is None or vcfrecord.INFO.get("RU") is None:
|
652 | 651 | raise TypeError(
|
653 | 652 | "Record at {}:{} is missing one of the mandatory ExpansionHunter info"
|
654 |
| - " fields VARID, RU. ".format(vcfrecord.CHROM, vcfrecord.POS) |
655 |
| - + _beagle_error |
| 653 | + " fields VARID, RU. ".format(vcfrecord.CHROM, vcfrecord.POS) + _beagle_error |
656 | 654 | )
|
657 | 655 | record_id = vcfrecord.INFO["VARID"]
|
658 | 656 | motif = vcfrecord.INFO["RU"].upper()
|
|
0 commit comments