# HG changeset patch # User nick # Date 1369942887 14400 # Node ID dfa2e75da6aa54802ad6534a944895b7629b4770 # Parent e9c34ef993d64645fa1086c1f1378693f6dfb33d fixed script typo diff -r e9c34ef993d6 -r dfa2e75da6aa hetbox.py --- a/hetbox.py Wed May 29 11:25:22 2013 -0400 +++ b/hetbox.py Thu May 30 15:41:27 2013 -0400 @@ -1,7 +1,7 @@ #!/usr/bin/env python # New in this version: -# - handle commented-out header lines -# - did everything through the Rpy2 interface instead of inline R code +# - option to generate report is triggered simply by including report filename +# as third argument import os,sys,numpy from rpy2.robjects import Formula @@ -13,10 +13,6 @@ sys.exit(1) args = sys.argv[1:] -if '-r' in args: - make_report = True -else: - make_report = False if len(args) >= 1: infile = args[0] else: @@ -27,8 +23,8 @@ fail('Error: No output filename provided (as argument 2).') if len(args) >= 3: report = args[2] -elif make_report: - fail('Error: No output report filename provided (as argument 3).') +else: + report = '' # Check input file if not os.path.exists(infile): @@ -89,7 +85,7 @@ graphics.axis(1, at=range(1, len(graphlabels)+1, 1), labels=graphlabels, **kwargs3) grdevices.dev_off() -if not make_report: +if not report: sys.exit(0) @@ -106,8 +102,8 @@ ################################### SAMPLES=[] -for i in range(len(tab)): - SAMPLES.append(base.names(tab)[i]) +for i in range(len(table)): + SAMPLES.append(base.names(table)[i]) def boxstats(data,sample): VALUES = [100*float(x.strip().split('\t')[11]) for x in list(open(data)) if x.strip().split('\t')[0]==sample]