From: Diane Trout Date: Fri, 24 Apr 2009 23:34:13 +0000 (+0000) Subject: Allow picking runfolder variant we should be trying to extract srf files from. X-Git-Tag: 0.2.0.5~19 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=e8bae281baeedddcaff8785fb202c835296a9ab3 Allow picking runfolder variant we should be trying to extract srf files from. adds an option -r to chose which version of the illumina2srf or solexa2srf programs 0 is solexa2srf 1 is illumina2srf -V1 2 is illumina2srf (current pipeline 1.3.2 version) --- diff --git a/scripts/srf b/scripts/srf index 09a2155..e7478a9 100644 --- a/scripts/srf +++ b/scripts/srf @@ -10,7 +10,11 @@ import sys from htsworkflow.util import queuecommands from htsworkflow.pipelines import runfolder -def make_commands(run_name, lanes, site_name, destdir): +SOLEXA2SRF = 0 +ILLUMINA2SRF10 = 1 +ILLUMINA2SRF11 = 2 + +def make_commands(run_name, lanes, site_name, destdir, cmdlevel=ILLUMINA2SRF11): """ make a subprocess-friendly list of command line arguments to run solexa2srf generates files like: @@ -30,15 +34,24 @@ def make_commands(run_name, lanes, site_name, destdir): dest_path = os.path.join(destdir, destname) seq_pattern = 's_%d_*_seq.txt' % (lane,) - cmd = ['solexa2srf', - '-N', name_prefix, - '-n', '%3x:%3y', - '-o', dest_path, - seq_pattern] - #cmd = ['illumina2srf', - # '-v1.0', - # '-o', dest_path, - # seq_pattern] + if cmdlevel == SOLEXA2SRF: + cmd = ['solexa2srf', + '-N', name_prefix, + '-n', '%3x:%3y', + '-o', dest_path, + seq_pattern] + elif cmdlevel == ILLUMINA2SRF10: + cmd = ['illumina2srf', + '-v1.0', + '-o', dest_path, + seq_pattern] + elif cmdlevel == ILLUMINA2SRF11: + seq_pattern = 's_%d_*_qseq.txt' % (lane,) + cmd = ['illumina2srf', + '-o', dest_path, + seq_pattern] + else: + raise ValueError("Unrecognized run level %d" % (cmdlevel,)) cmd_list.append(" ".join(cmd)) return cmd_list @@ -75,6 +88,11 @@ def make_parser(): ) parser.add_option('-j', '--jobs', default=1, type='int', help='how many jobs to run simultaneously') + parser.add_option('-r', '--runfolder-version', default=ILLUMINA2SRF11, type='int', + help='Which class of srf file should we attempt to create\n' + '0 = Solexa pipeline 0.2.6 - 0.3\n' + '1 = illumina pipeline 1.0\n' + '2 = illumina pipeline 1.1rc1 and later \n') parser.add_option('-v', '--verbose', dest='verbose', default=False, action='store_true', @@ -141,7 +159,7 @@ def main(cmdline=None): return 1 elif len(runs) == 1: bustard_dir = runs[0].bustard.pathname - cmds[bustard_dir] = make_commands(name, lanes, opts.site, opts.dest_dir) + cmds[bustard_dir] = make_commands(name, lanes, opts.site, opts.dest_dir, opts.runfolder_version) else: print "ERROR: Couldn't find a bustard directory in", runfolder_path return 1