logging.getLogger("AddRawFiles").debug("concatenate_stats_file. before md5sum Does work_directory of the run ("+os.path.dirname(total_file_stat)+")exists?"+str(os.path.isdir(os.path.dirname(total_file_stat))))
logging.getLogger("AddRawFiles").debug("concatenate_stats_file. content of work_directory of the run ("+os.path.dirname(total_file_stat)+") = "+",".join(os.listdir(os.path.dirname(total_file_stat))))
logging.getLogger("AddRawFiles").debug("concatenate_stats_file. md5sum in "+str(total_file_stat))
logging.getLogger("AddRawFiles").debug("concatenate_stats_file. after md5sum Does work_directory of the run ("+os.path.dirname(total_file_stat)+")exists?"+str(os.path.isdir(os.path.dirname(total_file_stat))))
logging.getLogger("AddRawFiles").debug("concatenate_stats_file. Content of the folder ("+os.path.dirname(total_file_stat)+" = "+",".join(os.listdir(os.path.dirname(total_file_stat))))
logging.getLogger("AddRawFiles").debug("add_raw_files. Content of "+curr_stat_file)
withopen(curr_stat_file,'r')asmyfile:
nb_seq,size=myfile.read().split(':')
logging.getLogger("AddRawFiles").debug("add_raw_files. Content of "+curr_stat_file+" nb_seq = "+str(nb_seq)+", size = "+str(size))
size=int(size)
nb_seq=int(nb_seq)
total_size+=size
total_nb_seq+=nb_seq
# load the analysis object
run_dump=open(run_dump_path,"rb")
my_run=pickle.load(run_dump)
run_dump.close()
my_run.process_raw_files(compression)
logging.getLogger("AddRawFiles").debug("add_raw_files. Before my_run.process_raw_files total_nb_seq = "+str(total_nb_seq)+", total_size = "+str(total_size))
logging.getLogger("AddRawFiles").debug("add_raw_files. work_directory of the run "+my_run.get_work_directory())
my_run.process_raw_files(total_size,total_nb_seq)
logging.getLogger("AddRawFiles").debug("add_raw_files. after my_run.process_raw_files, does the work dir ("+my_run.get_work_directory()+") exist? "+str(os.path.isdir(my_run.get_work_directory())))
logging.getLogger("AddRawFiles").debug("add_raw_files. Content of the folder ("+my_run.get_work_directory()+" = "+",".join(os.listdir(my_run.get_work_directory())))
defcopy_file(file,output):
importos
importlogging
fromshutilimportcopyfile
logging.getLogger("AddRawFiles").debug("copy_file. copy "+str(file)+" to "+str(output))
try:
logging.getLogger("AddRawFiles").debug("copy_file. Does work_directory of the run ("+os.path.dirname(output)+")exists?"+str(os.path.isdir(os.path.dirname(output))))
copyfile(file,output)
logging.getLogger("AddRawFiles").debug("copy_file. Content of the folder ("+os.path.dirname(output)+" = "+",".join(os.listdir(os.path.dirname(output))))
except:
logging.getLogger("AddRawFiles").error("copy_file. Error raised while copying "+file+" to "+output)
#raise Exception('Could not ')
defzip_file(file,output):
importos
importlogging
fromng6.utilsimportUtils
logging.getLogger("AddRawFiles").debug("zip_file. zip "+str(file)+" to "+os.path.dirname(output))
Utils.gzip(file,os.path.dirname(output))
defbzip2_file(file,output):
importos
importlogging
fromng6.utilsimportUtils
logging.getLogger("AddRawFiles").debug("bzip2_file. zip "+str(file)+" to "+os.path.dirname(output))
logging.getLogger("AddRawFiles").debug("process. begin does the work dir ("+self.runobj.get_work_directory()+") exist? "+str(os.path.isdir(self.runobj.get_work_directory())))
logging.getLogger("AddRawFiles").debug("process. before extract_stats_from_seq_file. does the work dir ("+self.runobj.get_work_directory()+") exist? "+str(os.path.isdir(self.runobj.get_work_directory())))
logging.getLogger("AddRawFiles").debug("process. before add_raw_files. does the work dir ("+self.runobj.get_work_directory()+") exist? "+str(os.path.isdir(self.runobj.get_work_directory())))
logging.getLogger("AddRawFiles").debug("process. before self.compression. does the work dir ("+self.runobj.get_work_directory()+") exist? "+str(os.path.isdir(self.runobj.get_work_directory())))
logging.getLogger("AddRawFiles").debug("process. after self.compression. does the work dir ("+self.runobj.get_work_directory()+") exist? "+str(os.path.isdir(self.runobj.get_work_directory())))
logging.getLogger("AddRawFiles").debug("process. after concatenate_stats_file. does the work dir ("+self.runobj.get_work_directory()+") exist? "+str(os.path.isdir(self.runobj.get_work_directory())))
defpost_process(self):
logging.getLogger("AddRawFiles").debug("post_process. does the work dir ("+self.runobj.get_work_directory()+") exist? ")
# raise Exception("[ERROR] : the extract_rate value is not correct! (Should be between 0 and 1)")
# if int(min_nb_seq) > int(max_nb_seq):
# raise Exception("[ERROR] : the threshold values are not correct ! (Minimum threshold is bigger than Maximum threshold)")
# nb_files_pair = len(files)/2
# if int(nb_files_pair) != nb_files_pair:
# raise Exception("[ERROR] : the number of files is not correct! (Each sequence_files should correspond to an sub_sequence_files : [file1, file2, sub_file1, sub_file2])")
# nb_files_pair = int(nb_files_pair)
# sequence_files = files[:nb_files_pair]
# outputs = files[nb_files_pair:]
# logging.getLogger("SubsetSeqFiles").debug("extract_random_seq. Number of files " + str(nb_files_pair))