Commit 11d97eb4 authored by aknecht2's avatar aknecht2
Browse files

Added correct wrapper to avoid calling module load from python script. Update...

Added correct wrapper to avoid calling module load from python script.  Update run_music.py script to correctly format final result data.
parent 40f4db77
......@@ -46,7 +46,7 @@ music_punctate:
- name: scale_2216.bed
type: file
file_type: bed
command: run_music.py
command: music
arguments:
- "--prefix":
type: string
......
......@@ -22,8 +22,8 @@ peak_type_dict = {
"broad": "-get_multiscale_broad_ERs"
}
subprocess.call(["/util/opt/lmod/lmod/init/profile"])
subprocess.call(["module", "load", "music"])
#subprocess.call(["/util/opt/lmod/lmod/init/profile"])
#subprocess.call(["module", "load", "music"])
if not os.path.isdir(args.prefix):
# Create unqiue subdirectories for processing input
......@@ -91,8 +91,17 @@ if not os.path.isdir(args.prefix):
], stdout=wh, stdin=sort.stdout)
sort.wait()
shutil.copyfile("sorted_scale_%s_all.bed" % (scale,),
"../%s_sorted_scale_%s_all.bed" % (args.prefix, scale))
with open("sorted_scale_%s_all.bed" % (scale,), "r") as rh:
with open("../%s_sorted_scale_%s_all.bed" % (args.prefix, scale), "w") as wh:
for line in rh:
info = line.split()
# Score value shouldn't be negative
info[4] = -1 * int(info[4])
# pad columsn so there are actually 9
for i in range(0, 3):
info.append(0)
# Write!
wh.write(info.join("\t") + "\n")
else:
print "Directory %s already exists." % (args.prefix,)
#!/bin/bash
. /util/opt/lmod/lmod/init/profile
module load music
run_music.py "$@"
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment