comparison sceasy_convert.xml @ 0:ef1449a3f358 draft

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 06283e92907321289efca757b97c46c3bd94a2ea-dirty
author ebi-gxa
date Sun, 20 Oct 2019 08:47:47 -0400
parents
children f62bc418173f
comparison
equal deleted inserted replaced
-1:000000000000 0:ef1449a3f358
1 <?xml version="1.0" encoding="utf-8"?>
2 <tool id="sceasy_convert" name="SCEasy convert" version="@TOOL_VERSION@+galaxy0">
3 <description>a data object between formats</description>
4 <macros>
5 <import>sceasy_macros.xml</import>
6 </macros>
7 <expand macro="requirements"/>
8 <command detect_errors="exit_code"><![CDATA[
9 #if str($conversion['direction']).startswith("loom")
10 ln -s ${conversion.input_object_file} input.loom &&
11 #else if str($conversion['direction']).startswith("anndata")
12 ln -s ${conversion.input_object_file} input.h5ad &&
13 #else
14 ln -s ${conversion.input_object_file} input.rds &&
15 #end if
16
17 Rscript -e 'library(sceasy)'
18 #if $conversion.direction == "loom2sce"
19 -e 'sce <- sceasy::convertFormat("input.loom", from="loom", to="sce", main_layer_name="${assay_name}")'
20 -e 'saveRDS(sce, "output.rds")'
21 -e 'print(sce)'
22 #else if $conversion.direction == "sce2loom"
23 -e 'sce <- readRDS("input.rds")'
24 -e 'sceasy::convertFormat(sce, outFile="output.loom", from="sce", to="loom", main_layer="${assay}")'
25 #else if $conversion.direction == "sce2anndata"
26 -e 'sce <- readRDS("input.rds")'
27 -e 'sceasy::convertFormat(sce, outFile="output.h5ad", from="sce", to="anndata", main_layer="${assay}")'
28 -e 'print(sce)'
29 #else if $conversion.direction == "seurat2anndata"
30 -e 'srt <- readRDS("input.rds")'
31 -e 'sceasy::convertFormat(srt, outFile="output.h5ad", from="seurat", to="anndata", assay="${assay}", main_layer="${dtype}")'
32 -e 'print(srt)'
33 #end if
34 ]]></command>
35
36 <inputs>
37 <conditional name="conversion">
38 <param name="direction" type="select" label="Direction of conversion">
39 <option value="loom2sce" selected="true">Loom to SingleCellExperiment</option>
40 <option value="sce2loom">SingleCellExperiment to Loom</option>
41 <option value="seurat2anndata">Seurat to AnnData</option>
42 <option value="sce2anndata">SingleCellExperiment to AnnData</option>
43 </param>
44 <when value="loom2sce">
45 <param name="input_object_file" type="data" format="h5" label="Input object in Loom format"/>
46 <param name="assay_name" type="text" label="Name of the expression matrix to be transferred as">
47 <option value="counts" selected="true">counts</option>
48 <option value="logcounts">logcounts</option>
49 <option value="cpm">cpm</option>
50 </param>
51 </when>
52 <when value="sce2loom">
53 <param name="input_object_file" type="data" format="rdata" label="Input object in SingleCellExperiment RDS format"/>
54 <param name="assay" type="text" label="Name of the assay to be transferred as main layer" help="Please make sure the assay exists">
55 <option value="counts" selected="true">counts</option>
56 <option value="logcounts">logcounts</option>
57 <option value="cpm">cpm</option>
58 </param>
59 </when>
60 <when value="sce2anndata">
61 <param name="input_object_file" type="data" format="rdata" label="Input object in SingleCellExperiment RDS format"/>
62 <param name="assay" type="text" label="Name of the assay to be transferred as main layer" help="Please make sure the assay exists">
63 <option value="counts" selected="true">counts</option>
64 <option value="logcounts">logcounts</option>
65 <option value="cpm">cpm</option>
66 </param>
67 </when>
68 <when value="seurat2anndata">
69 <param name="input_object_file" type="data" format="rdata" label="Input object in Seurat RDS format"/>
70 <param name="assay" type="text" value="RNA" label="Name of the assay to be transferred" help="Please make sure the assay exists"/>
71 <param name="dtype" type="select" value="RNA" label="Data type of the assay to be transferred" help="Please make sure the data type exists">
72 <option value="data" selected="true">data</option>
73 <option value="counts">counts</option>
74 <option value="scale.data">scale.data</option>
75 </param>
76 </when>
77 </conditional>
78 </inputs>
79
80 <outputs>
81 <data name="output_sce" format="rdata" from_work_dir="output.rds" label="${tool.name} on ${on_string}: SingleCellExperiment">
82 <filter>conversion['direction'].endswith('sce')</filter>
83 </data>
84 <data name="output_loom" format="h5" from_work_dir="output.loom" label="${tool.name} on ${on_string}: Loom">
85 <filter>conversion['direction'].endswith('loom')</filter>
86 </data>
87 <data name="output_anndata" format="h5" from_work_dir="output.h5ad" label="${tool.name} on ${on_string}: AnnData">
88 <filter>conversion['direction'].endswith('anndata')</filter>
89 </data>
90 </outputs>
91
92 <tests>
93 <test>
94 <param name="direction" value="loom2sce"/>
95 <param name="input_object_file" value="input.loom"/>
96 <output name="output_sce" file="output.rds" ftype="rdata" compare="sim_size"/>
97 </test>
98 </tests>
99
100 <help><![CDATA[
101 ===================================================================
102 Convert scRNA data object between formats `sceasy::convertFormat()`
103 ===================================================================
104
105 Support the following conversion:
106 * Loom <-> SingleCellExperiment (full)
107 * SingleCellExperiment -> AnnData (matrix, metadata, reducedDim)
108 * Seurat -> AnnData (matrix, metadata, reducedDim)
109
110 @HELP@
111
112 @VERSION_HISTORY@
113 ]]></help>
114 <expand macro="citations"/>
115 </tool>