<p>I have defined 44 linkage blocks as &quot;interesting&quot; through a GWAS - NGS cohort.</p>

<p>I have run certain tests on those, but I wish to understand how typical or atypical those results are by comparing the 44 loci to 44 similarly size loci that are &quot;matched&quot; according to various things.</p>

<p>1. Matched based on the number of genes and total gene content</p>

<p>2. Matched based on the number of regulatory elements (e.g. Conserved TFBS)</p>

<p>Is there a software that does this? If not, how to people do it?</p>

<p>Thank you.</p>

Assuming your datasets are in <a class="vt-p" href="http://bedops.readthedocs.org/en/latest/content/reference/file-management/sorting/sort-bed.html">sorted</a> BED format, you could use `bedmap` with the `--count` operand to calculate counts of mapped genes and regulatory elements over a reference set (<a class="vt-p" href="http://bedops.readthedocs.org/en/latest/content/reference/statistics/bedmap.html">docs</a>). Other statistical operations are available, <a class="vt-p" href="http://bedops.readthedocs.org/en/latest/content/reference/statistics/bedmap.html#score-operations">score</a> and <a class="vt-p" href="http://bedops.readthedocs.org/en/latest/content/reference/statistics/bedmap.html#non-score-operations">non-score</a>-based. You could use this to calculate statistics for treatment and control sets, observed and background sets, etc. Alternatively, if you don't already have a background set, you could, say, map over windows to find regions that have characteristics you want.