Skip to content

Commit

Permalink
fix path access and parse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekbhr committed Nov 6, 2017
1 parent 07a4b7d commit 669774d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 321 deletions.
277 changes: 0 additions & 277 deletions README.md

This file was deleted.

26 changes: 13 additions & 13 deletions workflows/ChIP-seq/ChIP-seq
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import yaml
import inspect


#sys.path.append(os.path.abspath(inspect.getfile(inspect.currentframe())) + "../../shared/")
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(inspect.getfile(inspect.currentframe())))))+"/shared/")
sys.path.append(os.path.abspath(os.path.dirname(inspect.getfile(inspect.currentframe()))) + "/shared/")
#sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(inspect.getfile(inspect.currentframe())))))+"/shared/")


import common_functions as cf
Expand Down Expand Up @@ -139,11 +139,21 @@ def parse_args(defaults={"verbose":None,"configfile":None,"max_jobs":None,"snake

def main():

## basic paths only used in wrapper
#this_script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
this_script_dir = os.path.dirname(os.path.realpath(__file__))
main_dir_path = os.path.join(os.path.dirname(os.path.dirname(this_script_dir)))

## defaults
defaults = cf.load_configfile(os.path.join(this_script_dir, "defaults.yaml"),False)

## get command line arguments
args = parser.parse_args(defaults)
parser = parse_args(defaults)
args = parser.parse_args()

## we also add these paths to config, although we dont use them in the Snakefile
args.this_script_dir = this_script_dir
args.main_dir_path = main_dir_path

## checks for parameters necessary in wrapper
# 1. Dir path
Expand Down Expand Up @@ -173,16 +183,6 @@ def main():
print("\nSample info file not found! (--DB {})\n".format(args.sample_info))
exit(1)


## basic paths only used in wrapper
#this_script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
this_script_dir = os.path.dirname(os.path.realpath(__file__))
main_dir_path = os.path.join(os.path.dirname(os.path.dirname(this_script_dir)))

## we also add these paths to config, although we dont use them in the Snakefile
args.this_script_dir = this_script_dir
args.main_dir_path = main_dir_path

## merge configuration dicts
config = defaults # 1) form defaults.yaml
if args.configfile:
Expand Down
22 changes: 11 additions & 11 deletions workflows/DNA-mapping/DNA-mapping
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import yaml
import inspect

#sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath('__file__')))))+"/shared/")
sys.path.append(os.path.abspath(inspect.getfile(inspect.currentframe())) + "../../shared/")
sys.path.append(os.path.abspath(os.path.dirname(inspect.getfile(inspect.currentframe()))) + "/shared/")

import common_functions as cf


Expand Down Expand Up @@ -220,11 +221,19 @@ def parse_args(defaults={"verbose":None,"configfile":None,"max_jobs":None,"snake

def main():

## basic paths only used in wrapper
this_script_dir = os.path.dirname(os.path.realpath(__file__))
main_dir_path = os.path.join(os.path.dirname(os.path.dirname(this_script_dir)))

## defaults
defaults = cf.load_configfile(os.path.join(this_script_dir, "defaults.yaml"),False)

## get command line arguments
args = parser.parse_args(defaults)
parser = parse_args(defaults)
args = parser.parse_args()
## we also add these paths to config, although we dont use them in the Snakefile
args.this_script_dir = this_script_dir
args.main_dir_path = main_dir_path

args.outdir = os.path.abspath(args.outdir)
args.cluster_logs_dir = os.path.join(args.outdir, "cluster_logs")
Expand All @@ -249,15 +258,6 @@ def main():
print("\nError! Provided configfile (-c) not found! ({})\n".format(args.configfile))
exit(1)


## basic paths only used in wrapper
this_script_dir = os.path.dirname(os.path.realpath(__file__))
main_dir_path = os.path.join(os.path.dirname(os.path.dirname(this_script_dir)))

## we also add these paths to config, although we dont use them in the Snakefile
args.this_script_dir = this_script_dir
args.main_dir_path = main_dir_path

## merge configuration dicts
config = defaults # 1) form defaults.yaml
if args.configfile:
Expand Down

0 comments on commit 669774d

Please sign in to comment.