# HG changeset patch # User iuc # Date 1742982129 0 # Node ID 3b5ef3b00cdd556318db76304f967ab4cf7069e0 # Parent d86cb2ce311b068304714b6d688735eb734e994e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit 76bfefa9116713dc1078ae407ab6dd69ed14a244 diff -r d86cb2ce311b -r 3b5ef3b00cdd inspect.xml --- a/inspect.xml Fri Oct 18 10:39:04 2024 +0000 +++ b/inspect.xml Wed Mar 26 09:42:09 2025 +0000 @@ -1,4 +1,4 @@ - + macros.xml @@ -57,12 +57,36 @@ @CMD_READ_INPUTS@ #if str($method.method) == 'pp.calculate_qc_metrics': +#if str($method.qc_vars) != '': + #set $qc_vars = [str(x.strip()) for x in str($method.qc_vars).split(',')] + +# function to convert 'True' and 'False' strings to boolean values + +def fix_var_keys(adata, var_keys): + for key in var_keys: + if key not in adata.var.columns: + raise ValueError(f"Column '{key}' not found in adata.var") + + if adata.var[key].dtype == bool: + continue # Skip conversion if already boolean + + unique_values = set(adata.var[key].astype(str).str.upper()) + if not unique_values.issubset({'TRUE', 'FALSE'}): + raise ValueError(f"Column '{key}' contains values other than 'True' or 'False'. qc_vars must contain only boolean (True/False) columns.") + + adata.var[key] = adata.var[key].astype(str).str.upper().map({'TRUE': True, 'FALSE': False}).astype(bool) + print(f"'{key}' has been converted to a boolean.") + + return adata + +adata = fix_var_keys(adata, $qc_vars) +#end if + sc.pp.calculate_qc_metrics( adata=adata, expr_type='$method.expr_type', var_type='$method.var_type', #if str($method.qc_vars) != '': - #set $qc_vars = [str(x.strip()) for x in str($method.qc_vars).split(',')] qc_vars=$qc_vars, #end if #if str($method.percent_top) != '': @@ -858,8 +882,8 @@ - + @@ -908,8 +932,8 @@ - + @@ -1130,8 +1154,8 @@ - + @@ -1217,6 +1241,33 @@ + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + +