Skip to content
Snippets Groups Projects
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
Branches
No related tags found
1 merge request!27Resolve "MUSIC peak caller"
...@@ -46,7 +46,7 @@ music_punctate: ...@@ -46,7 +46,7 @@ music_punctate:
- name: scale_2216.bed - name: scale_2216.bed
type: file type: file
file_type: bed file_type: bed
command: run_music.py command: music
arguments: arguments:
- "--prefix": - "--prefix":
type: string type: string
......
...@@ -22,8 +22,8 @@ peak_type_dict = { ...@@ -22,8 +22,8 @@ peak_type_dict = {
"broad": "-get_multiscale_broad_ERs" "broad": "-get_multiscale_broad_ERs"
} }
subprocess.call(["/util/opt/lmod/lmod/init/profile"]) #subprocess.call(["/util/opt/lmod/lmod/init/profile"])
subprocess.call(["module", "load", "music"]) #subprocess.call(["module", "load", "music"])
if not os.path.isdir(args.prefix): if not os.path.isdir(args.prefix):
# Create unqiue subdirectories for processing input # Create unqiue subdirectories for processing input
...@@ -91,8 +91,17 @@ if not os.path.isdir(args.prefix): ...@@ -91,8 +91,17 @@ if not os.path.isdir(args.prefix):
], stdout=wh, stdin=sort.stdout) ], stdout=wh, stdin=sort.stdout)
sort.wait() sort.wait()
shutil.copyfile("sorted_scale_%s_all.bed" % (scale,), with open("sorted_scale_%s_all.bed" % (scale,), "r") as rh:
"../%s_sorted_scale_%s_all.bed" % (args.prefix, scale)) 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: else:
print "Directory %s already exists." % (args.prefix,) 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment