Mercurial > repos > iuc > ampvis2_subset_samples
comparison subset_samples.xml @ 0:1187994f81a2 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit 9ed0c3078be166bd22136771f517ae91a5198ecf
| author | iuc |
|---|---|
| date | Fri, 16 Aug 2024 08:53:18 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:1187994f81a2 |
|---|---|
| 1 <tool id="ampvis2_subset_samples" name="ampvis2 subset samples" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT"> | |
| 2 <description>by sample metadata</description> | |
| 3 <macros> | |
| 4 <import>macros.xml</import> | |
| 5 </macros> | |
| 6 <expand macro="header"/> | |
| 7 <command detect_errors="exit_code"><![CDATA[ | |
| 8 Rscript '$rscript' | |
| 9 ]]></command> | |
| 10 <configfiles> | |
| 11 <configfile name="rscript"><![CDATA[ | |
| 12 library(ampvis2, quietly = TRUE) | |
| 13 data <- readRDS("$data") | |
| 14 #set vals = 'c("' + '", "'.join(str($vals).split(",")) + '")' | |
| 15 data <- amp_subset_samples( | |
| 16 data, | |
| 17 $invert $var %in% $vals, | |
| 18 minreads = $minreads | |
| 19 @RAREFY_TOKEN@, | |
| 20 normalise = $normalise, | |
| 21 removeAbsents = $removeAbsents | |
| 22 ) | |
| 23 saveRDS(data, "$ampvis") | |
| 24 @SAVE_METADATA_LIST@ | |
| 25 ]]></configfile> | |
| 26 </configfiles> | |
| 27 <inputs> | |
| 28 <expand macro="rds_metadata_input_macro"/> | |
| 29 <expand macro="metadata_select" an="name" argument="var" optional="false" multiple="false" label="Metadata variable"/> | |
| 30 <param name="vals" type="select" optional="false" multiple="true" label="Metadata value(s)"> | |
| 31 <options from_dataset="metadata_list"> | |
| 32 <column name="name" index="1"/> | |
| 33 <column name="value" index="1"/> | |
| 34 <filter type="param_value" ref="var" column="0"/> | |
| 35 <filter type="unique_value" column="1"/> | |
| 36 </options> | |
| 37 </param> | |
| 38 <param name="invert" type="boolean" truevalue="!" falsevalue="" checked="false"/> | |
| 39 <param argument="minreads" type="integer" value="0" min="0" label="Minimum number of reads" help="Per sample. Samples below this value will be removed initially"/> | |
| 40 <expand macro="rarefy_macro" help="This is done initially, but after filtering based on the minreads value, if set."/> | |
| 41 <expand macro="normalise_macro"/> | |
| 42 <param argument="removeAbsents" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true"/> | |
| 43 </inputs> | |
| 44 <outputs> | |
| 45 <data name="ampvis" format="ampvis2"/> | |
| 46 <data name="metadata_list_out" format="tabular" label="${tool.name} on ${on_string}: metadata list"/> | |
| 47 </outputs> | |
| 48 <tests> | |
| 49 <!-- defaults --> | |
| 50 <test expect_num_outputs="2"> | |
| 51 <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> | |
| 52 <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> | |
| 53 <param name="var" value="Plant"/> | |
| 54 <param name="vals" value="Aalborg East"/> | |
| 55 <output name="ampvis" value="AalborgWWTPs-subset_samples.rds" ftype="ampvis2" compare="sim_size"/> | |
| 56 <output name="metadata_list_out" ftype="tabular"> | |
| 57 <assert_contents> | |
| 58 <has_line line="Plant	Aalborg East	FALSE	character"/> | |
| 59 <not_has_text text="Plant	Aalborg West	FALSE	character"/> | |
| 60 <has_n_lines n="85"/> | |
| 61 <has_n_columns n="4"/> | |
| 62 </assert_contents> | |
| 63 </output> | |
| 64 </test> | |
| 65 <!-- test NA values in metadata --> | |
| 66 <test expect_num_outputs="2"> | |
| 67 <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> | |
| 68 <param name="metadata_list" value="AalborgWWTPs-metadata_NA.list"/> | |
| 69 <param name="var" value="Plant"/> | |
| 70 <param name="vals" value="Aalborg East"/> | |
| 71 <output name="ampvis" value="AalborgWWTPs-subset_samples.rds" ftype="ampvis2" compare="sim_size"/> | |
| 72 <output name="metadata_list_out" ftype="tabular"> | |
| 73 <assert_contents> | |
| 74 <has_line line="Plant	Aalborg East	FALSE	character"/> | |
| 75 <not_has_text text="SampleID	NA	TRUE	character"/> | |
| 76 <has_n_lines n="85"/> | |
| 77 <has_n_columns n="4"/> | |
| 78 </assert_contents> | |
| 79 </output> | |
| 80 </test> | |
| 81 <!-- invert --> | |
| 82 <test expect_num_outputs="2"> | |
| 83 <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> | |
| 84 <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> | |
| 85 <param name="var" value="Plant"/> | |
| 86 <param name="vals" value="Aalborg East"/> | |
| 87 <param name="invert" value="true"/> | |
| 88 <output name="ampvis" value="AalborgWWTPs-subset_samples.rds" ftype="ampvis2" compare="sim_size"/> | |
| 89 <output name="metadata_list_out" ftype="tabular"> | |
| 90 <assert_contents> | |
| 91 <not_has_text text="Plant	Aalborg East	FALSE	character"/> | |
| 92 <has_line line="Plant	Aalborg West	FALSE	character"/> | |
| 93 <has_n_lines n="79"/> | |
| 94 <has_n_columns n="4"/> | |
| 95 </assert_contents> | |
| 96 </output> | |
| 97 </test> | |
| 98 </tests> | |
| 99 <help><![CDATA[ | |
| 100 What it does | |
| 101 ============ | |
| 102 | |
| 103 Subsets the data in ampvis2 objects based on metadata and returns the subsetted object. | |
| 104 | |
| 105 The Galaxy tool calls the `amp_subset_samples | |
| 106 <https://kasperskytte.github.io/ampvis2/reference/amp_filter_samples.html>`_ function | |
| 107 of the ampvis2 package. | |
| 108 | |
| 109 The subset is performed on the metadata by ``subset()`` and the abundance- and taxonomy | |
| 110 tables are then adjusted accordingly. | |
| 111 | |
| 112 @HELP_RELATIVE_ABUNDANCES@ | |
| 113 | |
| 114 Input | |
| 115 ===== | |
| 116 | |
| 117 @HELP_RDS_INPUT@ | |
| 118 | |
| 119 @HELP_METADATA_LIST_INPUT@ | |
| 120 | |
| 121 Output | |
| 122 ====== | |
| 123 | |
| 124 An ampvis2_rds dataset containing subsetted data and an updated metadata list dataset. | |
| 125 | |
| 126 ]]></help> | |
| 127 <expand macro="citations"/> | |
| 128 </tool> |
