From a65df1e7e93b630a2b72c983bd2abb9267358aa2 Mon Sep 17 00:00:00 2001
From: Thomas Faraut <Thomas.Faraut@inra.fr>
Date: Thu, 31 Oct 2019 14:16:32 +0100
Subject: [PATCH] new pindel specific filter

---
 svreader/pindel.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/svreader/pindel.py b/svreader/pindel.py
index 2b51cf1..f6a5e92 100644
--- a/svreader/pindel.py
+++ b/svreader/pindel.py
@@ -308,7 +308,7 @@ class PindelRecord(SVRecord):
             calls.append(calldata)
         return calls
 
-    def MaxIndSupportingRP(self):
+    def MaxIndividualSupport(self):
         max_ind_supp = 0
         for s in self.__samples:
             ad = s["up_var_read_supp"] + s["down_var_read_supp"]
@@ -319,7 +319,7 @@ class PindelRecord(SVRecord):
         alt = [vcf.model._SV(self.sv_type)]
         info = {"SVLEN": self.sv_len, "SVTYPE": self.sv_type}
 
-        info["MAX_IND_SU"] = self.MaxIndSupportingRP()
+        info["MAX_IND_SU"] = self.MaxIndividualSupport()
         info["VSAMPLES"] = ",".join(self.variantSamples())
 
         info.update(self.Modinfo)
@@ -377,12 +377,14 @@ class PindelReader(SVReader):
     #     return (record.length() > 60)
     def SpecificFilterPass(self, record):
         # fILTER
-        if (abs(record.start-record.end+1) >= 2000 and
-            record.MaxIndSupportingRP() <= 3):
+        if sv.length() >= 800 or sv.length() <= 60:
+            return False
+        elif record.MaxIndividualSupport() <= 3:
             return False
         else:
             return True
 
+
     def remove_duplicate(self, records):
         """
            returns a vector of records where duplicates were removed
-- 
GitLab