annotate rgFastQC.py @ 0:e28c965eeed4 draft

Imported from capsule None
author devteam
date Mon, 27 Jan 2014 09:29:14 -0500
parents
children 8fae48caaf06
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
1 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
2 # May 2013 ross added check for bogus gz extension - fastqc gets confused
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
3 # added sanitizer for user supplied name
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
4 # removed shell and make cl a sequence for Popen call
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
5 # ross lazarus August 10 2012 in response to anon insecurity report
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
6 wrapper for fastqc
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
7
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
8 called as
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
9 <command interpreter="python">
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
10 rgFastqc.py -i $input_file -d $html_file.files_path -o $html_file -n "$out_prefix"
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
11 </command>
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
12
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
13
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
14
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
15 Current release seems overly intolerant of sam/bam header strangeness
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
16 Author notified...
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
17
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
18
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
19 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
20 import re
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
21 import os
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
22 import sys
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
23 import subprocess
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
24 import optparse
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
25 import shutil
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
26 import tempfile
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
27 import zipfile
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
28 import gzip
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
29
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
30
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
31 def getFileString(fpath, outpath):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
32 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
33 format a nice file size string
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
34 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
35 size = ''
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
36 fp = os.path.join(outpath, fpath)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
37 s = '? ?'
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
38 if os.path.isfile(fp):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
39 n = float(os.path.getsize(fp))
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
40 if n > 2**20:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
41 size = ' (%1.1f MB)' % (n/2**20)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
42 elif n > 2**10:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
43 size = ' (%1.1f KB)' % (n/2**10)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
44 elif n > 0:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
45 size = ' (%d B)' % (int(n))
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
46 s = '%s %s' % (fpath, size)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
47 return s
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
48
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
49
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
50 class FastQC():
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
51 """wrapper
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
52 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
53
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
54
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
55 def __init__(self,opts=None):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
56 assert opts <> None
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
57 self.opts = opts
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
58
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
59
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
60 def run_fastqc(self):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
61 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
62 In batch mode fastqc behaves not very nicely - will write to a new folder in
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
63 the same place as the infile called [infilebasename]_fastqc
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
64 rlazarus@omics:/data/galaxy/test$ ls FC041_1_sequence_fastqc
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
65 duplication_levels.png fastqc_icon.png per_base_n_content.png per_sequence_gc_content.png summary.txt
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
66 error.png fastqc_report.html per_base_quality.png per_sequence_quality.png tick.png
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
67 fastqc_data.txt per_base_gc_content.png per_base_sequence_content.png sequence_length_distribution.png warning.png
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
68
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
69 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
70 serr = ''
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
71 dummy,tlog = tempfile.mkstemp(prefix='rgFastQC',suffix=".log",dir=self.opts.outputdir)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
72 sout = open(tlog, 'w')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
73 fastq = os.path.basename(self.opts.input)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
74 cl = [self.opts.executable,'--outdir=%s' % self.opts.outputdir]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
75 if self.opts.informat in ['sam','bam']:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
76 cl.append('--f=%s' % self.opts.informat)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
77 if self.opts.contaminants <> None :
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
78 cl.append('--contaminants=%s' % self.opts.contaminants)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
79 # patch suggested by bwlang https://bitbucket.org/galaxy/galaxy-central/pull-request/30
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
80 # use a symlink in a temporary directory so that the FastQC report reflects the history input file name
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
81 infname = self.opts.inputfilename
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
82 linf = infname.lower()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
83 trimext = False
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
84 # decompression at upload currently does NOT remove this now bogus ending - fastqc will barf
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
85 # patched may 29 2013 until this is fixed properly
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
86 if ( linf.endswith('.gz') or linf.endswith('.gzip') ):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
87 f = gzip.open(self.opts.input)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
88 try:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
89 testrow = f.readline()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
90 except:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
91 trimext = True
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
92 f.close()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
93 elif linf.endswith('bz2'):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
94 f = bz2.open(self.opts.input,'rb')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
95 try:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
96 f.readline()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
97 except:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
98 trimext = True
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
99 f.close()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
100 elif linf.endswith('.zip'):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
101 if not zipfile.is_zipfile(self.opts.input):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
102 trimext = True
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
103 if trimext:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
104 infname = os.path.splitext(infname)[0]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
105 fastqinfilename = re.sub(ur'[^a-zA-Z0-9_\-\.]', '_', os.path.basename(infname))
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
106 link_name = os.path.join(self.opts.outputdir, fastqinfilename)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
107 os.symlink(self.opts.input, link_name)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
108 cl.append(link_name)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
109 sout.write('# FastQC cl = %s\n' % ' '.join(cl))
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
110 sout.flush()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
111 p = subprocess.Popen(cl, shell=False, stderr=sout, stdout=sout, cwd=self.opts.outputdir)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
112 retval = p.wait()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
113 sout.close()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
114 runlog = open(tlog,'r').readlines()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
115 os.unlink(link_name)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
116 flist = os.listdir(self.opts.outputdir) # fastqc plays games with its output directory name. eesh
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
117 odpath = None
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
118 for f in flist:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
119 d = os.path.join(self.opts.outputdir,f)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
120 if os.path.isdir(d):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
121 if d.endswith('_fastqc'):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
122 odpath = d
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
123 hpath = None
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
124 if odpath <> None:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
125 try:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
126 hpath = os.path.join(odpath,'fastqc_report.html')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
127 rep = open(hpath,'r').readlines() # for our new html file but we need to insert our stuff after the <body> tag
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
128 except:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
129 pass
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
130 if hpath == None:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
131 serr = '\n'.join(runlog)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
132 res = ['## odpath=%s: No output found in %s. Output for the run was:<pre>\n' % (odpath,hpath),]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
133 res += runlog
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
134 res += ['</pre>\n',
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
135 'Please read the above for clues<br/>\n',
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
136 'If you selected a sam/bam format file, it might not have headers or they may not start with @HD?<br/>\n',
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
137 'It is also possible that the log shows that fastqc is not installed?<br/>\n',
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
138 'If that is the case, please tell the relevant Galaxy administrator that it can be snarfed from<br/>\n',
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
139 'http://www.bioinformatics.bbsrc.ac.uk/projects/fastqc/<br/>\n',]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
140 return res,1,serr
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
141 self.fix_fastqcimages(odpath)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
142 flist = os.listdir(self.opts.outputdir) # these have now been fixed
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
143 excludefiles = ['tick.png','warning.png','fastqc_icon.png','error.png']
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
144 flist = [x for x in flist if not x in excludefiles]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
145 for i in range(len(rep)): # need to fix links to Icons and Image subdirectories in lastest fastqc code - ugh
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
146 rep[i] = rep[i].replace('Icons/','')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
147 rep[i] = rep[i].replace('Images/','')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
148
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
149 html = self.fix_fastqc(rep,flist,runlog)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
150 return html,retval,serr
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
151
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
152
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
153
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
154 def fix_fastqc(self,rep=[],flist=[],runlog=[]):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
155 """ add some of our stuff to the html
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
156 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
157 bodyindex = len(rep) -1 # hope they don't change this
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
158 footrow = bodyindex - 1
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
159 footer = rep[footrow]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
160 rep = rep[:footrow] + rep[footrow+1:]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
161 res = ['<div class="module"><h2>Files created by FastQC</h2><table cellspacing="2" cellpadding="2">\n']
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
162 flist.sort()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
163 for i,f in enumerate(flist):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
164 if not(os.path.isdir(f)):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
165 fn = os.path.split(f)[-1]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
166 res.append('<tr><td><a href="%s">%s</a></td></tr>\n' % (fn,getFileString(fn, self.opts.outputdir)))
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
167 res.append('</table>\n')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
168 res.append('<a href="http://www.bioinformatics.bbsrc.ac.uk/projects/fastqc/">FastQC documentation and full attribution is here</a><br/><hr/>\n')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
169 res.append('FastQC was run by Galaxy using the rgenetics rgFastQC wrapper - see http://bitbucket.org/rgenetics for details and licensing\n</div>')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
170 res.append(footer)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
171 fixed = rep[:bodyindex] + res + rep[bodyindex:]
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
172 return fixed # with our additions
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
173
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
174
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
175 def fix_fastqcimages(self,odpath):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
176 """ Galaxy wants everything in the same files_dir
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
177 """
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
178 icpath = os.path.join(odpath,'Icons')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
179 impath = os.path.join(odpath,'Images')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
180 for adir in [icpath,impath,odpath]:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
181 if os.path.exists(adir):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
182 flist = os.listdir(adir) # get all files created
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
183 for f in flist:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
184 if not os.path.isdir(os.path.join(adir,f)):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
185 sauce = os.path.join(adir,f)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
186 dest = os.path.join(self.opts.outputdir,f)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
187 shutil.move(sauce,dest)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
188 os.rmdir(adir)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
189
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
190
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
191
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
192 if __name__ == '__main__':
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
193 op = optparse.OptionParser()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
194 op.add_option('-i', '--input', default=None)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
195 op.add_option('-j', '--inputfilename', default=None)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
196 op.add_option('-o', '--htmloutput', default=None)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
197 op.add_option('-d', '--outputdir', default="/tmp/shortread")
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
198 op.add_option('-f', '--informat', default='fastq')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
199 op.add_option('-n', '--namejob', default='rgFastQC')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
200 op.add_option('-c', '--contaminants', default=None)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
201 op.add_option('-e', '--executable', default='fastqc')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
202 opts, args = op.parse_args()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
203 assert opts.input <> None
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
204 assert os.path.isfile(opts.executable),'##rgFastQC.py error - cannot find executable %s' % opts.executable
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
205 if not os.path.exists(opts.outputdir):
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
206 os.makedirs(opts.outputdir)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
207 f = FastQC(opts)
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
208 html,retval,serr = f.run_fastqc()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
209 f = open(opts.htmloutput, 'w')
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
210 f.write(''.join(html))
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
211 f.close()
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
212 if retval <> 0:
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
213 print >> sys.stderr, serr # indicate failure
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
214
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
215
e28c965eeed4 Imported from capsule None
devteam
parents:
diff changeset
216