Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
epiercehoffman committed Mar 8, 2024
1 parent 00d88cf commit de7327b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/sv-pipeline/scripts/apply_ncr_and_ref_artifact_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import argparse
import sys
import pysam
import math
from typing import List, Text, Dict, Optional

_gt_no_call_map = dict()
Expand Down Expand Up @@ -40,7 +39,7 @@ def _is_hom_var(gt):

def _apply_filters(record, ploidy_dict, ncr_threshold, filter_reference_artifacts, remove_zero_carrier_sites):
if record.info['SVTYPE'] == 'CNV':
return True # skip checks and annotations for mCNVs due to lack of GT
return True # skip checks and annotations for mCNVs due to lack of GT

n_samples = 0
n_no_call = 0
Expand Down Expand Up @@ -90,10 +89,10 @@ def process(vcf, fout, ploidy_dict, args):
raise ValueError("This is a sites-only vcf")
for record in vcf:
keep = _apply_filters(record=record,
ploidy_dict=ploidy_dict,
ncr_threshold=args.ncr_threshold,
filter_reference_artifacts=args.filter_reference_artifacts,
remove_zero_carrier_sites=args.remove_zero_carrier_sites)
ploidy_dict=ploidy_dict,
ncr_threshold=args.ncr_threshold,
filter_reference_artifacts=args.filter_reference_artifacts,
remove_zero_carrier_sites=args.remove_zero_carrier_sites)
if keep:
fout.write(record)

Expand Down Expand Up @@ -162,7 +161,8 @@ def main(argv: Optional[List[Text]] = None):
if args.ncr_threshold is not None:
header.add_line(f"##FILTER=<ID={_HIGH_NCR_FILTER},Description=\"Unacceptably high rate of no-call GTs\">")
if args.filter_reference_artifacts:
header.add_line(f"##FILTER=<ID={_REFERENCE_ARTIFACT_FILTER},Description=\"Likely reference artifact sites that are homozygous alternative in over 99% of the samples\">")
header.add_line(f"##FILTER=<ID={_REFERENCE_ARTIFACT_FILTER},""Description=\"Likely reference artifact sites"
" that are homozygous alternative in over 99% of the samples\">")
if args.out is None:
fout = pysam.VariantFile(sys.stdout, 'w', header=header)
else:
Expand Down

0 comments on commit de7327b

Please sign in to comment.