parameters: (poimfilename, poim, max_poim, diff_poim, poim_totalmass, poimdegree, max_len)
docstring: Plot a summary of the information in poims
docstring_summary: Plot a summary of the information in poims
docstring_tokens: Plot a summary of the information in poims
function: def plot_poims(poimfilename, poim, max_poim, diff_poim, poim_totalmass, poimdegree, max_len):
      """Plot a summary of the information in poims"""
      import pylab
      import matplotlib
  
      pylab.figure(3, dpi=150, figsize=(4,5))
  
      # summary figures
      fontdict=dict(family="cursive",weight="bold",size=7,y=1.05) ;
      pylab.subplot(3,2,1)
      pylab.title('Total POIM Mass', fontdict)
      pylab.plot(poim_totalmass) ;
      pylab.ylabel('weight mass', size=5)
  
      pylab.subplot(3,2,3)
      pylab.title('POIMs', fontdict)
      pylab.pcolor(max_poim, shading='flat') ;
  
      pylab.subplot(3,2,5)
      pylab.title('Differential POIMs', fontdict)
      pylab.pcolor(diff_poim, shading='flat') ;
  
      for plot in [3, 5]:
          pylab.subplot(3,2,plot)
          ticks=numpy.arange(1., poimdegree+1, 1, dtype=numpy.float64)
          ticks_str = []
          for i in xrange(0, poimdegree):
              ticks_str.append("%i" % (i+1))
              ticks[i] = i + 0.5
          pylab.yticks(ticks, ticks_str)
          pylab.ylabel('degree', size=5)
  
      # per k-mer figures
      fontdict=dict(family="cursive",weight="bold",size=7,y=1.04) ;
  
      # 1-mers
      pylab.subplot(3,2,2)
      pylab.title('1-mer Positional Importance', fontdict)
      pylab.pcolor(poim[0], shading='flat') ;
      ticks_str = ['A', 'C', 'G', 'T']
      ticks = [0.5, 1.5, 2.5, 3.5]
      pylab.yticks(ticks, ticks_str, size=5)
      pylab.axis([0, max_len, 0, 4])
  
      # 2-mers
      pylab.subplot(3,2,4)
      pylab.title('2-mer Positional Importance', fontdict)
      pylab.pcolor(poim[1], shading='flat') ;
      i=0 ;
      ticks=[] ;
      ticks_str=[] ;
      for l1 in ['A', 'C', 'G', 'T']:
          for l2 in ['A', 'C', 'G', 'T']:
              ticks_str.append(l1+l2)
              ticks.append(0.5+i) ;
              i+=1 ;
      pylab.yticks(ticks, ticks_str, fontsize=5)
      pylab.axis([0, max_len, 0, 16])
  
      # 3-mers
      pylab.subplot(3,2,6)
      pylab.title('3-mer Positional Importance', fontdict)
      pylab.pcolor(poim[2], shading='flat') ;
      i=0 ;
      ticks=[] ;
      ticks_str=[] ;
      for l1 in ['A', 'C', 'G', 'T']:
          for l2 in ['A', 'C', 'G', 'T']:
              for l3 in ['A', 'C', 'G', 'T']:
                  if numpy.mod(i,4)==0:
                      ticks_str.append(l1+l2+l3)
                      ticks.append(0.5+i) ;
                  i+=1 ;
      pylab.yticks(ticks, ticks_str, fontsize=5)
      pylab.axis([0, max_len, 0, 64])
  
      # x-axis on last two figures
      for plot in [5, 6]:
          pylab.subplot(3,2,plot)
          pylab.xlabel('sequence position', size=5)
  
  
      # finishing up
      for plot in xrange(0,6):
          pylab.subplot(3,2,plot+1)
          pylab.xticks(fontsize=5)
  
      for plot in [1,3,5]:
          pylab.subplot(3,2,plot)
          pylab.yticks(fontsize=5)
  
      pylab.subplots_adjust(hspace=0.35) ;
  
      # write to file
      warnings.filterwarnings('ignore','Could not match*')
      pylab.savefig('/tmp/temppylabfig.png')
      shutil.move('/tmp/temppylabfig.png',poimfilename)
function_tokens: def plot_poims ( poimfilename , poim , max_poim , diff_poim , poim_totalmass , poimdegree , max_len ) : import pylab import matplotlib pylab . figure ( 3 , dpi = 150 , figsize = ( 4 , 5 ) ) # summary figures fontdict = dict ( family = "cursive" , weight = "bold" , size = 7 , y = 1.05 ) pylab . subplot ( 3 , 2 , 1 ) pylab . title ( 'Total POIM Mass' , fontdict ) pylab . plot ( poim_totalmass ) pylab . ylabel ( 'weight mass' , size = 5 ) pylab . subplot ( 3 , 2 , 3 ) pylab . title ( 'POIMs' , fontdict ) pylab . pcolor ( max_poim , shading = 'flat' ) pylab . subplot ( 3 , 2 , 5 ) pylab . title ( 'Differential POIMs' , fontdict ) pylab . pcolor ( diff_poim , shading = 'flat' ) for plot in [ 3 , 5 ] : pylab . subplot ( 3 , 2 , plot ) ticks = numpy . arange ( 1. , poimdegree + 1 , 1 , dtype = numpy . float64 ) ticks_str = [ ] for i in xrange ( 0 , poimdegree ) : ticks_str . append ( "%i" % ( i + 1 ) ) ticks [ i ] = i + 0.5 pylab . yticks ( ticks , ticks_str ) pylab . ylabel ( 'degree' , size = 5 ) # per k-mer figures fontdict = dict ( family = "cursive" , weight = "bold" , size = 7 , y = 1.04 ) # 1-mers pylab . subplot ( 3 , 2 , 2 ) pylab . title ( '1-mer Positional Importance' , fontdict ) pylab . pcolor ( poim [ 0 ] , shading = 'flat' ) ticks_str = [ 'A' , 'C' , 'G' , 'T' ] ticks = [ 0.5 , 1.5 , 2.5 , 3.5 ] pylab . yticks ( ticks , ticks_str , size = 5 ) pylab . axis ( [ 0 , max_len , 0 , 4 ] ) # 2-mers pylab . subplot ( 3 , 2 , 4 ) pylab . title ( '2-mer Positional Importance' , fontdict ) pylab . pcolor ( poim [ 1 ] , shading = 'flat' ) i = 0 ticks = [ ] ticks_str = [ ] for l1 in [ 'A' , 'C' , 'G' , 'T' ] : for l2 in [ 'A' , 'C' , 'G' , 'T' ] : ticks_str . append ( l1 + l2 ) ticks . append ( 0.5 + i ) i += 1 pylab . yticks ( ticks , ticks_str , fontsize = 5 ) pylab . axis ( [ 0 , max_len , 0 , 16 ] ) # 3-mers pylab . subplot ( 3 , 2 , 6 ) pylab . title ( '3-mer Positional Importance' , fontdict ) pylab . pcolor ( poim [ 2 ] , shading = 'flat' ) i = 0 ticks = [ ] ticks_str = [ ] for l1 in [ 'A' , 'C' , 'G' , 'T' ] : for l2 in [ 'A' , 'C' , 'G' , 'T' ] : for l3 in [ 'A' , 'C' , 'G' , 'T' ] : if numpy . mod ( i , 4 ) == 0 : ticks_str . append ( l1 + l2 + l3 ) ticks . append ( 0.5 + i ) i += 1 pylab . yticks ( ticks , ticks_str , fontsize = 5 ) pylab . axis ( [ 0 , max_len , 0 , 64 ] ) # x-axis on last two figures for plot in [ 5 , 6 ] : pylab . subplot ( 3 , 2 , plot ) pylab . xlabel ( 'sequence position' , size = 5 ) # finishing up for plot in xrange ( 0 , 6 ) : pylab . subplot ( 3 , 2 , plot + 1 ) pylab . xticks ( fontsize = 5 ) for plot in [ 1 , 3 , 5 ] : pylab . subplot ( 3 , 2 , plot ) pylab . yticks ( fontsize = 5 ) pylab . subplots_adjust ( hspace = 0.35 ) # write to file warnings . filterwarnings ( 'ignore' , 'Could not match*' ) pylab . savefig ( '/tmp/temppylabfig.png' ) shutil . move ( '/tmp/temppylabfig.png' , poimfilename )