Skip to content

Commit 015f8f5

Browse files
committed
add tests
1 parent e0f5044 commit 015f8f5

File tree

3 files changed

+52
-27
lines changed

3 files changed

+52
-27
lines changed

tools/celltypist/celltypist.xml

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
<requirement type="package" version="@TOOL_VERSION@">celltypist</requirement>
1111
</requirements>
1212
<command><![CDATA[
13-
cp '$adata' 'anndata.h5ad' &&
1413
cat '$script_file' &&
15-
python '$script_file' &&
14+
python '$script_file'
1615
]]>
1716
</command>
1817
<configfiles>
@@ -21,12 +20,17 @@ import scanpy as sc
2120
import celltypist
2221
from celltypist import models
2322
24-
adata = sc.read_h5ad('anndata.h5ad') models.download_models(models='$model_name', cache_dir='./celltypist_models_cache')
25-
model = models.Model.load(models='$model_name', cache_dir='./celltypist_models_cache')
23+
adata = sc.read_h5ad('$adata')
24+
models.download_models(model='$model_name')
25+
model = models.Model.load(model='$model_name')
2626
predictions = celltypist.annotate(adata,
2727
model=model,
28-
majority_voting=$majority_voting,
28+
#if $majority_voting
29+
majority_voting=True,
30+
#end if
31+
#if $transpose_input
2932
transpose_input=$transpose_input,
33+
#end if
3034
mode='$mode',
3135
p_thres=$p_thres,
3236
min_prop=$min_prop)
@@ -52,24 +56,43 @@ adata.write_h5ad('$anndata_out', compression='gzip')
5256
<option value="best match">Choose the cell type with the largest score/probability as the final prediction</option>
5357
<option value="prob match">Enable a multi-label classification utilising a probability threshold</option>
5458
</param>
55-
<param name="p_thres" type="float" label="Probability threshold" value="0.5" />
56-
<param name="min_prop" type="float" label="Minimum proportion for cell type assignment" value="0.05" />
57-
<param name="reference" type="text" label="Reference column in AnnData.obs for dotplot" value="cell_type" />
58-
<param name="prediction" type="text" label="Prediction column in AnnData.obs for dotplot" value="predicted_labels" />
59+
<param name="p_thres" type="float" value="0.5" min="0" max="1" label="Probability threshold for the multi-label classification" help="Ignored if mode is best match." />
60+
<param name="min_prop" type="float" value="0" min="0" max="1" label="The minimum proportion of cells required to support naming of the subcluster by this cell type" help="Ignored if majority_voting is set to False"/>
5961
</inputs>
6062
<outputs>
6163
<data name="anndata_out" format="h5ad" label="${tool.name} on ${on_string}: AnnData with celltype annotations" />
6264
</outputs>
6365
<tests>
64-
<test>
66+
<test expect_num_outputs="1">
6567
<param name="adata" location="https://celltypist.cog.sanger.ac.uk/Notebook_demo_data/demo_500_cells.h5ad"/>
6668
<param name="model_name" value="Immune_All_Low.pkl" />
6769
<param name="majority_voting" value="True" />
68-
<param name="transpose_input" value="False" />
6970
<param name="mode" value="best match" />
7071
<param name="p_thres" value="0.5" />
7172
<param name="min_prop" value="0.05" />
72-
<output name="anndata_out" file="expected_celltypist_output.h5ad" />
73+
<output name="anndata_out" ftype="h5ad">
74+
<assert_contents>
75+
<has_h5_keys keys="obs/predicted_labels"/>
76+
<has_h5_keys keys="obs/over_clustering"/>
77+
<has_h5_keys keys="obs/majority_voting"/>
78+
<has_h5_keys keys="obs/conf_score"/>
79+
</assert_contents>
80+
</output>
81+
</test>
82+
<test expect_num_outputs="1">
83+
<param name="adata" location="https://celltypist.cog.sanger.ac.uk/Notebook_demo_data/demo_500_cells.h5ad"/>
84+
<param name="model_name" value="Immune_All_High.pkl" />
85+
<param name="majority_voting" value="False" />
86+
<param name="mode" value="prob match" />
87+
<param name="p_thres" value="0.5" />
88+
<param name="min_prop" value="0.05" />
89+
<output name="anndata_out" ftype="h5ad">
90+
<assert_contents>
91+
<has_h5_keys keys="obs/predicted_labels"/>
92+
<has_h5_keys keys="obs/conf_score"/>
93+
</assert_contents>
94+
</output>
95+
<output name="anndata_out" file="celltypist_annotated.h5ad" />
7396
</test>
7497
</tests>
7598
<help><![CDATA[

tools/deg_annotate/deg_annotate.xml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<xref type="bio.tools">deg_annotate</xref>
55
</xrefs>
66
<requirements>
7-
<requirement type="package" version="2.27.0">bedtools</requirement>
8-
<requirement type="package" version="0.6.4">bcbiogff</requirement>
7+
<requirement type="package" version="2.31.1">bedtools</requirement>
8+
<requirement type="package" version="0.6.6">bcbiogff</requirement>
99
</requirements>
1010
<command>
1111
<![CDATA[
@@ -21,21 +21,23 @@
2121
</command>
2222
<inputs>
2323
<param name="input_table"
24-
type="data"
25-
format="tabular"
26-
argument="-in"
27-
label="Tabular output of DESeq2/edgeR/limma/DEXSeq"/>
24+
type="data"
25+
format="tabular"
26+
argument="-in"
27+
label="Tabular output of DESeq2/edgeR/limma/DEXSeq"/>
2828

2929
<param name="mode" type="select" argument="-m" label="Input file type">
30-
<option value="degseq">DESeq2/edgeR/limma</option>
31-
<option value="dexseq">DEXseq</option>
30+
<option value="deseq2">DESeq2</option>
31+
<option value="edger">edgeR</option>
32+
<option value="limma">limma</option>
33+
<option value="dexseq">DEXseq</option>
3234
</param>
3335

3436
<param name="annotation"
35-
type="data"
36-
format="gff,gtf,gff3"
37-
argument="-g"
38-
label="Reference annotation in GFF/GTF format" />
37+
type="data"
38+
format="gff,gtf,gff3"
39+
argument="-g"
40+
label="Reference annotation in GFF/GTF format" />
3941

4042
<section name="advanced_parameters" title="Advanced options">
4143
<param name="gff_feature_type"
@@ -101,7 +103,7 @@
101103
<param name="annotation"
102104
value="annotation.gtf"/>
103105
<param name="mode"
104-
value="degseq"/>
106+
value="edger"/>
105107
<output name="output">
106108
<assert_contents>
107109
<has_text_matching expression="FBgn0039155\t-4.40480020002641\t5.8344799947229\t573.433304439283\t1.62187751744916e-36\t2.54342832286378e-32\tchr3R\t24141394\t24147490\t\+\tprotein_coding\tKal1"/>

tools/gprofiler/macros.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</requirements>
99
</xml>
1010

11-
<token name="@TOOL_VERSION@">0.1.7</token>
12-
<token name="@VERSION@">@TOOL_VERSION@+galaxy11</token>
11+
<token name="@TOOL_VERSION@">0.2.3</token>
12+
<token name="@VERSION@">@TOOL_VERSION@+galaxy0</token>
1313

1414
<xml name="version_command">
1515
<version_command>

0 commit comments

Comments
 (0)