def plot_profile(ribo_counts, transcript_name, transcript_length,<EOL>start_stops, read_lengths=None, read_offsets=None, rna_counts=None,<EOL>color_scheme='<STR_LIT:default>', html_file='<STR_LIT>', output_path='<STR_LIT>'):
colors = get_color_palette(scheme=color_scheme)<EOL>gs = gridspec.GridSpec(<NUM_LIT:3>, <NUM_LIT:1>, height_ratios=[<NUM_LIT:6>, <NUM_LIT>, <NUM_LIT:0.5>], hspace=<NUM_LIT>)<EOL>font_axis = {'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': colors['<STR_LIT>'], '<STR_LIT>': '<STR_LIT>', '<STR_LIT:size>': <NUM_LIT:7>}<EOL>gs2 = gridspec.GridSpecFromSubplotSpec(<NUM_LIT:1>, <NUM_LIT:1>, subplot_spec=gs[<NUM_LIT:0>])<EOL>ax2 = plt.subplot(gs2[<NUM_LIT:0>])<EOL>label = '<STR_LIT>'<EOL>if read_lengths:<EOL><INDENT>if len(read_lengths) > <NUM_LIT:1>:<EOL><INDENT>label = '<STR_LIT>'.format('<STR_LIT:U+002CU+0020>'.join('<STR_LIT:{}>'.format(item) for item in read_lengths))<EOL><DEDENT>else:<EOL><INDENT>label = '<STR_LIT>'.format('<STR_LIT:{}>'.format(read_lengths[<NUM_LIT:0>]))<EOL><DEDENT><DEDENT>ax2.set_ylabel(label, fontdict=font_axis, labelpad=<NUM_LIT:10>)<EOL>ax_rna = None<EOL>if rna_counts:<EOL><INDENT>ax_rna = ax2.twinx()<EOL>ax_rna.set_ylabel('<STR_LIT>', fontdict=font_axis, labelpad=<NUM_LIT:10>)<EOL>ax_rna.bar(rna_counts.keys(), rna_counts.values(), facecolor=colors['<STR_LIT>'],<EOL>edgecolor=colors['<STR_LIT>'], label='<STR_LIT>')<EOL>ax_rna.set_zorder(<NUM_LIT:1>)<EOL><DEDENT>frame_counts = {<NUM_LIT:1>: {}, <NUM_LIT:2>: {}, <NUM_LIT:3>: {}}<EOL>for k, v in ribo_counts.iteritems():<EOL><INDENT>for fr in (<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>):<EOL><INDENT>if v[fr] > <NUM_LIT:0>:<EOL><INDENT>frame_counts[fr][k] = v[fr]<EOL>break<EOL><DEDENT><DEDENT><DEDENT>cnts = []<EOL>[cnts.extend(item.values()) for item in frame_counts.values()]<EOL>y_max = float(max(cnts) * <NUM_LIT>)<EOL>ax2.set_ylim(<NUM_LIT:0.0>, y_max)<EOL>ax2.set_zorder(<NUM_LIT:2>)<EOL>ax2.patch.set_facecolor('<STR_LIT:none>')<EOL>for frame in (<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>):<EOL><INDENT>color = colors['<STR_LIT>'][frame - <NUM_LIT:1>]<EOL>x_vals = frame_counts[frame].keys()<EOL>ax2.bar(x_vals, frame_counts[frame].values(), color=color, facecolor=color, edgecolor=color)<EOL><DEDENT>gs3 = gridspec.GridSpecFromSubplotSpec(<NUM_LIT:3>, <NUM_LIT:1>, subplot_spec=gs[<NUM_LIT:1>], hspace=<NUM_LIT:0.1>)<EOL>if color_scheme == '<STR_LIT>':<EOL><INDENT>axisbg = [colors['<STR_LIT>'] for i in range(<NUM_LIT:3>)]<EOL><DEDENT>else:<EOL><INDENT>axisbg = colors['<STR_LIT>']<EOL><DEDENT>ax4 = plt.subplot(gs3[<NUM_LIT:0>], sharex=ax2, axisbg=axisbg[<NUM_LIT:0>])<EOL>ax5 = plt.subplot(gs3[<NUM_LIT:1>], sharex=ax2, axisbg=axisbg[<NUM_LIT:1>])<EOL>ax6 = plt.subplot(gs3[<NUM_LIT:2>], sharex=ax2, axisbg=axisbg[<NUM_LIT:2>])<EOL>ax6.set_xlabel('<STR_LIT>'.format(transcript_length), fontdict=font_axis, labelpad=<NUM_LIT:6>)<EOL>gs4 = gridspec.GridSpecFromSubplotSpec(<NUM_LIT:1>, <NUM_LIT:1>, subplot_spec=gs[<NUM_LIT:2>], hspace=<NUM_LIT:0.1>)<EOL>ax7 = plt.subplot(gs4[<NUM_LIT:0>], axisbg=colors['<STR_LIT>'])<EOL>set_axis_color(ax7, colors['<STR_LIT>'])<EOL>ax7.text(<NUM_LIT>, <NUM_LIT:0.1>, "<STR_LIT>", size=<NUM_LIT:5>, ha="<STR_LIT>", va="<STR_LIT>", color=colors['<STR_LIT>'],<EOL>bbox=dict(boxstyle="<STR_LIT>", facecolor=colors['<STR_LIT:start>'], edgecolor=colors['<STR_LIT>'], linewidth=<NUM_LIT>))<EOL>ax7.text(<NUM_LIT>, <NUM_LIT:0.1>, "<STR_LIT>", size=<NUM_LIT:5>, ha="<STR_LIT>", va="<STR_LIT>", color='<STR_LIT>',<EOL>bbox=dict(boxstyle="<STR_LIT>", color=colors['<STR_LIT>']))<EOL>ax7.text(<NUM_LIT>, <NUM_LIT:0.1>, "<STR_LIT>", size=<NUM_LIT:5>, ha='<STR_LIT>', va='<STR_LIT>', color=colors['<STR_LIT>'],<EOL>fontdict={'<STR_LIT>': '<STR_LIT>'})<EOL>ax7.text(<NUM_LIT>, <NUM_LIT:0.1>, "<STR_LIT:1>", size=<NUM_LIT:5>, ha="<STR_LIT>", va="<STR_LIT>", color='<STR_LIT>',<EOL>bbox=dict(boxstyle="<STR_LIT>", color=colors['<STR_LIT>'][<NUM_LIT:0>]))<EOL>ax7.text(<NUM_LIT>, <NUM_LIT:0.1>, "<STR_LIT:2>", size=<NUM_LIT:5>, ha="<STR_LIT>", va="<STR_LIT>", color='<STR_LIT>',<EOL>bbox=dict(boxstyle="<STR_LIT>", color=colors['<STR_LIT>'][<NUM_LIT:1>]))<EOL>ax7.text(<NUM_LIT>, <NUM_LIT:0.1>, "<STR_LIT:3>", size=<NUM_LIT:5>, ha="<STR_LIT>", va="<STR_LIT>", color='<STR_LIT>',<EOL>bbox=dict(boxstyle="<STR_LIT>", color=colors['<STR_LIT>'][<NUM_LIT:2>]))<EOL>for axis in (ax4, ax5, ax7):<EOL><INDENT>axis.tick_params(top=False, left=False, right=False, bottom=False, labeltop=False,<EOL>labelleft=False, labelright=False, labelbottom=False)<EOL><DEDENT>axes = [ax2]<EOL>if ax_rna:<EOL><INDENT>axes.append(ax_rna)<EOL><DEDENT>fp = FontProperties(size='<STR_LIT:5>')<EOL>for axis in axes:<EOL><INDENT>set_axis_color(axis, colors['<STR_LIT>'])<EOL>axis.tick_params(colors=colors['<STR_LIT>'])<EOL>for item in (axis.get_xticklabels() + axis.get_yticklabels()):<EOL><INDENT>item.set_fontproperties(fp)<EOL>item.set_color(colors['<STR_LIT>'])<EOL><DEDENT><DEDENT>for axis, frame in ((ax4, <NUM_LIT:1>), (ax5, <NUM_LIT:2>), (ax6, <NUM_LIT:3>)):<EOL><INDENT>if color_scheme == '<STR_LIT>':<EOL><INDENT>color = colors['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>color = colors['<STR_LIT>'][frame - <NUM_LIT:1>]<EOL><DEDENT>set_axis_color(axis, color, alpha=<NUM_LIT>)<EOL>axis.patch.set_alpha(<NUM_LIT>)  <EOL>for item in (axis.get_xticklabels()):<EOL><INDENT>item.set_fontproperties(fp)<EOL>item.set_color(colors['<STR_LIT>'])<EOL><DEDENT>axis.set_ylim(<NUM_LIT:0>, <NUM_LIT>)<EOL>axis.set_xlim(<NUM_LIT:0>, transcript_length)<EOL>starts = [(item, <NUM_LIT:1>) for item in start_stops[frame]['<STR_LIT>']]<EOL>stops = [(item, <NUM_LIT:1>) for item in start_stops[frame]['<STR_LIT>']]<EOL>start_colors = [colors['<STR_LIT:start>'] for item in starts]<EOL>axis.broken_barh(starts, (<NUM_LIT>, <NUM_LIT>), facecolors=start_colors,<EOL>edgecolors=start_colors, label='<STR_LIT:start>', zorder=<NUM_LIT:5>)<EOL>stop_colors = [colors['<STR_LIT>'] for item in stops]<EOL>axis.broken_barh(stops, (<NUM_LIT:0>, <NUM_LIT>), facecolors=stop_colors,<EOL>edgecolors=stop_colors, label='<STR_LIT>', zorder=<NUM_LIT:5>)<EOL>axis.set_ylabel('<STR_LIT:{}>'.format(frame),<EOL>fontdict={'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': colors['<STR_LIT>'],<EOL>'<STR_LIT>': '<STR_LIT>', '<STR_LIT:size>': '<STR_LIT>'},<EOL>rotation='<STR_LIT>', labelpad=<NUM_LIT:10>, verticalalignment='<STR_LIT>')<EOL>axis.tick_params(top=False, left=False, right=False, labeltop=False,<EOL>labelleft=False, labelright=False, direction='<STR_LIT>', colors=colors['<STR_LIT>'])<EOL><DEDENT>plt.title('<STR_LIT:{}>'.format(transcript_name),<EOL>fontdict={'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': colors['<STR_LIT>'],<EOL>'<STR_LIT>': '<STR_LIT>', '<STR_LIT:size>': <NUM_LIT:8>, '<STR_LIT:y>': <NUM_LIT:20>})<EOL>if not os.path.exists(output_path):<EOL><INDENT>os.mkdir(output_path)<EOL><DEDENT>plt.savefig(os.path.join(output_path, '<STR_LIT>'), facecolor=colors['<STR_LIT>'])<EOL>plt.savefig(os.path.join(output_path, '<STR_LIT>'), dpi=<NUM_LIT>, facecolor=colors['<STR_LIT>'])<EOL>with open(os.path.join(CONFIG.PKG_DATA_DIR, '<STR_LIT>')) as g, open(os.path.join(output_path, html_file), '<STR_LIT:w>') as h:<EOL><INDENT>h.write(g.read().format(transcript_name=transcript_name))<EOL><DEDENT>css_dir = os.path.join(output_path, '<STR_LIT>')<EOL>if not os.path.exists(css_dir):<EOL><INDENT>os.mkdir(css_dir)<EOL><DEDENT>css_data_dir = os.path.join(CONFIG.PKG_DATA_DIR, '<STR_LIT>')<EOL>for fname in os.listdir(css_data_dir):<EOL><INDENT>shutil.copy(os.path.join(css_data_dir, fname), os.path.join(output_path, '<STR_LIT>', fname))<EOL><DEDENT>
Plot read counts (in all 3 frames) and RNA coverage if provided for a
    single transcript.