From: Diane Trout Date: Tue, 6 Jan 2009 02:05:10 +0000 (+0000) Subject: Look in Temp directories for some of the files we have historically X-Git-Tag: stanford.caltech-merged-database-2009-jan-15~3 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=65b5bc7d910bcb888ccf3eb8ffda1db22b8c3dfc Look in Temp directories for some of the files we have historically used for our summary reports. Version 1.1rc1 of the gapipeline started moving some of the files into /Temp subdirectories of bustard and gerald. --- diff --git a/htsworkflow/pipelines/eland.py b/htsworkflow/pipelines/eland.py index 864f8ca..05563a1 100644 --- a/htsworkflow/pipelines/eland.py +++ b/htsworkflow/pipelines/eland.py @@ -316,10 +316,13 @@ def check_for_eland_file(basedir, pattern, lane_id, end): def eland(basedir, gerald=None, genome_maps=None): e = ELAND() - #file_list = glob(os.path.join(basedir, "*_eland_result.txt")) - #if len(file_list) == 0: - # # lets handle compressed eland files too - # file_list = glob(os.path.join(basedir, "*_eland_result.txt.bz2")) + # if there is a basedir/Temp change basedir to point to the temp + # directory, as 1.1rc1 moves most of the files we've historically + # cared about to that subdirectory. + # we should look into what the official 'result' files are. + basedir_temp = os.path.join(basedir, 'Temp') + if os.path.isdir(basedir_temp): + basedir = basedir_temp lane_ids = range(1,9) ends = [None, 1, 2] diff --git a/htsworkflow/pipelines/runfolder.py b/htsworkflow/pipelines/runfolder.py index ba99c4c..f327b78 100644 --- a/htsworkflow/pipelines/runfolder.py +++ b/htsworkflow/pipelines/runfolder.py @@ -304,7 +304,15 @@ def extract_results(runs, output_base_dir=None): # tar score files score_files = [] - for f in os.listdir(g.pathname): + + # check for g.pathname/Temp a new feature of 1.1rc1 + scores_path = g.pathname + scores_path_temp = os.path.join(scores_path, 'Temp') + if os.path.isdir(scores_path_temp): + scores_path = scores_path_temp + + # hopefully we have a directory that contains s_*_score files + for f in os.listdir(scores_path): if re.match('.*_score.txt', f): score_files.append(f) @@ -312,12 +320,13 @@ def extract_results(runs, output_base_dir=None): bzip_cmd = [ 'bzip2', '-9', '-c' ] tar_dest_name =os.path.join(cycle_dir, 'scores.tar.bz2') tar_dest = open(tar_dest_name, 'w') - logging.info("Compressing score files in %s" % (g.pathname,)) + logging.info("Compressing score files from %s" % (scores_path,)) logging.info("Running tar: " + " ".join(tar_cmd[:10])) logging.info("Running bzip2: " + " ".join(bzip_cmd)) logging.info("Writing to %s" %(tar_dest_name)) - tar = subprocess.Popen(tar_cmd, stdout=subprocess.PIPE, shell=False, cwd=g.pathname) + tar = subprocess.Popen(tar_cmd, stdout=subprocess.PIPE, shell=False, + cwd=scores_path) bzip = subprocess.Popen(bzip_cmd, stdin=tar.stdout, stdout=tar_dest) tar.wait() @@ -327,6 +336,9 @@ def extract_results(runs, output_base_dir=None): source_name = eland_lane.pathname path, name = os.path.split(eland_lane.pathname) dest_name = os.path.join(cycle_dir, name) + logging.info("Saving eland file %s to %s" % \ + (source_name, dest_name)) + if is_compressed(name): logging.info('Already compressed, Saving to %s' % (dest_name, )) shutil.copy(source_name, dest_name)