def regress_genes(self, PCs):
ind = [PCs]<EOL>ind = np.array(ind).flatten()<EOL>try:<EOL><INDENT>y = self.adata.X.toarray() - self.regression_pcs[:, ind].dot(<EOL>self.regression_pca.components_[ind, :] * self.adata.var[<EOL>'<STR_LIT>'].values)<EOL><DEDENT>except BaseException:<EOL><INDENT>y = self.adata.X.toarray() - self.regression_pcs[:, ind].dot(<EOL>self.regression_pca.components_[ind, :])<EOL><DEDENT>self.adata.X = sp.csr_matrix(y)<EOL>
Regress out the principal components in 'PCs' from the filtered
        expression data ('SAM.D'). Assumes 'calculate_regression_PCs' has
        been previously called.

        Parameters
        ----------
        PCs - int, numpy.array, list
            The principal components to regress out of the expression data.