3 Runfolder.py can generate a xml file capturing all the 'interesting' parameters from a finished pipeline run. (using the -a option). The information currently being captured includes:
7 * start/stop cycle numbers
8 * Firecrest, bustard, gerald version numbers
9 * Eland analysis types, and everything in the eland configuration file.
10 * cluster numbers and other values from the Summary.htm
11 LaneSpecificParameters table.
12 * How many reads mapped to a genome from an eland file
14 The ELAND "mapped reads" counter will also check for eland squashed file
15 that were symlinked from another directory. This is so I can track how
16 many reads landed on the genome of interest and on the spike ins.
18 Basically my subdirectories something like:
21 genomes/hg18/chr*.2bpb <- files for hg18 genome
23 genomes/hg18/VATG.fa.2bp <- symlink to genomes/spikeins
26 runfolder.py can also spit out a simple summary report (-s option)
27 that contains the per lane post filter cluster numbers and the mapped
28 read counts. (The report isn't currently very pretty)
36 from htsworkflow.pipelines import runfolder
37 from htsworkflow.pipelines.runfolder import ElementTree
40 usage = 'usage: %prog [options] runfolder_root_dir'
41 parser = optparse.OptionParser(usage)
43 parser.add_option('-v', '--verbose', dest='verbose', action='store_true',
45 help='turn on verbose mode')
46 parser.add_option('--dry-run', action='store_true', default=False,
47 help="Don't delete anything (in clean mode)")
49 commands = optparse.OptionGroup(parser, 'Commands')
51 commands.add_option('-s', '--summary', dest='summary', action='store_true',
53 help='produce summary report')
54 commands.add_option('-a', '--archive', dest='archive', action='store_true',
56 help='generate run configuration archive')
57 commands.add_option('--extract-results', action='store_true',
59 help='create run-xml summary, compress the eland result files, build srf files and '
60 'copy all that and the Summary.htm file into an archival directory.')
61 commands.add_option('-c', '--clean', action='store_true', default=False,
62 help='Clean runfolder, preparing it for long-term storage')
63 parser.add_option_group(commands)
65 parser.add_option('-j', '--max-jobs', default=1,
66 help='sepcify the maximum number of processes to run '
67 '(used in extract-results)')
68 parser.add_option('-o', '--output-dir', default=None,
69 help="specify the default output directory for extract results")
70 parser.add_option('--run-xml', dest='run_xml',
72 help='specify a run_<FlowCell>.xml file for summary reports')
73 parser.add_option('--site', default=None,
74 help='create srf files tagged with the provided site name')
75 parser.add_option('-u', '--use-run', dest='use_run', default=None,
76 help='Specify which run to use instead of autoscanning '
77 'the runfolder. You do this by providing the final '
78 ' GERALD directory, and it assumes the parent '
79 'directories are the bustard and image processing '
84 def main(cmdlist=None):
85 parser = make_parser()
86 opt, args = parser.parse_args(cmdlist)
90 root_log = logging.getLogger()
91 root_log.setLevel(logging.INFO)
93 logging.info('Starting htsworkflow illumina runfolder processing tool.')
97 opt.run_xml = os.path.expanduser(opt.run_xml)
98 tree = ElementTree.parse(opt.run_xml).getroot()
99 runs.append(runfolder.PipelineRun(xml=tree))
101 # look for manually specified run
102 if opt.use_run is not None:
103 specific_run = runfolder.get_specific_run(opt.use_run)
104 if specific_run is not None:
105 runs.append(specific_run)
107 logging.warn("Couldn't find a run in %s" % (opt.use_run,))
109 # scan runfolders for runs
110 for run_pattern in args:
111 # expand args on our own if needed
112 for run_dir in glob(run_pattern):
113 runs.extend(runfolder.get_runs(run_dir))
118 print runfolder.summary_report(runs)
121 runfolder.extract_run_parameters(runs)
123 if opt.extract_results:
124 runfolder.extract_results(runs, opt.output_dir, opt.site, opt.max_jobs)
127 runfolder.clean_runs(runs, opt.dry_run)
130 if command_run == False:
131 print "You need to specify a command."+os.linesep
134 print "You need to specify some run folders to process..."+os.linesep
139 if __name__ == "__main__":
140 sys.exit(main(sys.argv[1:]))