In [307]:
%pylab inline
Populating the interactive namespace from numpy and matplotlib
WARNING: pylab import has clobbered these variables: ['f']
`%pylab --no-import-all` prevents importing * from pylab and numpy
In [308]:
import numpy
In [309]:
import matplotlib.collections as collections
font = {'family' : 'normal',
        'size'   : 16}

matplotlib.rc('font', **font)
In [310]:
def triptych(data):
    # Two subplots, the axes array is 1-d
    f, axarr = plt.subplots(3, sharex=True)
    plot1, plot2, plot3 = axarr
    plot1.plot(data[:,0], data[:,1], 'b-')
    plot1.set_ylabel('CPU load (%)')
    
    #axarr[0].set_title('Sharing X axis')
    plot2.plot(data[:,0], data[:,2] / 1e6, 'r-')
    plot2.set_ylabel('RAM (GB)')
    plot3.plot(data[:,0], data[:,3] / 1000, 'g-')
    plot3.set_ylabel('Disk (kTPS)')
                     
    plot3.set_xlabel('Time (seconds)')
    
    f.set_size_inches(10, 8)
   
    return f, axarr

Acceptance testing

In [311]:
import numpy
shortdata = numpy.loadtxt('short-m1.xlarge/log.out')
In [312]:
f, axarr = triptych(shortdata)
    
savefig('/tmp/shortdata-1.pdf')
In [313]:
f, axarr = triptych(shortdata)
    
plot1 = axarr[0]
plot1.set_ylim((0, 130))
plot1.annotate("QC", (300, 70))
plot1.annotate("diginorm", (700, 70))
plot1.annotate("assembly", (1400, 110))
plot1.annotate("annot", (1900, 80))
plot1.annotate("diff expr", (2300, 110))
    
savefig('/tmp/shortdata-2.pdf')
In [314]:
f, axarr = triptych(shortdata)

for p in axarr:
    collection = collections.BrokenBarHCollection.span_where(
       shortdata[:,0], ymin=0, ymax=1e11, where=(shortdata[:,0]>=521) & (shortdata[:,0]<1418), facecolor='green', alpha=0.3)
    p.add_collection(collection)

    collection = collections.BrokenBarHCollection.span_where(
       shortdata[:,0], ymin=0, ymax=1e11, where=(shortdata[:,0]>=1418) & (shortdata[:,0]<1750), facecolor='red', alpha=0.3)
    p.add_collection(collection)
    
plot1 = axarr[0]
plot1.set_ylim((0, 130))
plot1.annotate("diginorm", (700, 70))
plot1.annotate("assembly", (1400, 110))
    
savefig('/tmp/shortdata-3.pdf')
1-quality 521.0 2-diginorm 1418.0 3-big-assembly 1750.0 5-building-transcript-families 1753.0 6-annotating-transcript-families 2130.0 7-expression-analysis 2784.0

Full process

1-quality 47362.0 2-diginorm 76741.0 3-big-assembly 163662.0 duration: 1 day, 21:27:42
In [318]:
import numpy
longdata = numpy.loadtxt('m1.xlarge-normal/log.out')

f, axarr = triptych(longdata)

plot1 = axarr[0]
plot1.set_xticks([40000,80000,120000,160000])

plot1.set_ylim((0, 130))
plot1.annotate("QC", (20000, 50))
plot1.annotate("diginorm", (49362, 70))
plot1.annotate("assembly", (82001, 100))

plot2 = axarr[1]

for p in axarr:
    collection = collections.BrokenBarHCollection.span_where(
       longdata[:,0], ymin=0, ymax=1e11, where=(longdata[:,0]>=47362) & (longdata[:,0]<76741), facecolor='green', alpha=0.3)
    p.add_collection(collection)

    collection = collections.BrokenBarHCollection.span_where(
       longdata[:,0], ymin=0, ymax=1e11, where=(longdata[:,0]>=76741), facecolor='red', alpha=0.3)
    p.add_collection(collection)


savefig('/tmp/fig5.pdf')
1-quality 47362.0 2-diginorm 76741.0 turtle_1_22.time 0.0 dsk_1_22.time 56.0 1_part1_22.hist 246.0 bloom_1_1_22.hist 1666.0 jelly_1_22.hist 2163.0 duration: 2349.0
In [319]:
import numpy
kmerdata = numpy.loadtxt('kmer-counting/log.out')

f, axarr = triptych(kmerdata)

plot1 = axarr[0]
plot1.set_ylim((0, 130))
plot1.annotate("Turtle", (0, 120))
plot1.annotate("DSK", (56, 110))
plot1.annotate("Tallymer", (246, 80))
plot1.annotate("khmer", (1666, 100))
plot1.annotate("Jellyfish", (2163, 110))

for p in axarr:
    collection = collections.BrokenBarHCollection.span_where(
       kmerdata[:,0], ymin=0, ymax=1e11, where=(kmerdata[:,0]>=0) & (kmerdata[:,0]<56), facecolor='green', alpha=0.3)
    p.add_collection(collection)

    collection = collections.BrokenBarHCollection.span_where(
       kmerdata[:,0], ymin=0, ymax=1e11, where=(kmerdata[:,0]>=246) & (kmerdata[:,0]<1666), facecolor='red', alpha=0.3)
    p.add_collection(collection)

    collection = collections.BrokenBarHCollection.span_where(
       kmerdata[:,0], ymin=0, ymax=1e11, where=(kmerdata[:,0]>=2163), facecolor='blue', alpha=0.3)
    p.add_collection(collection)
    
savefig('/tmp/fig2.pdf')
In [319]: