Skip to content

Commit

Permalink
Updated compute_metrics.xml to pass tests [WIP]
Browse files Browse the repository at this point in the history
3/4 tests passed with remaining issue in test-data for rank_features
  • Loading branch information
ivelet committed Mar 31, 2023
1 parent d1c5c9c commit b092b13
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
planemo/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
48 changes: 24 additions & 24 deletions tools/episcanpy/cluster_embed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,30 +233,30 @@ adata.write('anndata.h5ad')
</section>
<output name="anndata_out" file="anndata.h5ad" ftype="h5ad"/>
</test>
<!-- <test>-->
<!-- &lt;!&ndash; test 3-tl.kmeans &ndash;&gt;-->
<!-- <param name="adata" value="metrics_in_chrX.h5ad" />-->
<!-- <conditional name="method">-->
<!-- <param name="method" value="tl.kmeans"/>-->
<!-- <param name="kmeans_num_clusters" value="14"/>-->
<!-- </conditional>-->
<!-- <section name="advanced_common">-->
<!-- <param name="show_log" value="true" />-->
<!-- </section>-->
<!-- <output name="anndata_out" file="anndata.h5ad" ftype="h5ad"/>-->
<!-- </test>-->
<!-- <test>-->
<!-- &lt;!&ndash; test 4-tl.hc &ndash;&gt;-->
<!-- <param name="adata" value="metrics_in_chrX.h5ad" />-->
<!-- <conditional name="method">-->
<!-- <param name="method" value="tl.kmeans"/>-->
<!-- <param name="hc_num_clusters" value="14"/>-->
<!-- </conditional>-->
<!-- <section name="advanced_common">-->
<!-- <param name="show_log" value="true" />-->
<!-- </section>-->
<!-- <output name="anndata_out" file="anndata.h5ad" ftype="h5ad"/>-->
<!-- </test>-->
<test>
<!-- test 3-tl.kmeans -->
<param name="adata" value="metrics_in_chrX.h5ad" />
<conditional name="method">
<param name="method" value="tl.kmeans"/>
<param name="kmeans_num_clusters" value="14"/>
</conditional>
<section name="advanced_common">
<param name="show_log" value="true" />
</section>
<output name="anndata_out" file="anndata.h5ad" ftype="h5ad"/>
</test>
<test>
<!-- test 4-tl.hc -->
<param name="adata" value="metrics_in_chrX.h5ad" />
<conditional name="method">
<param name="method" value="tl.kmeans"/>
<param name="hc_num_clusters" value="14"/>
</conditional>
<section name="advanced_common">
<param name="show_log" value="true" />
</section>
<output name="anndata_out" file="anndata.h5ad" ftype="h5ad"/>
</test>
</tests>
<help><![CDATA[
Expand Down
54 changes: 22 additions & 32 deletions tools/episcanpy/compute_metrics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</macros>
<expand macro="bio_tools"/>
<expand macro="requirements"/>
<expand macro="version_command"/>
<expand macro="version_commandwh"/>
<command detect_errors="exit_code"><![CDATA[
@CMD@
]]></command>
Expand Down Expand Up @@ -40,32 +40,23 @@ esc.tl.ARI(
esc.tl.rank_features(
adata,
groupby='$method.rank_features_groupby',
#if $method.rank_features_omic == 'None'
omic=None,
#else
omic='$method.rank_features_omic'
#end if
use_raw=$method.rank_features_use_raw,
groups='$method.rank_features_groups',
reference='$method.rank_features_reference',
n_features=$method.rank_features_n_features,
rankby_abs=$method.rank_features_rankby_abs,
key_added='$method.rank_features_key_added',
copy=False,
#if '$method.rank_features_method' == 'None'
method=None
#else
method='$method.rank_features_method',
#end if
corr_method='$method.rank_features_corr_method'
)
#end if
@CMD_anndata_write_outputs@
adata.write('anndata.h5ad')
]]></configfile>
</configfiles>
<inputs>
<param name="adata" type="data" format="h5ad" label="Annotated data matrix"/>
<expand macro="inputs_anndata"/>
<conditional name="method">
<param argument="method" type="select" label="Method used to compute score/metrics">
<option value="tl.ARI">ARI: Compute Adjusted Rand Index (ARI), using 'tl.ARI'</option>
Expand All @@ -75,19 +66,18 @@ esc.tl.rank_features(
</param>
<when value="tl.ARI">
<param name="ARI_label_1" value="louvain" type="text" label="Label 1" help="(label_1, Computes a similarity measure between label_1 and label_2)"/>
<param name="ARI_label_2" value="cell_type" type="text" label="Label 2" help="(label_2)"/>
<param name="ARI_label_2" value="celltype" type="text" label="Label 2" help="(label_2)"/>
</when>
<when value="tl.homogeneity">
<param name="homogeneity_label_1" value="louvain" type="text" label="Label 1" help="(label_1)"/>
<param name="homogeneity_label_2" value="cell_type" type="text" label="Label 2" help="(label_2)"/>
<param name="homogeneity_label_2" value="celltype" type="text" label="Label 2" help="(label_2)"/>
</when>
<when value="tl.AMI">
<param name="AMI_label_1" value="louvain" type="text" label="Label 1" help="(label_1)"/>
<param name="AMI_label_2" value="cell_type" type="text" label="Label 2" help="(label_2)"/>
<param name="AMI_label_2" value="celltype" type="text" label="Label 2" help="(label_2)"/>
</when>
<when value="tl.rank_features">
<param name="rank_features_groupby" value="louvain" type="text" label="The key of the observations grouping to consider" help="(groupby)"/>
<param name="rank_features_omic" value="ATAC" type="text" label="Omic being analyzed" help="(omic)"/>
<param name="rank_features_use_raw" type="select" label="Use raw attribute of Anndata if present" help="(use_raw)">
<option value="True" selected="true">True</option>
<option value="False">False</option>
Expand All @@ -113,24 +103,25 @@ esc.tl.rank_features(
</param>
</when>
</conditional>
<expand macro="inputs_common_advanced"/>
</inputs>
<outputs>
<expand macro="anndata_outputs"/>
</outputs>
<tests>
<!-- <test>-->
<!-- &lt;!&ndash; test 0- tl.ARI &ndash;&gt;-->
<!-- <param name="adata" value="metrics_in.h5ad" />-->
<!-- <conditional name="method">-->
<!-- <param name="method" value="tl.ARI"/>-->
<!-- <param name="ARI_label_1" value="louvain"/>-->
<!-- <param name="ARI_label_2" value="celltype"/>-->
<!-- </conditional>-->
<!-- <section name="advanced_common">-->
<!-- <param name="show_log" value="true" />-->
<!-- </section>-->
<!-- <output name="anndata_out" file="anndata.h5ad" ftype="h5ad"/>-->
<!-- </test>-->
<test>
<!-- test 0- tl.ARI -->
<param name="adata" value="metrics_in.h5ad" />
<conditional name="method">
<param name="method" value="tl.ARI"/>
<param name="ARI_label_1" value="louvain"/>
<param name="ARI_label_2" value="celltype"/>
</conditional>
<section name="advanced_common">
<param name="show_log" value="true" />
</section>
<output name="anndata_out" file="anndata.h5ad" ftype="h5ad"/>
</test>
<test>
<!-- test 1- tl.AMI -->
<param name="adata" value="metrics_in_chrX.h5ad" />
Expand Down Expand Up @@ -159,11 +150,10 @@ esc.tl.rank_features(
</test>
<test>
<!-- test 3- tl.rank_features -->
<param name="adata" value="metrics_in_chrX.h5ad" />
<param name="adata" value="metrics_in.h5ad" />
<conditional name="method">
<param name="method" value="tl.rank_features"/>
<param name="rank_features_groupby" value="louvain"/>
<param name="rank_features_omic" value="ATAC"/>
<param name="rank_features_use_raw" value="True"/>
<param name="rank_features_groups" value="all"/>
<param name="rank_features_reference" value="rest"/>
Expand Down Expand Up @@ -191,4 +181,4 @@ More details on the `episcanpy documentation
]]></help>
<expand macro="citations"/>
</tool>
</tool>

0 comments on commit b092b13

Please sign in to comment.