Mercurial > repos > muon-spectroscopy-computational-project > muspinsim
view muspinsim.xml @ 4:8af5948994b0 draft default tip
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit 389608650050596b28bc0c055de9f98c513a6f65
author | muon-spectroscopy-computational-project |
---|---|
date | Thu, 18 Jul 2024 09:07:13 +0000 |
parents | e002cee8f707 |
children |
line wrap: on
line source
<tool id="muspinsim" name="MuSpinSim Simulate" version="@MUSPINSIM_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT"> <description>perform spin dynamics calculations for muon science experiments</description> <macros> <!-- version of this tool wrapper (integer) --> <token name="@WRAPPER_VERSION@">1</token> <import>muon_macros.xml</import> </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"/> <person givenName="Joel" familyName="Davies" url="https://github.com/joelvdavies" identifier="https://orcid.org/0000-0002-4153-6819"/> <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/> </creator> <requirements> <requirement type="package" version="@MUSPINSIM_VERSION@">muspinsim</requirement> </requirements> <command detect_errors="exit_code"><![CDATA[ ## remove spaces in names mu_sim_name=\$(sed 's/ //g' <<< '$mu_sim.name') && ## input file name without extension mu_in_name=\${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]*//') && fit_report_out=\${mu_in_name:-"fitting_data"}_fit_report.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 \$fit_report_out; then mv -f \$fit_report_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 on ${on_string}" name="log_out" format="txt" from_work_dir="log_out.log"/> <data label="fit report on ${on_string}" 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 expect_num_outputs="2"> <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" compare="re_match"/> </output_collection> <output name="log_out" file="hfine.log" ftype="txt" compare="re_match"/> </test> <test expect_num_outputs="2"> <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="803" delta="2"/> </assert_contents> </output> </test> <test expect_num_outputs="2"> <param name="mu_sim" value="celio.in" ftype="txt"/> <output_collection name="muspinsim_results" type="list"> <element name="celio.dat" file="generic_out.dat" ftype="txt" compare="re_match_multiline"/> </output_collection> <output name="log_out" file="celio.log" ftype="txt" compare="re_match"/> </test> <test expect_num_outputs="3"> <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_fit_report.txt" ftype="txt" lines_diff="2"/> </test> <test expect_num_outputs="2"> <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="doi">@MUSPINSIM_CITATION@</citation> </citations> </tool>