lib5c.writers.bedgraph module

Module for writing bedgraph files.

lib5c.writers.bedgraph.main()[source]
lib5c.writers.bedgraph.write_bedgraph(peaks, outfile, name='', desc='')[source]

Writes a set of peaks to a bedgraph file.

Parameters
  • peaks (dict of lists of dicts) –

    The peaks that should be written. The keys are chromosome names. The values are lists of features for that chromosome. The features are represented as dicts with at least the following keys:

    {
        'chrom': str
        'start': int,
        'end'  : int,
        'value': number
    }
    

  • outfile (str) – String reference to the file to write to.

  • name (str) – String to write in the name field of the header line.

  • desc (str) – String to write in the description field of the header line.