Skip to content
Snippets Groups Projects
Commit b987ff07 authored by Thomas Faraut's avatar Thomas Faraut
Browse files

correcting a bug in remove_duplicate in __init__

parent d3425681
No related branches found
No related tags found
No related merge requests found
......@@ -223,32 +223,6 @@ class SVReader(object):
return vcf_records
def RemoveDuplicatePass(self, records, cutoff=1):
vcf_records_without_duplicate = []
for idx, record in enumerate(records):
if self.CheckForDuplicate(idx, record, records, cutoff):
vcf_records_without_duplicate.append(record)
else:
print("removed entry %d %s identified as exact duplicate" %(idx, record))
return vcf_records_without_duplicate
def CheckForDuplicate(self, idx, record, records, cutoff):
for test_idx, test_record in enumerate(records):
if idx != test_idx:
if record.chrom == test_record.chrom:
if abs(record.start-test_record.start) + abs(record.end-test_record.end) < cutoff:
# We make the assumption that two variants with
# exactly the same breakpoints have the same
# supporting information hence we simply use the
# identifier to distinguish them and keep
# the one with the smaller identifier
if test_idx > idx:
return False
return True
def GeneralFilterPass(self, record, minlen, maxlen):
return (abs(record.sv_len) >= minlen and abs(record.sv_len) <= maxlen)
......@@ -258,7 +232,7 @@ class SVReader(object):
def bnd_merge(sef, svtype, records):
return records # nothing to do in the majority of cases
def remove_duplicate(sef, svtype, records):
def remove_duplicate(sef, records):
return records # nothing to do in the majority of tools (see pindel)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment