comparison scanpy-run-pca.xml @ 0:5063cd7f8c89 draft

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit 9bf9a6e46a330890be932f60d1d996dd166426c4
author ebi-gxa
date Wed, 03 Apr 2019 11:08:16 -0400
parents
children 7798c318e7d7
comparison
equal deleted inserted replaced
-1:000000000000 0:5063cd7f8c89
1 <?xml version="1.0" encoding="utf-8"?>
2 <tool id="scanpy_run_pca" name="Scanpy RunPCA" version="@TOOL_VERSION@+galaxy1">
3 <description>for dimensionality reduction</description>
4 <macros>
5 <import>scanpy_macros.xml</import>
6 </macros>
7 <expand macro="requirements"/>
8 <command detect_errors="exit_code"><![CDATA[
9 ln -s '${input_obj_file}' input.h5 &&
10 PYTHONIOENCODING=utf-8 scanpy-run-pca.py
11 -i input.h5
12 -f '${input_format}'
13 -o output.h5
14 -F '${output_format}'
15 -n '${n_pcs}'
16 #if $run_mode.chunked
17 -c
18 --chunk-size '${run_mode.chunk_size}'
19 #else
20 #if $run_mode.zero_center
21 -z
22 #else
23 -Z
24 #end if
25 #if $run_mode.svd_solver
26 --svd-solver '${run_mode.svd_solver}'
27 #end if
28 #if $run_mode.random_seed is not None
29 -s '${run_mode.random_seed}'
30 #end if
31 #end if
32 #if $extra_outputs:
33 #set extras = ' '.join(['--output-{}-file {}.csv'.format(x, x) for x in str($extra_outputs).split(',')])
34 ${extras}
35 #end if
36
37 @PLOT_OPTS@
38 ]]></command>
39
40 <inputs>
41 <expand macro="input_object_params"/>
42 <expand macro="output_object_params"/>
43 <param name="n_pcs" argument="--n-pcs" type="integer" value="50" label="Number of PCs to produce"/>
44 <conditional name="run_mode">
45 <param name="chunked" argument="--chunked" type="boolean" checked="false" label="Perform incremental PCA by chunks"/>
46 <when value="true">
47 <param name="chunk_size" argument="--chunk-size" type="integer" value="0" label="Chunk size"/>
48 </when>
49 <when value="false">
50 <param name="zero_center" argument="--zero-center" type="boolean" checked="true" label="Zero center data before scaling"/>
51 <param name="svd_solver" argument="--svd-solver" type="select" optional="true" label="SVD solver">
52 <option value="arpack">ARPACK</option>
53 <option value="randomised">Randomised</option>
54 </param>
55 <param name="random_seed" argument="--random-seed" type="integer" value="0" label="random_seed for numpy random number generator"/>
56 </when>
57 </conditional>
58
59 <param name="extra_outputs" type="select" multiple="true" optional="true" label="Type of output">
60 <option value="embeddings">PCA embeddings</option>
61 <option value="loadings">PCA loadings</option>
62 <option value="stdev">PCs stdev</option>
63 <option value="var-ratio">PCs proportion of variance</option>
64 </param>
65
66 <conditional name="do_plotting">
67 <param name="plot" type="boolean" checked="false" label="Make PCA plot"/>
68 <when value="true">
69 <expand macro="output_plot_params"/>
70 </when>
71 <when value="false"/>
72 </conditional>
73 </inputs>
74
75 <outputs>
76 <data name="output_h5" format="h5" from_work_dir="output.h5" label="${tool.name} on ${on_string}: PCA object"/>
77 <data name="output_png" format="png" from_work_dir="output.png" label="${tool.name} on ${on_string}: PCA plot">
78 <filter>do_plotting['plot']</filter>
79 </data>
80 <data name="output_embed" format="csv" from_work_dir="embeddings.csv" label="${tool.name} on ${on_string}: PCA embeddings">
81 <filter>extra_outputs and 'embeddings' in extra_outputs.split(',')</filter>
82 </data>
83 <data name="output_load" format="csv" from_work_dir="loadings.csv" label="${tool.name} on ${on_string}: PCA loadings">
84 <filter>extra_outputs and 'loadings' in extra_outputs.split(',')</filter>
85 </data>
86 <data name="output_stdev" format="csv" from_work_dir="stdev.csv" label="${tool.name} on ${on_string}: PCA stdev">
87 <filter>extra_outputs and 'stdev' in extra_outputs.split(',')</filter>
88 </data>
89 <data name="output_vprop" format="csv" from_work_dir="var-ratio.csv" label="${tool.name} on ${on_string}: PC explained proportion of variance">
90 <filter>extra_outputs and 'var-ratio' in extra_outputs.split(',')</filter>
91 </data>
92 </outputs>
93
94 <tests>
95 <test>
96 <param name="input_obj_file" value="scale_data.h5"/>
97 <param name="input_format" value="anndata"/>
98 <param name="output_format" value="anndata"/>
99 <param name="extra_outputs" value="embeddings"/>
100 <param name="n_pcs" value="50"/>
101 <param name="zero_center" value="true"/>
102 <param name="svd_solver" value="arpack"/>
103 <param name="random_seed" value="0"/>
104 <param name="chunked" value="false"/>
105 <param name="plot" value="true"/>
106 <param name="color_by" value="n_genes"/>
107 <output name="output_h5" file="run_pca.h5" ftype="h5" compare="sim_size"/>
108 <output name="output_png" file="run_pca.png" ftype="png" compare="sim_size"/>
109 <output name="output_embed" file="run_pca.embeddings.csv" ftype="csv" compare="sim_size">
110 <assert_contents>
111 <has_n_columns n="50" sep=","/>
112 </assert_contents>
113 </output>
114 </test>
115 </tests>
116
117 <help><![CDATA[
118 =======================================================================================================
119 Computes PCA (principal component analysis) coordinates, loadings and variance decomposition (`tl.pca`)
120 =======================================================================================================
121
122 It uses the implementation of *scikit-learn*.
123
124 @HELP@
125
126 @VERSION_HISTORY@
127 ]]></help>
128 <expand macro="citations"/>
129 </tool>