def center_genes(self, use_median=False, inplace=False):
if use_median:<EOL><INDENT>X = self.X -np.tile(np.median(self.X, axis=<NUM_LIT:1>), (self.n, <NUM_LIT:1>)).T<EOL><DEDENT>else:<EOL><INDENT>X = self.X -np.tile(np.mean(self.X, axis=<NUM_LIT:1>), (self.n, <NUM_LIT:1>)).T<EOL><DEDENT>if inplace:<EOL><INDENT>self.X[:,:] = X<EOL>matrix = self<EOL><DEDENT>else:<EOL><INDENT>matrix = ExpMatrix(genes=self.genes, samples=self.samples,<EOL>X=X)<EOL><DEDENT>return matrix<EOL>
Center the expression of each gene (row).