Skip to content

YesselmanLab/rna_draw

Repository files navigation

rna_draw

Build Status Code style: black]

A minimial python package for drawing nucleic acid secondary structures.

Install

To install rna_draw

python -m pip install git+https://github.com/YesselmanLab/rna_draw.git

TODO

(1) Large structures still generate collisions. (2) draw tertiary contacts

Usage

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

How to:

basic usage

just secondary structure

all that is needed is to supply a secondary structure

rna_draw -ss ".(((.....)))."
rd.rna_draw(ss='.(((.....))).')

supplying a sequence

sequence identity can be supplied through -seq option. Any letter can be supplied.

rna_draw -ss ".(((.....)))." -seq AUGANNNNNUCAA
rd.rna_draw(ss='.(((.....))).', seq='AUGANNNNNUCAA')

adding render type

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')

second render type example

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')

supplying custom colors

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')

coloring examples

using single color codes

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')

changing default color

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')

using xkcd colors

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')

overwriting render type colors

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')

using experimental data

basic coloring with data

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')

ignoring data by restype

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')

setting min and max values

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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages