diff scripts/table_compute.py @ 2:02c3e335a695 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/table_compute commit d00a518202228b990aeeea2ec3f842501fd2ec09"
author iuc
date Fri, 13 Sep 2019 14:54:41 -0400
parents dddadbbac949
children 93a3ce78ce55
line wrap: on
line diff
--- a/scripts/table_compute.py	Fri Aug 30 05:28:18 2019 -0400
+++ b/scripts/table_compute.py	Fri Sep 13 14:54:41 2019 -0400
@@ -4,7 +4,7 @@
 """
 
 
-__version__ = "0.9.1"
+__version__ = "0.9.2"
 
 import csv
 import math
@@ -265,7 +265,12 @@
         mode = params["element_mode"]
         if mode == "replace":
             replacement_val = params["element_replace"]
-            out_table = data.mask(bool_mat, replacement_val)
+            out_table = data.mask(
+                bool_mat,
+                data.where(bool_mat).applymap(
+                    lambda x: replacement_val.format(elem=x)
+                )
+            )
         elif mode == "modify":
             mod_op = Utils.getOneValueMathOp(params["element_modify_op"])
             out_table = data.mask(
@@ -300,7 +305,9 @@
     elif user_mode_single == "fulltable":
         general_mode = params["mode"]
 
-        if general_mode == "melt":
+        if general_mode == "transpose":
+            out_table = data.T
+        elif general_mode == "melt":
             melt_ids = params["MELT"]["melt_ids"]
             melt_values = params["MELT"]["melt_values"]