Skip to content

Commit

Permalink
Updated dragen standardizer
Browse files Browse the repository at this point in the history
  • Loading branch information
kjaisingh committed Jan 13, 2025
1 parent 416d459 commit ba12de1
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/svtk/svtk/standardize/std_dragen.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def standardize_records(self):
Skip mated events that are not marked with SECONDARY tag.
"""

# Track IDs of observed records
mate_IDs = deque()

# Iterate over records
for record in self.filter_raw_vcf():
# Filter unmarked SECONDARY on same chromosome
if 'MATEID' in record.info:
Expand All @@ -56,8 +59,7 @@ def standardize_records(self):
# Skip records with an observed mate
if mate_ID in mate_IDs:
continue

# Track IDs of observed records

mate_IDs.append(record.id)

yield self.standardize_record(record)
Expand Down Expand Up @@ -117,15 +119,9 @@ def standardize_info(self, std_rec, raw_rec):
strands = '+-'
elif svtype == 'DUP':
strands = '-+'
elif svtype == 'INS': # Treat DUPSVLEN as DUP
if 'DUPSVLEN' in raw_rec.info:
svtype = 'DUP'
std_rec.info['SVTYPE'] = svtype
strands = '-+'
else:
strands = '+-'
else: # Default
elif svtype == 'INS':
strands = '+-'

if not is_smaller_chrom(std_rec.chrom, std_rec.info['CHR2']):
strands = strands[::-1]
std_rec.info['STRANDS'] = strands
Expand Down

0 comments on commit ba12de1

Please sign in to comment.