A minimial python package for drawing nucleic acid secondary structures.
To install rna_draw
python -m pip install git+https://github.com/YesselmanLab/rna_draw.git
(1) Large structures still generate collisions. (2) draw tertiary contacts
There are two ways to call rna_draw. First is the command line exe that was installed with the package There are two ways to call rna_draw. First is the command line exe that was installed with the package
all that is needed is to supply a secondary structure
rna_draw -ss ".(((.....)))."
rd.rna_draw(ss='.(((.....))).')
sequence identity can be supplied through -seq option. Any letter can be supplied.
rna_draw -ss ".(((.....)))." -seq AUGANNNNNUCAA
rd.rna_draw(ss='.(((.....))).', seq='AUGANNNNNUCAA')
can supply a render type to color with a specific style. res_type, colors by residue color.
rna_draw -ss ".(((.....)))." -seq AUGANNNNNUCAA -render_type res_type
rd.rna_draw(ss='.(((.....))).', seq='AUGANNNNNUCAA', render_type='res_type')
there are different types of render types, here is showing "paired", which colors by whether a residue is in a basepair.
rna_draw -ss ".(((.....)))." -seq AUGANNNNNUCAA -render_type paired
rd.rna_draw(ss='.(((.....))).', seq='AUGANNNNNUCAA', render_type='paired')
The user can supply any set of colors as long as they are not overlapping. The format is resnum_min-resnum_max:color. You also do a single resnum in the format resnum:color. In this case we are using single letter codes. The available codes are red (r), greeen (g), blue (b), yellow (y), cyan (c), magenta (m), white (w), gray (e), orange(o)
rna_draw -ss ".(((.....)))." -seq AUGANNNNNUCAA -color_str 1-5:r;6-13:b
rd.rna_draw(ss='.(((.....))).', seq='AUGANNNNNUCAA', color_str='1-5:r;6-13:b')
using the single color codes its one can specify a color string with the same length as the secondary structure. The available codes are red (r), greeen (g), blue (b), yellow (y), cyan (c), magenta (m), white (w), gray (e), orange(o).
rna_draw -ss ".(((.....)))." -color_str rrrrbbbbbgggg
rd.rna_draw(ss='.(((.....))).', color_str='rrrrbbbbbgggg')
if the color string does not cover all residues the default color will be used for the rest. You can change this color.
rna_draw -ss ".(((.....)))." -color_str 1-5:r -default_color y
rd.rna_draw(ss='.(((.....))).', color_str='1-5:r', default_color='y')
colors can be a mixture of single character codes and xkcd colors (https://xkcd.com/color/rgb/)
rna_draw -ss ".(((.....)))." -color_str purple;green;blue;pink;brown;red;fuchsia;hunter green;mustard yellow;eggplant;off white;r;r
rd.rna_draw(ss='.(((.....))).', color_str='purple;green;blue;pink;brown;red;fuchsia;hunter green;mustard yellow;eggplant;off white;r;r')
color_str always overrides render type colors, to allow for more flexibility in coloring.d xkcd colors (https://xkcd.com/color/rgb/). Here we changed the color of residue 5 to 9 which would of been gray but instead is aqua blue.
rna_draw -ss ".(((.....)))." -seq AUGANNNNNUCAA -color_str 5-9:aqua blue -render_type res_type
rd.rna_draw(ss='.(((.....))).', seq='AUGANNNNNUCAA', color_str='5-9:aqua blue', render_type='res_type')
data can be supplied directly using ; to seperate each data point
rna_draw -ss ".(((.....)))." -seq AUGAAAAAAUCAA -data_str 0;1;2;3;4;5;6;7;8;9;10;11;12
rd.rna_draw(ss='.(((.....))).', seq='AUGAAAAAAUCAA', data_str='0;1;2;3;4;5;6;7;8;9;10;11;12')
Specific data can be ignored if its not applicable. For example G and U for DMS chemical mapping.
rna_draw -ss ".(((.....)))." -seq AUGAAAAAAUCAA -data_str 0;1;2;3;4;5;6;7;8;9;10;11;12 -data_ignore_restype GU
rd.rna_draw(ss='.(((.....))).', seq='AUGAAAAAAUCAA', data_str='0;1;2;3;4;5;6;7;8;9;10;11;12', data_ignore_restype='GU')
Can set the min and max value for coloring. Anything below or equal to vmin will be colored as the min value with the palette.
rna_draw -ss ".(((.....)))." -seq AUGAAAAAAUCAA -data_str 0;1;2;3;4;5;6;7;8;9;10;11;12 -data_vmin 3 -data_vmax 9
rd.rna_draw(ss='.(((.....))).', seq='AUGAAAAAAUCAA', data_str='0;1;2;3;4;5;6;7;8;9;10;11;12', data_vmin=3, data_vmax=9)