/tools/filters/lav_to_bed_code.py
https://bitbucket.org/cistrome/cistrome-harvard/ · Python · 19 lines · 18 code · 0 blank · 1 comment · 5 complexity · 1fee2235aaf699646284c1431982c364 MD5 · raw file
- #Set build, name, and info for each output BED file
- def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
- new_stdout = ""
- filename_to_build = {}
- for line in stdout.split("\n"):
- if line.startswith("#FILE"):
- fields = line.split("\t")
- filename_to_build[fields[1]]=fields[2].strip()
- else:
- new_stdout = "%s%s" % ( new_stdout, line )
- for name,data in out_data.items():
- try:
- data.info = "%s\n%s" % ( new_stdout, stderr )
- data.dbkey = filename_to_build[data.file_name]
- data.name = "%s (%s)" % ( data.name, data.dbkey )
- app.model.context.add( data )
- app.model.context.flush()
- except:
- continue