Пример #1
0
def drawContiguityPlot( options, stats ):
    #options.out = os.path.join(options.outdir, "contiguity_" + stats.refname) #name of output file
    options.out = os.path.join(options.outdir, options.exp + "_" + stats.refname) #name of output file
    
    if options.includeCov:
        options.out = options.out + "_incCov"
        options.ycutoff = 0.7 #HACK
    else:#HACK
        options.ycutoff = 0.95 #HACK
    fig, pdf = libplot.initImage( 8.0, 10.0, options )
    axes = libplot.setAxes( fig )
    
    lines, sampleNames, ymin = drawData( axes, stats, options )
    drawLegend( axes, lines, sampleNames, options )
    if options.ycutoff:
        setAxisLimits( axes, options.ycutoff )
    else:
        setAxisLimits( axes, ymin*0.98 )
    libplot.setTicks( axes )

    libplot.writeImage( fig, pdf, options )
Пример #2
0
def drawSum( fig, runs, analysis, options, refnames ):
    analysisName = analysis.attrib[ 'name' ]

    axesList = []
    if len(refnames) == 1:
        axesList.append( libplot.setAxes(fig) )
    else:
        axesList = setAxes( fig )

    sortField = 'sampleName'
    #fontP = FontProperties()
    #fontP.set_size('xx-small')
    for i in range( len(refnames) ):
        #data, colLabels, rowLabels, refname = getData( options.indir, runs, files[i], sortField )
        #dataFile = os.path.join( options.outdir, 'sumData_' + files[i].strip('.xml') + '_' + sortId)
        #if not os.path.exists( dataFile ):
        #    data, colLabels, rowLabels, refname = getData( options.indir, runs, files[i], sortField )
        #    writeData( dataFile, data, colLabels, rowLabels, refname )
        #else:
        #    data, colLabels, rowLabels, refname = readData( dataFile )
        
        data, colLabels, rowLabels = getData2( runs, analysisName, refnames[i] )
        axes = axesList[i]
        caxes = axes.imshow( data, interpolation= 'nearest' )
        axes.set_title( refnames[i] )
        #axes.set_xticks( range(0, len(colLabels)), colLabels, rotation=45, fontproperties=fontP )
        axes.set_xticks( range(0, len(colLabels)) )
        axes.set_xticklabels(colLabels)
        for label in axes.xaxis.get_ticklabels():
            label.set_rotation( 90 )
            label.set_fontsize(4)
            #label.fontproperties = fontP
        axes.set_yticks( range(len(runs)) )
        if i > 0:
            rowLabels = [ '' for l in rowLabels ]
        axes.set_yticklabels( rowLabels )
        for label in axes.yaxis.get_ticklabels():
            label.set_fontsize(4)