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]
# 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)
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()
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)