# HG changeset patch # User ebi-gxa # Date 1629718368 0 # Node ID fe75d2414dc0b1b96b30d5d43fe9d55da1669d25 # Parent 93ecc487a7d13930991b334eff88fe514ed7f755 "planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit 8853a954bd9c343b3458479582f1f21c3981fef0-dirty" diff -r 93ecc487a7d1 -r fe75d2414dc0 anndata_operations.xml --- a/anndata_operations.xml Tue Aug 03 08:57:26 2021 +0000 +++ b/anndata_operations.xml Mon Aug 23 11:32:48 2021 +0000 @@ -1,5 +1,5 @@ - + modifies metadata and flags genes scanpy_macros2.xml @@ -66,6 +66,13 @@ #end if #end for +#for $i, $s in enumerate($var_modifications) +adata.var['${s.to_var}'] = adata.var['${s.from_var}'] +#if not $s.keep_original: +del adata.var['${s.from_var}'] +#end if +#end for + gene_names = getattr(adata.var, gene_name) #for $i, $flag in enumerate($gene_flags) @@ -92,7 +99,7 @@ ad_s = sc.read('x_source_${i}.h5') if adata.n_obs == ad_s.n_obs and all(adata.obs_names == ad_s.obs_names): #set xs=$copy_x.xlayers[$i] - if "${xs.dest}" == '': + if "${xs.dest}" == '': logging.error("%sth destination layer for %sth X source not specified" % ("${i}", "${i}")) sys.exit(1) adata.layers["${xs.dest}"] = ad_s.X @@ -112,8 +119,8 @@ for l_to_copy in layers_to_copy: suffix='' if l_to_copy in adata.layers: - suffix = "_${i}" - + suffix = "_${i}" + adata.layers[l_to_copy+suffix] = ad_s.layers[l_to_copy] #end for else: @@ -132,8 +139,8 @@ for k_to_copy in keys_to_copy: suffix='' if k_to_copy in adata.obs: - suffix = "_${i}" - + suffix = "_${i}" + adata.obs[[k_to_copy+suffix]] = ad_s.obs[[k_to_copy]] if k_to_copy in ad_s.uns.keys(): adata.uns[k_to_copy+suffix] = ad_s.uns[k_to_copy] @@ -220,6 +227,15 @@ + + + + + + + + + @@ -299,6 +315,16 @@ + + + + + + + + + + @@ -352,7 +378,7 @@ Performs the following operations: -* Change observation fields, mostly for downstreaming processes convenience. Multiple fields can be changed as one. +* Change observation/var fields, mostly for downstreaming processes convenience. Multiple fields can be changed as one. * Flag genes that start with a certain text: useful for flagging mitochondrial, spikes or other groups of genes. * For the flags created, calculates qc metrics (pct__counts). * Calculates `n_genes`, `n_counts` for cells and `n_cells`, `n_counts` for genes.