diff --git a/src/pathme/cli.py b/src/pathme/cli.py index c1fa4ab..ab4f639 100644 --- a/src/pathme/cli.py +++ b/src/pathme/cli.py @@ -121,7 +121,7 @@ def download(): log.setLevel(logging.INFO) cached_file = os.path.join(WIKIPATHWAYS_FILES, get_file_name_from_url(RDF_WIKIPATHWAYS)) - make_downloader(RDF_WIKIPATHWAYS, cached_file, WIKIPATHWAYS, unzip_file) + make_downloader(RDF_WIKIPATHWAYS, cached_file, WIKIPATHWAYS_FILES, unzip_file) log.info('WikiPathways was downloaded') @@ -208,7 +208,7 @@ def download(): log.setLevel(logging.INFO) cached_file = os.path.join(REACTOME_FILES, get_file_name_from_url(RDF_REACTOME)) - make_downloader(RDF_REACTOME, cached_file, REACTOME, untar_file) + make_downloader(RDF_REACTOME, cached_file, REACTOME_FILES, untar_file) log.info('Reactome was downloaded') diff --git a/src/pathme/utils.py b/src/pathme/utils.py index 41487dc..b519c87 100644 --- a/src/pathme/utils.py +++ b/src/pathme/utils.py @@ -288,11 +288,11 @@ def statistics_to_df(all_pathways_statistics): """Downloader""" -def make_downloader(url, path, database, decompress_file): +def make_downloader(url, path, export_path, decompress_file): """Make a function that downloads the data for you, or uses a cached version at the given path. :param str url: The URL of some data - :param str database: database name / folder to be created in resources + :param str export_path: folder where decompressed file will be exported :param method decompress_file: method to decompress file :return: A function that downloads the data and returns the path of the data :rtype: (bool -> str) @@ -316,7 +316,7 @@ def download_data(force_download=False): data = download_data() log.info('unzipping file %s, da') - decompress_file(data, os.path.join(DATA_DIR, database)) + decompress_file(data, export_path) def summarize_helper(graphs):