# HG changeset patch # User fubar # Date 1370309660 14400 # Node ID 91cb2603b56cfcf88d3981f3851f509b7441b755 # Parent 42251cbdeeac3847e5438adce50b652b26e5ec36 Added getFileSize from rgutils to remove bogus dependency diff -r 42251cbdeeac -r 91cb2603b56c FastQC/rgFastQC.py --- a/FastQC/rgFastQC.py Mon Jun 03 20:30:24 2013 -0400 +++ b/FastQC/rgFastQC.py Mon Jun 03 21:34:20 2013 -0400 @@ -24,7 +24,6 @@ import optparse import shutil import tempfile -from rgutils import getFileString import zipfile import gzip @@ -37,7 +36,24 @@ assert opts <> None self.opts = opts - + def getFileString(fpath, outpath): + """ + format a nice file size string + """ + size = '' + fp = os.path.join(outpath, fpath) + s = fpath + if os.path.isfile(fp): + n = float(os.path.getsize(fp)) + if n > 2**20: + size = ' (%1.1f MB)' % (n/2**20) + elif n > 2**10: + size = ' (%1.1f KB)' % (n/2**10) + elif n > 0: + size = ' (%d B)' % (int(n)) + s = '%s %s' % (fpath, size) + return s + def run_fastqc(self): """ In batch mode fastqc behaves not very nicely - will write to a new folder in