|
| 1 | +<tool id="__FILTER_FROM_FILE__" |
| 2 | + name="Filter collection" |
| 3 | + version="1.1.0" |
| 4 | + tool_type="filter_from_file"> |
| 5 | + <description></description> |
| 6 | + <type class="FilterFromFileTool" module="galaxy.tools" /> |
| 7 | + <action module="galaxy.tools.actions.model_operations" |
| 8 | + class="ModelOperationToolAction"/> |
| 9 | + <edam_operations> |
| 10 | + <edam_operation>operation_3695</edam_operation> |
| 11 | + </edam_operations> |
| 12 | + <inputs> |
| 13 | + <param type="data_collection" name="input" label="Input Collection" help="A collection whose elements will be filtered."/> |
| 14 | + <conditional name="how"> |
| 15 | + <param type="select" name="how_filter" label="How should the elements to remove be determined?"> |
| 16 | + <option value="remove_if_absent" selected="true">Remove if identifiers are ABSENT from file</option> |
| 17 | + <option value="remove_if_present">Remove if identifiers are PRESENT in file</option> |
| 18 | + </param> |
| 19 | + <when value="remove_if_absent"> |
| 20 | + <param type="data" name="filter_source" format="txt" label="Filter out identifiers absent from" /> |
| 21 | + </when> |
| 22 | + <when value="remove_if_present"> |
| 23 | + <param type="data" name="filter_source" format="txt" label="Filter out identifiers present in" /> |
| 24 | + </when> |
| 25 | + </conditional> |
| 26 | + </inputs> |
| 27 | + <outputs> |
| 28 | + <collection name="output_filtered" format_source="input" type_source="input" label="${on_string} (filtered)" > |
| 29 | + </collection> |
| 30 | + <collection name="output_discarded" format_source="input" type_source="input" label="${on_string} (discarded)" > |
| 31 | + </collection> |
| 32 | + </outputs> |
| 33 | + <tests> |
| 34 | + <test> |
| 35 | + <param name="input"> |
| 36 | + <collection type="list"> |
| 37 | + <element name="i1" value="simple_line.txt" /> |
| 38 | + <element name="i2" value="simple_line_alternative.txt" /> |
| 39 | + </collection> |
| 40 | + </param> |
| 41 | + <param name="how_filter" value="remove_if_present" /> |
| 42 | + <param name="filter_source" value="filter_labels_1.txt" ftype="txt" /> |
| 43 | + <output_collection name="output_filtered" type="list"> |
| 44 | + <element name="i1"> |
| 45 | + <assert_contents> |
| 46 | + <has_text_matching expression="^This is a line of text.\n$" /> |
| 47 | + </assert_contents> |
| 48 | + </element> |
| 49 | + </output_collection> |
| 50 | + <output_collection name="output_discarded" type="list"> |
| 51 | + <element name="i2"> |
| 52 | + <assert_contents> |
| 53 | + <has_text_matching expression="^This is a different line of text.\n$" /> |
| 54 | + </assert_contents> |
| 55 | + </element> |
| 56 | + </output_collection> |
| 57 | + </test> |
| 58 | + <test> |
| 59 | + <param name="input"> |
| 60 | + <collection type="list"> |
| 61 | + <element name="i1" value="simple_line.txt" /> |
| 62 | + <element name="i2" value="simple_line_alternative.txt" /> |
| 63 | + </collection> |
| 64 | + </param> |
| 65 | + <param name="how_filter" value="remove_if_absent" /> |
| 66 | + <param name="filter_source" value="filter_labels_1.txt" ftype="txt" /> |
| 67 | + <output_collection name="output_filtered" type="list"> |
| 68 | + <element name="i2"> |
| 69 | + <assert_contents> |
| 70 | + <has_text_matching expression="^This is a different line of text.\n$" /> |
| 71 | + </assert_contents> |
| 72 | + </element> |
| 73 | + </output_collection> |
| 74 | + <output_collection name="output_discarded" type="list"> |
| 75 | + <element name="i1"> |
| 76 | + <assert_contents> |
| 77 | + <has_text_matching expression="^This is a line of text.\n$" /> |
| 78 | + </assert_contents> |
| 79 | + </element> |
| 80 | + </output_collection> |
| 81 | + </test> |
| 82 | + </tests> |
| 83 | + <help><![CDATA[ |
| 84 | +
|
| 85 | +======== |
| 86 | +Synopsis |
| 87 | +======== |
| 88 | +
|
| 89 | +Filters elements from a collection using a list supplied in a file. |
| 90 | +
|
| 91 | +=========== |
| 92 | +Description |
| 93 | +=========== |
| 94 | +
|
| 95 | +This tools allow filtering elements from a data collection. It takes an input collection and a text file with names (i.e. identifiers). The tool behavious is controlled by **How should the elements to remove be determined?** drop-down. It has the following options: |
| 96 | +
|
| 97 | +**Remove if identifiers are ABSENT from file** |
| 98 | +
|
| 99 | +Given a collection:: |
| 100 | +
|
| 101 | + Collection: [Dataset A] |
| 102 | + [Dataset B] |
| 103 | + [Dataset X] |
| 104 | +
|
| 105 | +and a text file:: |
| 106 | +
|
| 107 | + A |
| 108 | + B |
| 109 | + Z |
| 110 | +
|
| 111 | +the tool will return two collections:: |
| 112 | +
|
| 113 | + (filtered): [Dataset A] |
| 114 | + [Dataset B] |
| 115 | +
|
| 116 | + (discarded): [Dataset X] |
| 117 | +
|
| 118 | +------ |
| 119 | +
|
| 120 | +**Remove if identifiers are PRESENT in file** |
| 121 | +
|
| 122 | +Given a collection:: |
| 123 | +
|
| 124 | + Collection: [Dataset A] |
| 125 | + [Dataset B] |
| 126 | + [Dataset X] |
| 127 | +
|
| 128 | +and a text file:: |
| 129 | +
|
| 130 | + A |
| 131 | + B |
| 132 | + Z |
| 133 | +
|
| 134 | +the tool will return two collections:: |
| 135 | +
|
| 136 | + (filtered): [Dataset X] |
| 137 | +
|
| 138 | + (discarded): [Dataset A] |
| 139 | + [Dataset B] |
| 140 | +
|
| 141 | +.. class:: warningmark |
| 142 | +
|
| 143 | +**Note** how the tool deals with the ``Z`` entry. |
| 144 | +
|
| 145 | +.. class:: infomark |
| 146 | +
|
| 147 | +
|
| 148 | +This tool will create new history datasets from your collection but your quota usage will not increase. |
| 149 | + ]]></help> |
| 150 | +</tool> |
0 commit comments