Package dimer :: Package genome :: Module bedops
[hide private]
[frames] | no frames]

Module bedops

source code

wrapper to some of the bedops (http://code.google.com/p/bedops/) utilities

Functions [hide private]
 
bedmap(refdata, mapdata, ops=('--echo', '--echo-map'), parsePatt='([01])[|](.+)[|](.*)', onlyOverlapping=True)
run bedmap on the given files and return an iterator over the results
source code
 
overlap_as_array(anchor, feat_lst, bin=1, dtype=<type 'numpy.float64'>, parseFeature=partial(parseBED,use_score=True), respect_strand=True)
convert an anchor and a list of overlapping features on a signal array
source code
Variables [hide private]
  BEDMAP = 'bedmap'
  __package__ = 'dimer.genome'
Function Details [hide private]

bedmap(refdata, mapdata, ops=('--echo', '--echo-map'), parsePatt='([01])[|](.+)[|](.*)', onlyOverlapping=True)

source code 

run bedmap on the given files and return an iterator over the results

bedmap command is: bedmap opts refdata mapdata

Parameters:
  • refdata - reference intervals. output is with respect to these. I.e., unless there is filtering, output has one line for each refdata line
  • mapdata - qualifying (e.g, within a range of a refdata element) intervals on which to apply operations.
  • ops - operations (see bedmap help)
  • parsePatt - a regex object or pattern used to parse the output of bedmap. Make this grouped, to get a tuple of groups. Notice that first group of this should be "([01])"
Returns:
iterator over overapping features (str)

overlap_as_array(anchor, feat_lst, bin=1, dtype=<type 'numpy.float64'>, parseFeature=partial(parseBED,use_score=True), respect_strand=True)

source code 

convert an anchor and a list of overlapping features on a signal array

anchor: BED5 feat_list: [>=BED4, ...] bin: bin the signal dtype:type of array use_score: whether to use score from feature. will set to 1.0 if False respect_strand : whether to mirror the signal for anchors on the negative strand

returns a signal array of length anchor[2] - anchor[1]