Skip to content

Instantly share code, notes, and snippets.

@mvdbeek
Created November 28, 2023 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvdbeek/70339ba2e88894f3cc3087acccdf6ce1 to your computer and use it in GitHub Desktop.
Save mvdbeek/70339ba2e88894f3cc3087acccdf6ce1 to your computer and use it in GitHub Desktop.
select from ucsc
<tool id="select_from_ucsc" name="select_from_ucsc" version="0.1.0" profile="23.1">
<command><![CDATA[
echo '$url_param_value_postprocessed' > '$param_value_postprocessed'
]]></command>
<inputs>
<param name="url_param_value_postprocessed" type="select" multiple="true">
<options from_url="https://api.genome.ucsc.edu/list/ucscGenomes">
<postprocess_expression type="ecma5.1"><![CDATA[
$( Object.entries(inputs.ucscGenomes).map(([key, item]) => [`${item.description} (${item.organism})`, key]) )
]]></postprocess_expression>
</options>
</param>
</inputs>
<outputs>
<data format="txt" label="url param value postprocessed" name="param_value_postprocessed"></data>
</outputs>
<tests>
<test>
<param name="url_param_value_postprocessed" value="Feb. 2007 (Broad/anoCar1) (Lizard),May 2010 (Broad AnoCar2.0/anoCar2) (Lizard),Oct. 2006 (AgamP3/anoGam3) (A. gambiae)" />
<output name="param_value_postprocessed">
<assert_contents>
<has_text text="anoCar1,anoCar2,anoGam3"></has_text>
</assert_contents>
</output>
</test>
</tests>
</tool>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment