4 from htsworkflow.util import queuecommands
10 def pathname_to_run_name(base):
12 Convert a pathname to a base runfolder name
13 handle the case with a trailing /
17 base, name = os.path.split(base)
22 def make_commands(run_name, lanes, site_name, destdir, cmdlevel=ILLUMINA2SRF11):
24 make a subprocess-friendly list of command line arguments to run solexa2srf
26 woldlab:080514_HWI-EAS229_0029_20768AAXX:8.srf
29 run_name - most of the file name (run folder name is a good choice)
30 lanes - list of integers corresponding to which lanes to process
31 site_name - name of your "sequencing site" or "Individual"
32 destdir - where to write all the srf files
35 logging.info("run_name %s" % ( run_name, ))
39 name_prefix = '%s_%%l_%%t_' % (run_name,)
40 destname = '%s_%s_%d.srf' % (site_name, run_name, lane)
41 destdir = os.path.normpath(destdir)
42 dest_path = os.path.join(destdir, destname)
43 seq_pattern = 's_%d_*_seq.txt' % (lane,)
45 if cmdlevel == SOLEXA2SRF:
51 elif cmdlevel == ILLUMINA2SRF10:
52 cmd = ['illumina2srf',
56 elif cmdlevel == ILLUMINA2SRF11:
57 seq_pattern = 's_%d_*_qseq.txt' % (lane,)
58 cmd = ['illumina2srf',
62 raise ValueError("Unrecognized run level %d" % (cmdlevel,))
64 logging.info("Generated command: " + " ".join(cmd))
65 cmd_list.append(" ".join(cmd))
68 def run_srf_commands(bustard_dir, cmd_list, num_jobs):
69 logging.info("chdir to %s" % (bustard_dir,))
72 q = queuecommands.QueueCommands(cmd_list, num_jobs)