Mercurial > repos > muon-spectroscopy-computational-project > muspinsim
diff muspinsim.xml @ 0:64e6816a6727 draft
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
author | muon-spectroscopy-computational-project |
---|---|
date | Thu, 25 Aug 2022 16:16:19 +0000 |
parents | |
children | b30217097125 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/muspinsim.xml Thu Aug 25 16:16:19 2022 +0000 @@ -0,0 +1,151 @@ +<tool id="muspinsim" name="MuSpinSim Simulate" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.01"> + <description>perform spin dynamics calculations for muon science experiments</description> + <macros> + <!-- version of underlying tool (PEP 440) --> + <token name="@TOOL_VERSION@">1.1.0</token> + <!-- version of this tool wrapper (integer) --> + <token name="@WRAPPER_VERSION@">1</token> + <!-- citation should be updated with every underlying tool version --> + <!-- typical fields to update are version, month, year, and doi --> + <token name="@TOOL_CITATION@"> + @software{muspinsim, + author = {Sturniolo, Simone and Liborio, Leandro and Owen, Josh and Mudaraddi, Anish and {Muon Spectroscopy Computational Project}}, + license = {MIT}, + title = {{muspinsim}}, + url = {https://github.com/muon-spectroscopy-computational-project/muspinsim}, + version = {v1.1.0}, + month = {5}, + year = {2022}, + doi = {10.5281/zenodo.6563074} + } + </token> + </macros> + <creator> + <person givenName="Anish" familyName="Mudaraddi" identifier="https://orcid.org/0000-0002-2135-2705"/> + <person givenName="Eli" familyName="Chadwick" url="https://github.com/elichad" identifier="https://orcid.org/0000-0002-0035-6475"/> + <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/> + </creator> + <requirements> + <requirement type="package" version="@TOOL_VERSION@">muspinsim</requirement> + </requirements> + <command detect_errors="exit_code"><![CDATA[ + ## remove spaces in names + mu_sim_name=\$(sed 's/ //g' <<< "$mu_sim.name") && + ## create links + ln -s $mu_sim \$mu_sim_name && + ## grab 'name' field from input file, if it doesn't exist, set name as 'muspinsim' + mu_out=\$(grep -A1 '^name' \$mu_sim_name | grep -v 'name' | sed -e 's/^[ \t]*//') && + fitreport_out=\${mu_out:-"fitting_data"}_fitreport.txt && + mu_out=\${mu_out:-"muspinsim"} && + log_out=\$(echo \$mu_sim_name | cut -d '.' -f1).log && + ## if fitting data required, check if fitting data exists + ## create symlink and change filepath in input file to point to symlink + if grep '^fitting_data' $mu_sim; then + if [[ '$mu_exp_in.name' != 'None' ]]; then + mu_exp_in_name=\$(sed 's/ //g' <<< "$mu_exp_in.name") && + ln -s $mu_exp_in \$mu_exp_in_name && + sed -iE "/^fitting_data/{n;s/([^)]*)/(\"\$mu_exp_in_name\")/g}" \$mu_sim_name; + else + echo "fitting data required, but no experiment data given" && exit 64; + fi; + fi && + muspinsim \$mu_sim_name && + mkdir data && + mv \$mu_out*.dat data && + if test -f \$fitreport_out; then mv -f \$fitreport_out fit_report.txt; fi && + mv \$log_out log_out.log + ]]></command> + <inputs> + <param type="data" name="mu_sim" format="txt" label="Configuration file containing simulation parameters"/> + <param type="data" name="mu_exp_in" format="txt" optional="true" label="Experiment data to fit (.dat) (Optional)" help="Only required if the 'fitting_data' parameter is set in the configuration file above."/> + </inputs> + <outputs> + <collection name="muspinsim_results" type="list" label="Muspinsim output collection"> + <discover_datasets pattern="__name__" directory="data" format="txt"/> + </collection> + <data label="muspinsim log for $mu_sim.name" name="log_out" format="txt" from_work_dir="log_out.log"/> + <data label="fit report for $mu_sim.name" name="fit_report" format="txt" from_work_dir="fit_report.txt"> + <filter>mu_exp_in</filter> + </data> + </outputs> + <tests> + <!-- log files have a timestamp on each line, and .dat files vary by machine + so use compare="re_match" or "contains" with some generalised test files --> + <test> + <param name="mu_sim" value="hfine.in" ftype="txt"/> + <output_collection name="muspinsim_results" type="list"> + <element name="hfine.dat" file="hfine.dat" ftype="txt" lines_diff="4"/> + </output_collection> + <output name="log_out" file="hfine.log" ftype="txt" compare="re_match"/> + </test> + <test> + <param name="mu_sim" value="hfine_powder.in" ftype="txt"/> + <output_collection name="muspinsim_results" type="list"> + <element name="muspinsim.dat" file="generic_out.dat" ftype="txt" compare="re_match_multiline"> + <assert_contents> + <has_size value="5100" delta="100"/> + </assert_contents> + </element> + </output_collection> + <output name="log_out" file="hfine_powder.log" ftype="txt" compare="re_match"> + <assert_contents> + <has_size value="802"/> + </assert_contents> + </output> + </test> + <test> + <param name="mu_sim" value="fitting.in" ftype="txt"/> + <param name="mu_exp_in" value="fitting_input.dat" ftype="txt"/> + <output_collection name="muspinsim_results" type="list"> + <element name="fitting_data.dat" file="fitting_data.dat" ftype="txt" lines_diff="4"/> + </output_collection> + <output name="log_out" file="fitting.log" ftype="txt" compare="contains"> + <assert_contents> + <has_size value="17145"/> + </assert_contents> + </output> + <output name="fit_report" file="fitting_fitreport.txt" ftype="txt" lines_diff="4"/> + </test> + <test> + <param name="mu_sim" value="multi_out.in" ftype="txt"/> + <output_collection name="muspinsim_results" type="list"> + <element name="multi_out_0_0.dat" file="multi_out_0_0.dat" ftype="txt" compare="re_match_multiline"> + <assert_contents> + <has_size value="1164" delta="100"/> + </assert_contents> + </element> + <element name="multi_out_0_1.dat" file="multi_out_0_1.dat" ftype="txt" compare="re_match_multiline"> + <assert_contents> + <has_size value="1164" delta="100"/> + </assert_contents> + </element> + <element name="multi_out_1_0.dat" file="multi_out_1_0.dat" ftype="txt" compare="re_match_multiline"> + <assert_contents> + <has_size value="1164" delta="100"/> + </assert_contents> + </element> + <element name="multi_out_1_1.dat" file="multi_out_1_1.dat" ftype="txt" compare="re_match_multiline"> + <assert_contents> + <has_size value="1164" delta="100"/> + </assert_contents> + </element> + </output_collection> + <output name="log_out" file="multi_out.log" ftype="txt" compare="re_match"/> + </test> + </tests> + <help><![CDATA[ + MuSpinSim is a program designed to carry out spin dynamics calculations. + + Tool requires an input (.in) file which describes system and experiment details. + This is a text file containing keywords and values in indented blocks. + + Full documentation: https://muon-spectroscopy-computational-project.github.io/muspinsim/ + + Command-line usage: muspinsim muspinsim.in + ]]></help> + <citations> + <citation type="bibtex"> + @TOOL_CITATION@ + </citation> + </citations> +</tool>