Skip to main content

A package allows for generation of colored secondary RNA structure images

Project description

Color_RNA

##Beta Version##

This package uses web scraping to generate custom colored images of RNA secondary structures by using forna[1]. Currently supports 5 colors, Red, Blue, Green, Yellow and Pink. Further color support to be added in the future.

How to use: Suitable chromedriver.exe should be downloaded from https://chromedriver.chromium.org/downloads We recommend adding chromedriver.exe to the working path but you can place it elsewhere and supply its path (see instructions below).

  • Internet connection and Chrome browser are required

The function that you are going to use is called "create_image". It's inputs are:

sequence (str): The sequence to be drawn Accepts characters: "A", "a", "T", "t", "G", "g", "C", "c", "U", "u" According to nitrogenous bases.

structure (str): The secondary structure to be drawn Accepts characters: "." - Unbound base "(" - Bound base - must be accompanied by ")" later in the sequence ")" - Bound base - first ")" is bound to first "(", etc. "[", "]" - Pseudoknots connection, works as "(" and ")"

colors_string (str): Position of wanted colors in the image. For images with no colors, supply an empty string. Accepts charcters: "r" - Red "g" - Green "b" - Blue "p" - Pink "y" - yellow " " - White

Optional: image_path (str): The path and image name in which the user wants the image to be saved. Default: "RNA_image.png" If not supplied, the image will be saved in the working path as "RNA_image.png".

Optional: pseudoknots_strength (str): the strength of the pseudoknots. If not supplied, the default is weak pseudoknots. Else, strong pseudoknots will be enabled.

Optional: driver_path (str): The path in which "chromedriver.exe" is present. If not supplied, the function expects chromedriver.exe to be in working path. If the user wants, they can save chromedriver.exe elsewhere and supply the path.

Example of use: After installation and chromedriver download, import package and use function as follows: from color_rna import Color_RNA

In this example, we wish to draw: *sequence - "ATGCCGTA" *structue - "(......)" *colors - positions 1,2 are red, positions 3-6 are yellow and position 6,7 are green *image to be saved at working path with "Example.png" as its name. *pseudoknots bonds are weak (default) *chromedriver.exe is saved on the desktop and not in working path. The code should look like: Color_RNA.create_image("ATGCCGTA", "(......)", "rryyyygg", image_path = "Exapmle.png", driver_path = r"C:\Users\Username\Desktop\chromedriver")

[1] Kerpedjiev P, Hammer S, Hofacker IL (2015). Forna (force-directed RNA): Simple and effective online RNA secondary structure diagrams. Bioinformatics 31(20):3377-9.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

color_rna-0.5.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

color_rna-0.5.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file color_rna-0.5.1.tar.gz.

File metadata

  • Download URL: color_rna-0.5.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.2

File hashes

Hashes for color_rna-0.5.1.tar.gz
Algorithm Hash digest
SHA256 71d55601b1c8d70646ab187aa47e8153ccf1b01ed85e13a59a3a8423adbc258e
MD5 ab94566221cdf36c1c85050f15888118
BLAKE2b-256 5d6ee0f362e4691bf22429281aa53572428eaf8c337aa97ac49ffadb942a41c7

See more details on using hashes here.

File details

Details for the file color_rna-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: color_rna-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.2

File hashes

Hashes for color_rna-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 02fb26ebd8636a5b40b617ecfdd8d36d853374d4b722a0dbbbf959db70989430
MD5 848eeccc955495fb47aa71cc6604b08f
BLAKE2b-256 56a88826d56a131df194efc9f3b1997e62c7b517af8034444338fd8816c62b34

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page