<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plot_correlated_groups(self, group=None, n_genes=5, **kwargs):
 """Plots orthogonal expression patterns. In the default mode, plots orthogonal gene expression patterns. A specific correlated group of genes can be specified to plot gene expression patterns within that group. Parameters group - int, optional, default None If specified, display the genes within the desired correlated group. Otherwise, display the top ranked gene within each distinct correlated group. n_genes - int, optional, default 5 The number of top ranked genes to display within a correlated group if 'group' is specified. **kwargs - All keyword arguments in 'show_gene_expression' and 'scatter' are eligible. """

        geneID_groups = self.adata.uns['gene_groups']
        if(group is None):
            for i in range(len(geneID_groups)):
                self.show_gene_expression(geneID_groups[i][0], **kwargs)
        else:
            for i in range(n_genes):
                self.show_gene_expression(geneID_groups[group][i], **kwargs)