featureCounter.py $input1 $input2 $output -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol} -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol}
.. class:: infomark
**What it does**
This tool finds the coverage of intervals in the first query on intervals in the second query. The coverage and count are appended as 4 new columns in the resulting dataset.
-----
**Example**
- If **First query** consists of the following windows::
chrX 1 10001 seg 0 -
chrX 10001 20001 seg 0 -
chrX 20001 30001 seg 0 -
chrX 30001 40001 seg 0 -
- and **Second query** consists of the following exons::
chrX 5000 6000 seg2 0 -
chrX 5500 7000 seg2 0 -
chrX 9000 22000 seg2 0 -
chrX 24000 34000 seg2 0 -
chrX 36000 38000 seg2 0 -
- the **Result** is the coverage of exons of the second query in each of the windows contained in first query::
chrX 1 10001 seg 0 - 3001 0.3001 2 1
chrX 10001 20001 seg 0 - 10000 1.0 1 0
chrX 20001 30001 seg 0 - 8000 0.8 0 2
chrX 30001 40001 seg 0 - 5999 0.5999 1 1
- To clarify, the following line of output ( added columns are indexed by a, b and c )::
a b c d
chrX 1 10001 seg 0 - 3001 0.3001 2 1
implies that 2 exons (c) fall fully in this window (chrX:1-10001), 1 exon (d) partially overlaps this window, and these 3 exons cover 30.01% (c) of the window size, spanning 3001 nucleotides (a).
* a: number of nucleotides in this window covered by the features in (c) and (d) - features overlapping with each other will be merged to calculate (a)
* b: fraction of window size covered by features in (c) and (d) - features overlapping with each other will be merged to calculate (b)
* c: number of features in the 2nd query that fall **completely** within this window
* d: number of features in the 2nd query that **partially** overlap this window