Mercurial > repos > devteam > subtract_query
comparison subtract_query.xml @ 0:8a3448727cec draft
Imported from capsule None
| author | devteam |
|---|---|
| date | Tue, 01 Apr 2014 09:12:49 -0400 |
| parents | |
| children | f58ba0382c26 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:8a3448727cec |
|---|---|
| 1 <tool id="subtract_query1" name="Subtract Whole Dataset" version="0.1"> | |
| 2 <description>from another dataset</description> | |
| 3 <requirements> | |
| 4 <requirement type="package" version="0.7.1">bx-python</requirement> | |
| 5 <requirement type="package" version="1.0.0">galaxy-ops</requirement> | |
| 6 </requirements> | |
| 7 <command interpreter="python"> | |
| 8 subtract_query.py $input1 $input2 $begin_col $end_col $output | |
| 9 #if str($ignore_empty_end_cols) == 'true': | |
| 10 --ignore-empty-end-cols | |
| 11 #end if | |
| 12 | |
| 13 </command> | |
| 14 <inputs> | |
| 15 <param format="txt" name="input2" type="data" label="Subtract" help="Second dataset" /> | |
| 16 <param format="txt" name="input1" type="data" label="from" help="First dataset" /> | |
| 17 <param name="begin_col" type="data_column" data_ref="input1" force_select="False" label="Restrict subtraction between 'begin column'" /> | |
| 18 <param name="end_col" type="data_column" data_ref="input1" force_select="False" label="and 'end column'" help="Specifying columns for restricting subtraction is available only for tabular formatted datasets" /> | |
| 19 <param name="ignore_empty_end_cols" type="boolean" label="Ignore empty columns and whitespace at end of line when subtracting"/> | |
| 20 </inputs> | |
| 21 <outputs> | |
| 22 <data format="input" name="output" metadata_source="input1" /> | |
| 23 </outputs> | |
| 24 <tests> | |
| 25 <!-- Subtract 2 non-tabular files with no column restrictions. --> | |
| 26 <!-- Cannot figure out why this test won't pass, it works in real time... --> | |
| 27 <!-- | |
| 28 <test> | |
| 29 <param name="input1" value="1.txt" /> | |
| 30 <param name="input2" value="2.txt" /> | |
| 31 <param name="begin_col" value="None" /> | |
| 32 <param name="end_col" value="None" /> | |
| 33 <output name="output" file="subtract-query-1.dat" /> | |
| 34 </test> | |
| 35 --> | |
| 36 <!-- Subtract 2 tabular files with no column restrictions. --> | |
| 37 <test> | |
| 38 <param name="input1" value="eq-showbeginning.dat" /> | |
| 39 <param name="input2" value="eq-showtail.dat" /> | |
| 40 <param name="begin_col" value="None" /> | |
| 41 <param name="end_col" value="None" /> | |
| 42 <output name="output" file="subtract-query-2.dat" /> | |
| 43 </test> | |
| 44 <!-- Subtract 2 tabular files with column restrictions. --> | |
| 45 <test> | |
| 46 <param name="input1" value="eq-showbeginning.dat" /> | |
| 47 <param name="input2" value="eq-removebeginning.dat" /> | |
| 48 <param name="begin_col" value="c1" /> | |
| 49 <param name="end_col" value="c3" /> | |
| 50 <output name="output" file="subtract-query-3.dat" /> | |
| 51 </test> | |
| 52 <!-- Subtract a non-tabular file from a tabular file with no column restrictions. --> | |
| 53 <test> | |
| 54 <param name="input1" value="eq-showbeginning.dat" /> | |
| 55 <param name="input2" value="2.txt" /> | |
| 56 <param name="begin_col" value="None" /> | |
| 57 <param name="end_col" value="None" /> | |
| 58 <output name="output" file="subtract-query-4.dat" /> | |
| 59 </test> | |
| 60 <!-- Subtract 2 tabular files with no column restrictions, ignoring empty end columns. --> | |
| 61 <test> | |
| 62 <param name="input1" value="eq-showbeginning_e.dat" /> | |
| 63 <param name="input2" value="eq-showtail.dat" /> | |
| 64 <param name="begin_col" value="None" /> | |
| 65 <param name="end_col" value="None" /> | |
| 66 <param name="ignore_empty_end_cols" value="true" /> | |
| 67 <output name="output" file="subtract-query-2.dat" /> | |
| 68 </test> | |
| 69 </tests> | |
| 70 <help> | |
| 71 | |
| 72 .. class:: infomark | |
| 73 | |
| 74 **TIP:** This tool complements the tool in the **Operate on Genomic Intervals** tool set which subtracts the intervals of two datasets. | |
| 75 | |
| 76 | |
| 77 ----- | |
| 78 | |
| 79 **Syntax** | |
| 80 | |
| 81 This tool subtracts an entire dataset from another dataset. | |
| 82 | |
| 83 - Any text format is valid. | |
| 84 - If both dataset formats are tabular, you may restrict the subtraction to specific columns **contained in both datasets** and the resulting dataset will include only the columns specified. | |
| 85 - The begin column must be less than or equal to the end column. If it is not, begin column is switched with end column. | |
| 86 - If begin column is specified but end column is not, end column will default to begin_column (and vice versa). | |
| 87 - All blank and comment lines are skipped and not included in the resulting dataset (comment lines are lines beginning with a # character). | |
| 88 - Duplicate lines are eliminated from both dataset prior to subtraction. If any duplicate lines were eliminated from the first dataset, the number is displayed in the resulting history item. | |
| 89 | |
| 90 ----- | |
| 91 | |
| 92 **Example** | |
| 93 | |
| 94 If this is the **First dataset**:: | |
| 95 | |
| 96 chr1 4225 19670 | |
| 97 chr10 6 8 | |
| 98 chr1 24417 24420 | |
| 99 chr6_hla_hap2 0 150 | |
| 100 chr2 1 5 | |
| 101 chr10 2 10 | |
| 102 chr1 30 55 | |
| 103 chrY 1 20 | |
| 104 chr1 1225979 42287290 | |
| 105 chr10 7 8 | |
| 106 | |
| 107 and this is the **Second dataset**:: | |
| 108 | |
| 109 chr1 4225 19670 | |
| 110 chr10 6 8 | |
| 111 chr1 24417 24420 | |
| 112 chr6_hla_hap2 0 150 | |
| 113 chr2 1 5 | |
| 114 chr1 30 55 | |
| 115 chrY 1 20 | |
| 116 chr1 1225979 42287290 | |
| 117 | |
| 118 Subtracting the **Second dataset** from the **First dataset** (including all columns) will yield:: | |
| 119 | |
| 120 chr10 7 8 | |
| 121 chr10 2 10 | |
| 122 | |
| 123 Conversely, subtracting the **First dataset** from the **Second dataset** (including all columns) will result in an empty dataset. | |
| 124 | |
| 125 Subtracting the **Second dataset** from the **First dataset** (restricting to columns c1 and c2) will yield:: | |
| 126 | |
| 127 chr10 7 | |
| 128 chr10 2 | |
| 129 | |
| 130 </help> | |
| 131 </tool> |
