Skip to content

Commit

Permalink
fix decontam script path
Browse files Browse the repository at this point in the history
  • Loading branch information
pirovc committed Jul 22, 2022
1 parent aff90bb commit 07599f0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions grimer/func.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def update_tax_nodes(nodes, tax):
return updated_nodes


def run_decontam(run_decontam, cfg, table, metadata, control_samples):
def run_decontam(run_decontam, cfg, table, metadata, control_samples, script_dir):

if not run_decontam:
print_log("Not activated, skipping")
Expand Down Expand Up @@ -732,7 +732,7 @@ def run_decontam(run_decontam, cfg, table, metadata, control_samples):
else:
table.data[rank].to_csv(out_table, sep="\t", header=True, index=True)

cmd = " ".join(["scripts/run_decontam.R",
cmd = " ".join([os.path.join(script_dir, "scripts", "run_decontam.R"),
"--resout " + tmp_output_prefix + "decontam_out.tsv",
"--modout " + tmp_output_prefix + "decontam_mod.tsv",
"--counts " + out_table,
Expand Down
6 changes: 3 additions & 3 deletions grimer/grimer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def main(argv=sys.argv[1:]):
# Setup global _debug variable to be used by other files with #from grimer.grimer import _debug
global _debug
_debug = args.debug
# Define path of running script to get static files
script_dir, _ = os.path.split(__file__)

# 1) Load data/analysis
# If not parsed, skipped or error, var is None
Expand Down Expand Up @@ -76,7 +78,7 @@ def main(argv=sys.argv[1:]):
mgnify = parse_mgnify(args.mgnify, cfg, tax, table.ranks())

print_log("- Running DECONTAM")
decontam = run_decontam(args.decontam, cfg, table, metadata, control_samples)
decontam = run_decontam(args.decontam, cfg, table, metadata, control_samples, script_dir)

print_log("- Running hierarchical clustering")
hcluster, dendro = run_hclustering(table, args.linkage_methods, args.linkage_metrics, args.transformation, args.skip_dendrogram, args.optimal_ordering)
Expand Down Expand Up @@ -296,8 +298,6 @@ def main(argv=sys.argv[1:]):

# 5) Draw layout
print_log("- Drawing layout")
# Define path of running script to get static files
script_dir, _ = os.path.split(__file__)
logo_path = os.path.join(script_dir, "img", "logo.png")

final_layout = make_layout(ele, sizes, Config.version, logo_path, args.title, args.output_plots)
Expand Down
Empty file added grimer/scripts/__init__.py
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def read(filename):
long_description=read("README.md"),
packages=['grimer'],
package_data={
'grimer': ['js/*', 'css/*', 'img/*']
'grimer': ['css/*', 'img/*', 'js/*', 'scripts/*']
},
entry_points={'console_scripts': ['grimer=grimer.grimer:main']},
classifiers=[
Expand Down

0 comments on commit 07599f0

Please sign in to comment.