From 56d7ffe2b5b6a1f1611d2a150014faab0291415d Mon Sep 17 00:00:00 2001
From: Brandi Cantarel <brandi.cantarel@utsouthwestern.edu>
Date: Mon, 12 Oct 2020 16:30:05 -0500
Subject: [PATCH] updates to filter cnvkit abberation type

---
 variants/filter_cnvkit.pl | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/variants/filter_cnvkit.pl b/variants/filter_cnvkit.pl
index 4829d4a..d5220ba 100755
--- a/variants/filter_cnvkit.pl
+++ b/variants/filter_cnvkit.pl
@@ -104,16 +104,22 @@ while (my $line = <IN>) {
     
     next if ($hash{cn} == 2 && $hash{cn1} ne ''  && $hash{cn2} ne '' && $hash{cn1} > 0 && $hash{cn2} > 0) || scalar(keys %genes) < 1;
     next if ($hash{cn} == 2 && $hash{cn1} eq ''  && $hash{cn2} eq '');
-    my $abtype = 'amplification';
-    if ($hash{cn} != 2) {
-      $abtype = 'loss' if ($hash{cn} < 2);
-      if ($hash{cn} > 2 && $hash{cn} < 6) {
-	$abtype = 'gain' ;
-	if ($hash{cn1} ne '' && $hash{cn2} ne '' && ($hash{cn1} == 0 || $hash{cn2} == 0)) {
-	  $abtype.= ' LOH';
-	}
+    my $abtype = 'cnLOH';
+    if ($hash{cn} < 2) {
+      if ($hash{cn} <  1 ) {
+	$abtype = 'homozygous deletion';
+      }else {
+	$abtype = 'hemizygous deletion';
+      }
+    } elsif ($hash{cn} > 2) {
+      $abtype = 'gain' ;
+      if ($hash{cn} > 6) {
+	$abtype = 'amplification';
       }
-    }else {
+      if ($hash{cn1} ne '' && $hash{cn2} ne '' && ($hash{cn1} == 0 || $hash{cn2} == 0)) {
+	$abtype.= ' LOH';
+      }
+    } else {
       $abtype = 'cnLOH';
     }
     foreach $gene (keys %genes) {
-- 
GitLab