cuffmerge报错解决方案:run_log = open(logging_dir + "run.log", "w", 0), ValueError: can't have unbuffered text I/O

运行命令${src}/cuffmerge -o ./merge -g ${input}/gencode.v44.primary_assembly.annotation_sorted.gtf merge.list时报错:

run_log = open(logging_dir + "run.log", "w", 0)
ValueError: can't have unbuffered text I/O

解决方案:修改${src}/cuffmerge代码。

修改第一处:在${src}/cuffmerge的第53行插入以下代码

class Unbuffered(object):
   def __init__(self, stream):
       self.stream = stream
   def write(self, data):
       self.stream.write(data)
       self.stream.flush()
   def writelines(self, datas):
       self.stream.writelines(datas)
       self.stream.flush()
   def __getattr__(self, attr):
       return getattr(self.stream, attr)

效果如下所示:

修改第二处:

把在${src}/cuffmerge的第526行代码run_log = open(logging_dir + "run.log", "w", 0)改为run_log = Unbuffered(open(logging_dir + "run.log", "w"))

效果如下所示:

代码来源:https://github.com/cole-trapnell-lab/cufflinks/issues/130

posted @ 2023-07-21 14:55  橙子牛奶糖  阅读(136)  评论(0编辑  收藏  举报