diff read2mut.py @ 50:b32c973fe8ab draft

planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author mheinzl
date Thu, 11 Mar 2021 11:04:05 +0000
parents aa45100f5b14
children 26e53b5b8bcb
line wrap: on
line diff
--- a/read2mut.py	Wed Mar 10 17:46:01 2021 +0000
+++ b/read2mut.py	Thu Mar 11 11:04:05 2021 +0000
@@ -1076,34 +1076,36 @@
                 tier_dict[key1]["tier 2.5"] = tier_dict[key1]["tier 4"]
                 tier_dict[key1]["tier 4"] = 0
                 lines = change_tier_after_print[key1]
-                l_i = 0
-                for li in lines:
-                    row = li[0]
-                    new_line = li[1]
-                    if l_i == 0:
-                        new_line[1] == "2.5"
-                        ws1.write_row(row, 0, new_line)
-                    else:
-                        ws1.write_row(row + 1, 0, new_line)
-
-                    ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
-                                               {'type': 'formula',
-                                                'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(row + 1, row + 1),
-                                                'format': format1,
-                                                'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
-                    ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
-                                               {'type': 'formula',
-                                                'criteria': '=OR($B${}="2.1", $B${}="2.2", $B${}="2.3", $B${}="2.4", $B${}="2.5")'.format(row + 1, row + 1, row + 1, row + 1, row + 1),
-                                                'format': format3,
-                                                'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
-                    ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
-                                               {'type': 'formula',
-                                                'criteria': '=$B${}>="3"'.format(row + 1),
-                                                'format': format2,
-                                                'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
-
-                    l_i += 1
-
+                
+                for sample in lines:
+                	l_i = 0
+                	for li in sample:
+                	    row = li[0]
+                	    new_line = li[1]
+                	    if l_i == 0:
+                	        new_line[1] == "2.5"
+                	        ws1.write_row(row, 0, new_line)
+                	    else:
+                	        ws1.write_row(row + 1, 0, new_line)
+	
+                	    ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
+                	                               {'type': 'formula',
+                	                                'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(row + 1, row + 1),
+                	                                'format': format1,
+                	                                'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
+                	    ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
+                	                               {'type': 'formula',
+                	                                'criteria': '=OR($B${}="2.1", $B${}="2.2", $B${}="2.3", $B${}="2.4", $B${}="2.5")'.format(row + 1, row + 1, row + 1, row + 1, row + 1),
+                	                                'format': format3,
+                	                                'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
+                	    ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
+                	                               {'type': 'formula',
+                	                                'criteria': '=$B${}>="3"'.format(row + 1),
+                	                                'format': format2,
+                	                                'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
+	
+                	    l_i += 1
+	
     # sheet 2
     if chimera_correction:
         header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'chimeras in AC alt (all tiers)', 'chimera-corrected cvrg', 'chimera-corrected AF (all tiers)', 'cvrg (tiers 1.1-2.4)', 'AC alt (tiers 1.1-2.4)', 'AF (tiers 1.1-2.4)', 'chimeras in AC alt (tiers 1.1-2.4)', 'chimera-corrected cvrg (tiers 1.1-2.4)', 'chimera-corrected AF (tiers 1.1-2.4)', 'AC alt (orginal DCS)', 'AF (original DCS)',