Author Topic: Tips for working with --element-of  (Read 4642 times)

AlexReynolds

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Tips for working with --element-of
« on: February 27, 2012, 01:45:12 PM »
When the overlap option to --element-of is specified as a percentage value, the measurement of overlap is applied to elements in the first (reference) file. The second and any subsequent input files are essentially merged with the equivalent of a -m (or --merge) operation specifically:

bedops -m BEDFileB BEDFileC BEDFileD | bedops -e -3 BEDFileA -

is equivalent to:

bedops -e -3 BEDFileA BEDFileB BEDFileC BEDFileD

This automatic merging of elements in BEDFileB, BEDFileC and BEDFileD can have real consequences. Consider the following hypothetical arrangement of overlapping elements:

BEDFileA:    <---------------->
BEDFileB:    <---->
BEDFileC:       <---->     <-->
BEDFileD:    <--->


Running bedops -e -50% BEDFileA BEDFileB BEDFileC BEDFileD would include the element from BEDFileA. If we did not merge elements in BEDFileB, BEDFileC, and BEDFileD, or if we required a single element from any file to overlap BEDFileA with the same criterion, then the output would not include the element from BEDFileA.

Another way to think about this distinction is to show what happens when using bedmap with only two input files.

For example, the following command issues a 0 as output, because bedmap does not merge the contents of the second file given to it, and so no overlapping element is found in BEDFileA:

bedops -u BEDFileB BEDFileC BEDFileD | bedmap --fraction-ref 0.5 --count BEDFileA -
« Last Edit: November 15, 2012, 10:05:02 AM by sjn »