From b5e99e0964c98569cd65e94e57464e9bf674edae Mon Sep 17 00:00:00 2001 From: Duncan Parkes Date: Wed, 7 Sep 2016 13:29:43 +0100 Subject: [PATCH 1/2] Don't write dbname.txt file. I assume writing the dbname.txt file was debug that crept in by accident. --- modules/checkRead.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/checkRead.py b/modules/checkRead.py index e510a02..ba42ffc 100755 --- a/modules/checkRead.py +++ b/modules/checkRead.py @@ -271,12 +271,6 @@ def check_read( print 'Making new database: ', dbname print '='*80 sys.stdout.flush() - dbF = open('dbname.txt','w') - dbF.write(dbname+"\n") - dbF.close() - - - sql = 'CREATE DATABASE %s' % dbname cursor.execute(sql) From 1b56293afc98fb0acb6004c89488e7cb9ba6ef0c Mon Sep 17 00:00:00 2001 From: Duncan Parkes Date: Wed, 7 Sep 2016 14:07:03 +0100 Subject: [PATCH 2/2] Allow configuring the log directory. --- minUP.py | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/minUP.py b/minUP.py index 1432d33..b62542f 100755 --- a/minUP.py +++ b/minUP.py @@ -76,11 +76,14 @@ config_file = os.path.join(os.path.sep, \ os.path.dirname(os.path.realpath('__file__' \ )), 'minup_posix.config') - logfolder = os.path.join(os.path.sep, \ - os.path.dirname(os.path.realpath('__file__' \ - )), 'minup_run_logs') - VALID_REF_DIR = os.path.join(os.path.sep, \ - os.path.dirname(os.path.realpath('__file__')), \ + + default_log_dir = os.path.join( + os.path.sep, + os.path.dirname(os.path.realpath('__file__')), + 'minup_run_logs', + ) + VALID_REF_DIR = os.path.join(os.path.sep, + os.path.dirname(os.path.realpath('__file__')), 'valid_reference_fasta_files') BWA_INDEX_DIR = os.path.join(os.path.sep, \ os.path.dirname(os.path.realpath('__file__')), \ @@ -94,9 +97,13 @@ if OPER is 'windows': config_file = os.path.join(os.path.sep, sys.prefix, 'minup_windows.config') - logfolder = os.path.join(os.path.sep, sys.prefix, - 'minup_run_logs') - VALID_REF_DIR = os.path.join(os.path.sep, sys.prefix, \ + + default_log_dir = os.path.join( + os.path.sep, + sys.prefix, + 'minup_run_logs', + ) + VALID_REF_DIR = os.path.join(os.path.sep, sys.prefix, 'valid_reference_fasta_files') BWA_INDEX_DIR = os.path.join(os.path.sep, sys.prefix, \ 'bwa_indexes') @@ -434,6 +441,14 @@ version=('%(prog)s version={version}').format(version=__version__), ) + parser.add_argument( + '-logdir', + '--log-directory', + help='Directory where munUP will write its logs.', + default=default_log_dir, + dest='logdir', + ) + #------------------------------------------------------------------------------- args = parser.parse_args() @@ -448,8 +463,7 @@ BWA_INDEX_DIR = REF_DIR + '/gbwa.indexes/' LAST_INDEX_DIR = REF_DIR + '/glast.indexes/' - - + logfolder = args.logdir if not os.path.exists(logfolder): os.makedirs(logfolder)