From 38c9bae54f0463df5c5f59d333a5726c291119da Mon Sep 17 00:00:00 2001 From: basti Date: Tue, 4 Dec 2018 15:20:19 +0100 Subject: [PATCH] Fixed: "No Module named bin Error" V2 --- bin/Modules/SaveResults.py | 6 +++--- bin/RegGTFExtractor.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/Modules/SaveResults.py b/bin/Modules/SaveResults.py index e13aa6a..09c4955 100644 --- a/bin/Modules/SaveResults.py +++ b/bin/Modules/SaveResults.py @@ -4,14 +4,14 @@ class ResultSaver: - def __init__(self, results, organism, tissue): + def __init__(self, results, organism, tissue, wd): print("Save results to File !") self.path = "" if tissue: - self.path = os.path.join("./"+organism+"_filtered.gtf") + self.path = os.path.join(wd, "/"+organism+"_filtered.gtf") else: - self.path = os.path.join("./"+organism+".gtf") + self.path = os.path.join(wd, "./"+organism+".gtf") with open(self.path, "w") as file: write_it = csv.writer(file, delimiter='\t') diff --git a/bin/RegGTFExtractor.py b/bin/RegGTFExtractor.py index a99c708..20f2828 100644 --- a/bin/RegGTFExtractor.py +++ b/bin/RegGTFExtractor.py @@ -25,17 +25,17 @@ def main_script(org, wd, tissuetype=None): ense = Ensembl(org, wd) print("Getting Unique Results") unique_filter = UniqueFilter(ense.get_gtf(), ucsc.get_gtf(), tissuetype) - ResultSaver(unique_filter.get_results(), org, tissuetype) + ResultSaver(unique_filter.get_results(), org, tissuetype, wd) if __name__ == '__main__': parser = argparse.ArgumentParser(description='GTF-Generator from UCSC Table Browser and Ensembl Regulatory Build' ) parser.add_argument('organism', help='Source organism [ homo_sapiens or mus_musculus ]', action='store', nargs='?', type=str) parser.add_argument('--tissue', help='Tissue- or Celltype(s)', action='store', nargs='*', type=str) - parser.add_argument('--wd', help='Working directory. default: "."', default=".", action='store', type=str) + parser.add_argument('--wd', help='Working directory. default: "."', action='store', nargs='*', type=str) args = vars(parser.parse_args()) if args["organism"]: - #print(args["tissue"]) + print("Working Dir: " + args["wd"]) main_script(args["organism"], args["wd"], args["tissue"]) else: print("No Arguments found -> See ./RegGTFExtractor.py -h for help.")