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

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 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.2.8.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

color_rna-0.2.8-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: color_rna-0.2.8.tar.gz
  • Upload date:
  • Size: 24.4 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.2.8.tar.gz
Algorithm Hash digest
SHA256 64d8f448e0144e9a46b057e8b929a321a94aedf122b4292fdbeb79019cbb6c99
MD5 243fe1f6bdcfcb72f011748a5d311543
BLAKE2b-256 317e9610e52f934ebb0e9491a3cc175ff9cff83504e6dd8d94129692f588a59e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: color_rna-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a5ba26693649e4997b5c796f40551255c97d44d74a4c077dfe2048732fb6b702
MD5 e00807e4ec4c46877137359538c1b8f4
BLAKE2b-256 f5747cca65c3600c4e8cd51e31a6c5914818131dbb80252dad2d9d4f271c5a72

See more details on using hashes here.

Supported by

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