#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') # In[2]: from pytexshade import ipyshade from plotnine import ggplot,geom_rect, geom_point, aes, stat_smooth,geom_bar, xlim, ylim, facet_wrap, theme_bw,theme_xkcd, geom_line, geom_tile from plotnine import scale_y_continuous,scale_x_continuous, theme_bw,theme_classic, theme_dark, theme_light, theme_matplotlib, theme_minimal, theme_seaborn, theme_void import plotnine as pn from plotnine.data import mtcars import pandas as pd import numpy as np from seqplot import p9tools from seqplot.p9tools import geom_seq_x # In[3]: from seqplot.pdb_plot import plot_prof4pdb # In[5]: get_ipython().run_cell_magic('time', '', "import warnings\nwarnings.filterwarnings('ignore')\nplot_prof4pdb(quick=False)\n") # In[ ]: # In[ ]: # ## Simple example with description # In[54]: shaded=ipyshade.shadepdbquick(pdb_chain_id='1KX5_A',feature_types=['SecStr'],force_feature_pos='bottom',ruler='bottom',legend=False,show_seq_names=False,show_seq_length=False) # In[55]: shaded # In[56]: df=pd.DataFrame({'x':np.arange(1,136),'value':np.abs(np.sin(np.arange(1,136)/10.))}) # In[57]: g=(ggplot(data=df,mapping=aes(x='x', y='value')) + geom_point(size=0.1)+geom_bar(stat='identity') + scale_x_continuous(limits=(0.5,135.5),expand=(0,0),name='',breaks=[]) + scale_y_continuous(breaks=[0,0.5,1.0]) + theme_light()+pn.theme(aspect_ratio=0.15,dpi=300,plot_margin=0)) g # In[58]: gseq = g + geom_seq_x(seqimg=shaded.img,x=df.x,y=df.value,aspect_ratio=0.15) gseq # In[59]: gseq.save('plot.png') # In[ ]: