PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/tools/new_operations/intersect.xml

https://bitbucket.org/cistrome/cistrome-harvard/
XML | 143 lines | 121 code | 20 blank | 2 comment | 0 complexity | 440a0a5b07bbb48cadd56c80f8d02ab7 MD5 | raw file
  1<tool id="gops_intersect_1" name="Intersect">
  2  <description>the intervals of two datasets</description>
  3  <command interpreter="python">gops_intersect.py 
  4      $input1 $input2 $output
  5
  6      #if isinstance( $input1.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
  7        -1 1,4,5,7 --gff1
  8      #else:
  9        -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol}
 10      #end if
 11
 12      #if isinstance( $input2.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
 13        -2 1,4,5,7 --gff2
 14      #else:
 15          -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol} 
 16      #end if
 17
 18      -m $min $returntype
 19  </command>
 20  <inputs>
 21      <param name="returntype" type="select" label="Return" help="(see figure below)">
 22          <option value="">Overlapping Intervals</option>
 23          <option value="-p">Overlapping pieces of Intervals</option>
 24      </param>
 25      <param format="interval,gff" name="input1" type="data" help="First dataset">
 26          <label>of</label>
 27      </param>
 28      <param format="interval,gff" name="input2" type="data" help="Second dataset">
 29          <label>that intersect</label>
 30      </param>
 31      <param name="min" size="4" type="integer" value="1" min="1" help="(bp)">
 32          <label>for at least</label>
 33      </param>
 34  </inputs>
 35  <outputs>
 36      <data format="input" name="output" metadata_source="input1"/>
 37  </outputs>
 38  <code file="operation_filter.py"/>
 39  <trackster_conf/>
 40  <tests>
 41    <test>
 42      <param name="input1" value="1.bed" />
 43      <param name="input2" value="2.bed" />
 44      <param name="min" value="1" />
 45      <param name="returntype" value="" />
 46      <output name="output" file="gops_intersect_out.bed" />
 47    </test>
 48    <test>
 49      <param name="input1" value="1.bed" />
 50      <param name="input2" value="2_mod.bed" ftype="interval"/>
 51      <param name="min" value="1" />
 52      <param name="returntype" value="" />
 53      <output name="output" file="gops_intersect_diffCols.bed" />
 54    </test>
 55    <test>
 56      <param name="input1" value="1.bed" />
 57      <param name="input2" value="2_mod.bed" ftype="interval"/>
 58      <param name="min" value="1" />
 59      <param name="returntype" value="Overlapping pieces of Intervals" />
 60      <output name="output" file="gops_intersect_p_diffCols.bed" />
 61    </test>
 62    <test>
 63      <param name="input1" value="1.bed" />
 64      <param name="input2" value="2.bed" />
 65      <param name="min" value="10" />
 66      <param name="returntype" value="Overlapping pieces of Intervals" />
 67      <output name="output" file="gops_intersect_p_out.bed" />     
 68    </test>
 69    <test>
 70      <param name="input1" value="gops_bigint.interval" ftype="interval" />
 71      <param name="input2" value="gops_bigint2.interval" ftype="interval" />
 72      <param name="min" value="1" />
 73      <param name="returntype" value="" />
 74      <output name="output" file="gops_intersect_bigint_out.interval" />     
 75    </test>
 76    <test>
 77      <param name="input1" value="gops_bigint2.interval" ftype="interval" />
 78      <param name="input2" value="gops_bigint.interval" ftype="interval" />
 79      <param name="min" value="1" />
 80      <param name="returntype" value="" />
 81      <output name="output" file="gops_intersect_bigint_out.interval" />     
 82    </test>
 83    <test>
 84      <param name="input1" value="12.bed" ftype="bed" />
 85      <param name="input2" value="1.bed" ftype="bed" />
 86      <param name="min" value="1" />
 87      <param name="returntype" value="" />
 88      <output name="output" file="gops_intersect_no_strand_out.bed" />     
 89    </test>
 90    <!-- Intersect two GFF files. -->
 91    <test>
 92        <param name="input1" value="gops_subtract_in1.gff" />
 93        <param name="input2" value="gops_subtract_in2.gff" />
 94        <param name="min" value="1" />
 95        <param name="returntype" value="" />
 96        <output name="output" file="gops_intersect_out2.gff" />        
 97    </test>
 98    <!-- Intersect GFF file and bed file. -->
 99    <test>
100        <param name="input1" value="gops_subtract_in1.gff" />
101        <param name="input2" value="gops_subtract_in2.bed" />
102        <param name="min" value="1" />
103        <param name="returntype" value="" />
104        <output name="output" file="gops_intersect_out2.gff" />        
105    </test>
106    
107  </tests>
108  <help>
109
110.. class:: infomark
111
112**TIP:** If your dataset does not appear in the pulldown menu, it means that it is not in interval format. Use "edit attributes" to set chromosome, start, end, and strand columns.
113
114-----
115
116**Screencasts!**
117
118See Galaxy Interval Operation Screencasts_ (right click to open this link in another window).
119
120.. _Screencasts: http://wiki.g2.bx.psu.edu/Learn/Interval%20Operations
121
122-----
123
124**Syntax**
125
126- **Where overlap is at least** sets the minimum length (in base pairs) of overlap between elements of the two datasets
127- **Overlapping Intervals** returns entire intervals from the first dataset  that overlap the second dataset.  The returned intervals are completely unchanged, and this option only filters out intervals that do not overlap with the second dataset.
128- **Overlapping pieces of Intervals** returns intervals that indicate the exact base pair overlap between the first dataset and the second dataset.  The intervals returned are from the first dataset, and all fields besides start and end are guaranteed to remain unchanged.
129
130-----
131
132**Examples**
133
134Overlapping Intervals:
135
136.. image:: ${static_path}/operation_icons/gops_intersectOverlappingIntervals.gif
137
138Overlapping Pieces of Intervals:
139
140.. image:: ${static_path}/operation_icons/gops_intersectOverlappingPieces.gif
141
142</help>
143</tool>