class ConfigInfo:
def __init__(self):
+ #run_path = firecrest analysis directory to run analysis from
self.run_path = None
self.bustard_path = None
self.config_filepath = None
self.status = None
+ #top level directory where all analyses are placed
+ self.base_analysis_dir = None
+ #analysis_dir, top level analysis dir...
+ # base_analysis_dir + '/070924_USI-EAS44_0022_FC12150'
+ self.analysis_dir = None
+
def createStatusObject(self):
"""
# stdout=subprocess.PIPE,
# stderr=subprocess.PIPE)
- # CONTINUE HERE
- #FIXME: this only does a run on 5 tiles on lane 4
- stdout_filepath = "pipeline_configure_stdout.txt"
- stderr_filepath = "pipeline_configure_stderr.txt"
+ stdout_filepath = os.path.join(conf_info.analysis_dir,
+ "pipeline_configure_stdout.txt")
+ stderr_filepath = os.path.join(conf_info.analysis_dir,
+ "pipeline_configure_stderr.txt")
fout = open(stdout_filepath, 'w')
ferr = open(stderr_filepath, 'w')
'--GERALD=%s' % (conf_info.config_filepath),
#'--tiles=s_4_0100,s_4_0101,s_4_0102,s_4_0103,s_4_0104',
'--make',
- '.'],
+ conf_info.analysis_dir],
stdout=fout,
stderr=ferr)
return False
# Change cwd to run_path
- os.chdir(conf_info.run_path)
- stdout_filepath = os.path.join(conf_info.run_path, 'pipeline_run_stdout.txt')
- stderr_filepath = os.path.join(conf_info.run_path, 'pipeline_run_stderr.txt')
+ stdout_filepath = os.path.join(conf_info.analysis_dir, 'pipeline_run_stdout.txt')
+ stderr_filepath = os.path.join(conf_info.analysis_dir, 'pipeline_run_stderr.txt')
# Create status object
conf_info.createStatusObject()
ferr = open(stderr_filepath, 'w')
pipe = subprocess.Popen(['make',
- '-j8',
- 'recursive'],
- stdout=fout,
- stderr=ferr)
- #shell=True)
+ '--directory=%s' % (conf_info.run_path),
+ '-j8',
+ 'recursive'],
+ stdout=fout,
+ stderr=ferr)
+ #shell=True)
# Wait for run to finish
retcode = pipe.wait()
during a run and provides methods for retrieving
(completed, total) for each step or entire run.
"""
-
+ #print 'self._conf_filepath = %s' % (conf_filepath)
self._conf_filepath = conf_filepath
self._base_dir, junk = os.path.split(conf_filepath)
self._image_dir = os.path.join(self._base_dir, 'Images')
"""
Figures out the number of cycles that are available
"""
+ #print 'self._image_dir = %s' % (self._image_dir)
cycle_dirs = glob.glob(os.path.join(self._image_dir, 'L001', 'C*.1'))
+ #print 'cycle_dirs = %s' % (cycle_dirs)
cycle_list = []
for cycle_dir in cycle_dirs:
junk, c = os.path.split(cycle_dir)
self.cfg['notify_users'] = None
self.cfg['genome_dir'] = None
+ self.cfg['base_analysis_dir'] = None
self.conf_info_dict = {}
super(Runner, self).read_config(section, configfile)
self.genome_dir = self._check_required_option('genome_dir')
+ self.base_analysis_dir = self._check_required_option('base_analysis_dir')
def _parser(self, msg, who):
# Setup config info object
ci = ConfigInfo()
- ci.run_path = run_dir
+ ci.base_analysis_dir = self.base_analysis_dir
+ ci.analysis_dir = os.path.join(self.base_analysis_dir, run_dir)
# get flowcell from run_dir name
flowcell = _get_flowcell_from_rundir(run_dir)
def _runner(self, run_dir, flowcell, conf_info):
# retrieve config step
- cfg_filepath = os.path.abspath('config32auto.txt')
+ cfg_filepath = os.path.join(conf_info.analysis_dir,
+ 'config32auto.txt')
status_retrieve_cfg = retrieve_config(conf_info,
flowcell,
cfg_filepath,