def stmt1(): a = np.array(np.random.random(100000), dtype=FLOAT_DTYPE) buf = cStringIO.StringIO() array_to_bedgraph(a, ref='chr1', start=0, fileh=buf)
def write_and_read_array(a, ref='chr1', start=0): buf = cStringIO.StringIO() array_to_bedgraph(a, ref, start, buf) contents = buf.getvalue() a = bedgraph_to_array(cStringIO.StringIO(contents)) return a.get(ref, None)