note: the array must be compatible with enumerate() chrom should be specified too
precision specifies how many places past the decimal to retain (default 1)
To coerce into a string use something like
for line in array_to_bedgraph(a, chrom): '%s %d %d %.1f
‘ % line