1 | <tool id="comp1" name="Compare two Queries" version="1.0.2"> |
---|
2 | <description>to find common or distinct rows</description> |
---|
3 | <command interpreter="python">joinWrapper.py $input1 $input2 $field1 $field2 $mode $out_file1</command> |
---|
4 | <inputs> |
---|
5 | <param format="tabular" name="input1" type="data" label="Compare"/> |
---|
6 | <param name="field1" label="Using column" type="data_column" data_ref="input1"> |
---|
7 | <validator type="no_options" message="Invalid column choice. Please try again after editing metadata of your input dataset by clicking on the pencil icon next to it."/> |
---|
8 | </param> |
---|
9 | <param format="tabular" name="input2" type="data" label="against" /> |
---|
10 | <param name="field2" label="and column" type="data_column" data_ref="input2"> |
---|
11 | <validator type="no_options" message="Invalid column choice. Please try again after editing metadata of your input dataset by clicking on the pencil icon next to it."/> |
---|
12 | </param> |
---|
13 | <param name="mode" type="select" label="To find" help="See examples below for explanation of these options"> |
---|
14 | <option value="N">Matching rows of 1st query</option> |
---|
15 | <option value="V">Non Matching rows of 1st query</option> |
---|
16 | </param> |
---|
17 | </inputs> |
---|
18 | <outputs> |
---|
19 | <data format="input" name="out_file1" metadata_source="input1" /> |
---|
20 | </outputs> |
---|
21 | <tests> |
---|
22 | <test> |
---|
23 | <param name="input1" value="1.bed"/> |
---|
24 | <param name="input2" value="2.bed"/> |
---|
25 | <param name="field1" value="2"/> |
---|
26 | <param name="field2" value="2"/> |
---|
27 | <param name="mode" value="N"/> |
---|
28 | <output name="out_file1" file="fs-compare.dat"/> |
---|
29 | </test> |
---|
30 | <!--test case with duplicated key values--> |
---|
31 | <test> |
---|
32 | <param name="input1" value="1.bed"/> |
---|
33 | <param name="input2" value="3.bed"/> |
---|
34 | <param name="field1" value="1"/> |
---|
35 | <param name="field2" value="1"/> |
---|
36 | <param name="mode" value="V"/> |
---|
37 | <output name="out_file1" file="fs-compare-2.dat"/> |
---|
38 | </test> |
---|
39 | </tests> |
---|
40 | <help> |
---|
41 | |
---|
42 | .. class:: infomark |
---|
43 | |
---|
44 | **TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* |
---|
45 | |
---|
46 | ----- |
---|
47 | |
---|
48 | **Syntax** |
---|
49 | |
---|
50 | This tool finds lines in one query that HAVE or DO NOT HAVE a common field with another query. |
---|
51 | |
---|
52 | ----- |
---|
53 | |
---|
54 | **Example** |
---|
55 | |
---|
56 | If this is **First query**:: |
---|
57 | |
---|
58 | chr1 10 20 geneA |
---|
59 | chr1 50 80 geneB |
---|
60 | chr5 10 40 geneL |
---|
61 | |
---|
62 | and this is **Second query**:: |
---|
63 | |
---|
64 | geneA tumor-suppressor |
---|
65 | geneB Foxp2 |
---|
66 | geneC Gnas1 |
---|
67 | geneE INK4a |
---|
68 | |
---|
69 | Finding lines of the **First query** whose 4th column matches the 1st column of the **Second query** yields:: |
---|
70 | |
---|
71 | chr1 10 20 geneA |
---|
72 | chr1 50 80 geneB |
---|
73 | |
---|
74 | Conversely, using option **Non Matching rows of First query** on the same fields will yield:: |
---|
75 | |
---|
76 | chr5 10 40 geneL |
---|
77 | |
---|
78 | </help> |
---|
79 | </tool> |
---|