@@ -420,6 +420,12 @@ def plotpuppy():
420420 parser .add_argument ('--row_names' , type = str ,
421421 required = False ,
422422 help = """A comma separated list of row names""" )
423+ parser .add_argument ("--enrichment" , type = int ,
424+ required = False , default = 1 ,
425+ help = """Whether to show the level of enrichment in the
426+ central pixels. 0 to not show, odd positive number to
427+ define the size of the central square which values are
428+ averaged.""" )
423429# parser.add_argument("--n_rows", type=int, default=0,
424430# required=False,
425431# help="""How many rows to use for plotting the data""")
@@ -461,6 +467,10 @@ def plotpuppy():
461467 raise ValueError ("""Number of row names is not equal to number of
462468 rows!""" )
463469
470+ if args .enrichment % 2 == 0 and args .enrichment > 0 :
471+ raise ValueError ("""Side of the square to calculate enrichment has
472+ to be an odd number""" )
473+
464474 f , axarr = plt .subplots (n_rows , n_cols , sharex = True , sharey = True ,# similar to subplot(111)
465475 figsize = (max (3.5 , n_cols + 0.5 ), max (3 , n_rows )),
466476 dpi = 300 , squeeze = False ,
@@ -485,6 +495,11 @@ def plotpuppy():
485495 cmap = args .cmap )
486496 ax .set_xticks ([])
487497 ax .set_yticks ([])
498+ if args .enrichment > 0 :
499+ enr = get_enrichment (pups [n ], args .enrichment , 2 )
500+ ax .text (s = enr , y = 0.95 , x = 0.05 , ha = 'left' , va = 'top' ,
501+ size = 'x-small' ,
502+ transform = ax .transAxes )
488503 else :
489504 axarr [i , j ].axis ('off' )
490505
0 commit comments