[dspchip] r237 committed - buffered communication for bigwig writing...

5 views
Skip to first unread message

dsp...@googlecode.com

unread,
Feb 11, 2011, 10:06:06 AM2/11/11
to dspchi...@googlegroups.com
Revision: 237
Author: daweonline
Date: Fri Feb 11 07:05:01 2011
Log: buffered communication for bigwig writing...

http://code.google.com/p/dspchip/source/detail?r=237

Modified:
/trunk/src/dclib/IO.py

=======================================
--- /trunk/src/dclib/IO.py Fri Feb 11 06:44:48 2011
+++ /trunk/src/dclib/IO.py Fri Feb 11 07:05:01 2011
@@ -732,7 +732,7 @@
fh.close()

# Read what has been written so far
- cmd1 = subprocess.Popen([bw2bdg, fname, "stdout"], shell=False,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ cmd1 = subprocess.Popen([bw2bdg, fname, "stdout"], shell=False,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=4096)
(previousData, error) = cmd1.communicate()
# don't care about errors, previousData has been initialized :-)

@@ -756,13 +756,15 @@
previousData = previousData + '\t'.join([chrom, start, end, value])
+ '\n'

# open the write process
- cmd2 = subprocess.Popen([bdg2bw, "-clip", "stdin", gTabName, tmpFile],
shell=False, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+ cmd2 = subprocess.Popen([bdg2bw, "-clip", "stdin", gTabName, tmpFile],
shell=False, stdin=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=4096)

(output, error) = cmd2.communicate(previousData)

if len(error):
# these should be essentially Warnings
Debug(1, "There was this error, skipping this...", error)
+ if "There's more than one value" in error:
+ Debug(1, "The last points were", previousData[-123:])
else:
# remove tab file
os.unlink(gTabName)

Reply all
Reply to author
Forward
0 new messages