diff hd.py @ 30:46bfbec0f9e6 draft

planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/hd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
author mheinzl
date Wed, 07 Aug 2019 04:01:32 -0400
parents 6b15b3b6405c
children 8beced3064e3
line wrap: on
line diff
--- a/hd.py	Wed Jul 24 05:58:15 2019 -0400
+++ b/hd.py	Wed Aug 07 04:01:32 2019 -0400
@@ -1080,7 +1080,7 @@
         minHD_tags_zeros2 = numpy.concatenate([item[7] for item in diff_list_b])
 
         chimera_tags1 = sum([item[10] for item in diff_list_a], [])
-        chimera_tags2 = numpy.concatenate([item[10] for item in diff_list_b])
+        chimera_tags2 = sum([item[10] for item in diff_list_b], [])
 
         rel_Diff = []
         diff_zeros = []
@@ -1090,8 +1090,11 @@
         for d1, d2, rel1, rel2, zeros1, zeros2, tag1, tag2, ctag1, ctag2 in \
                 zip(diff1, diff2, rel_Diff1, rel_Diff2, diff_zeros1, diff_zeros2, minHD_tags_zeros1, minHD_tags_zeros2,
                     chimera_tags1, chimera_tags2):
-            rel_Diff.append(max(rel1, rel2))
-            diff.append(max(d1, d2))
+            relatives = numpy.array([rel1, rel2])
+            absolutes = numpy.array([d1, d2])
+            max_idx = numpy.argmax(relatives)
+            rel_Diff.append(relatives[max_idx])
+            diff.append(absolutes[max_idx])
 
             if all(i is not None for i in [zeros1, zeros2]):
                 diff_zeros.append(max(zeros1, zeros2))