changeset 29:0e7bd3f72c2c draft

Uploaded
author glogobyte
date Wed, 20 Oct 2021 16:24:19 +0000
parents 537dcf5b0133
children d119424f67b6
files mirbase.py
diffstat 1 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/mirbase.py	Wed Oct 20 14:40:26 2021 +0000
+++ b/mirbase.py	Wed Oct 20 16:24:19 2021 +0000
@@ -214,16 +214,20 @@
 
  # 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:
 
-    fil_con_group=manager.list()
-    fil_tre_group=manager.list()
+       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
@@ -387,17 +391,21 @@
 
   # 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
       n_fil_tre_group=n_treated_group