diff mirgene.py @ 30:d119424f67b6 draft

Uploaded
author glogobyte
date Wed, 20 Oct 2021 16:24:32 +0000
parents 537dcf5b0133
children 23a88a3ec37d
line wrap: on
line diff
--- a/mirgene.py	Wed Oct 20 16:24:19 2021 +0000
+++ b/mirgene.py	Wed Oct 20 16:24:32 2021 +0000
@@ -206,16 +206,19 @@
 
  # Filters low count mirnas (otpional)
  if int(args.per)!=-1:
-
-    fil_con_group=manager.list()
-    fil_tre_group=manager.list()
+    if int(args.per)>0 and float(args.per)<=100 and int(args.count)>0:
+       fil_con_group=manager.list()
+       fil_tre_group=manager.list()
 
-    ps_low_counts = Process(target=filter_low_counts,args=(control_group,treated_group,fil_con_group,fil_tre_group,args.per,args.count))
-    ps_low_counts.start()
-    ps_low_counts.join()
+       ps_low_counts = Process(target=filter_low_counts,args=(control_group,treated_group,fil_con_group,fil_tre_group,args.per,args.count))
+       ps_low_counts.start()
+       ps_low_counts.join()
 
-    fil_con_group=list(fil_con_group)
-    fil_tre_group=list(fil_tre_group)
+       fil_con_group=list(fil_con_group)
+       fil_tre_group=list(fil_tre_group)
+    
+    else:
+       sys.exit("Not acceptable values for filter")
 
  if "fil_con_group" not in locals() or "fil_con_group" not in globals():
     fil_con_group=control_group
@@ -379,16 +382,19 @@
 
   # Filters low count mirnas (otpional)
   if int(args.per)!=-1:
+     if int(args.per)>0 and float(args.per)<=100 and int(args.count)>0:
 
-     n_fil_con_group=manager.list()
-     n_fil_tre_group=manager.list()
+        n_fil_con_group=manager.list()
+        n_fil_tre_group=manager.list()
 
-     ps_low_counts = Process(target=filter_low_counts,args=(n_control_group,n_treated_group,n_fil_con_group,n_fil_tre_group,args.per,args.count))
-     ps_low_counts.start()
-     ps_low_counts.join()
+        ps_low_counts = Process(target=filter_low_counts,args=(n_control_group,n_treated_group,n_fil_con_group,n_fil_tre_group,args.per,args.count))
+        ps_low_counts.start()
+        ps_low_counts.join()
 
-     n_fil_con_group=list(n_fil_con_group)
-     n_fil_tre_group=list(n_fil_tre_group)
+        n_fil_con_group=list(n_fil_con_group)
+        n_fil_tre_group=list(n_fil_tre_group)
+     else:
+        sys.exit("Not acceptable values for filter")
 
   if "n_fil_con_group" not in locals() or "n_fil_con_group"not in globals():
       n_fil_con_group=n_control_group