def show_gene_expression(self, gene, avg=True, axes=None, **kwargs):
all_gene_names = np.array(list(self.adata.var_names))<EOL>cell_names = np.array(list(self.adata.obs_names))<EOL>all_cell_names = np.array(list(self.adata_raw.obs_names))<EOL>idx = np.where(all_gene_names == gene)[<NUM_LIT:0>]<EOL>name = gene<EOL>if(idx.size == <NUM_LIT:0>):<EOL><INDENT>print(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>return<EOL><DEDENT>if(avg):<EOL><INDENT>a = self.adata.layers['<STR_LIT>'][:, idx].toarray().flatten()<EOL>if a.sum() == <NUM_LIT:0>:<EOL><INDENT>a = np.log2(self.adata_raw.X[np.in1d(<EOL>all_cell_names, cell_names), :][:,<EOL>idx].toarray().flatten() + <NUM_LIT:1>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>a = np.log2(self.adata_raw.X[np.in1d(<EOL>all_cell_names, cell_names), :][:,<EOL>idx].toarray().flatten() + <NUM_LIT:1>)<EOL><DEDENT>if axes is None:<EOL><INDENT>plt.figure()<EOL>axes = plt.gca()<EOL><DEDENT>self.scatter(c=a, axes=axes, **kwargs)<EOL>axes.set_title(name)<EOL>
Display a gene's expressions.

        Displays a scatter plot using the SAM projection or another input
        projection with a particular gene's expressions overlaid.

        Parameters
        ----------
        gene - string
            a case-sensitive string indicating the gene expression pattern
            to display.

        avg - bool, optional, default True
            If True, the plots use the k-nearest-neighbor-averaged expression
            values to smooth out noisy expression patterns and improves
            visualization.

        axes - matplotlib axis, optional, default None
            Plot output to the specified, existing axes. If None, create new
            figure window.

        **kwargs - all keyword arguments in 'SAM.scatter' are eligible.