KarrLab / bpforms

Toolkit for concretely describing non-canonical DNA, RNA, and proteins
https://www.bpforms.org
MIT License
6 stars 2 forks source link

Can `bpforms` visualize the svg strings from biopolymers? #111

Closed paulflang closed 4 years ago

paulflang commented 4 years ago

I do not find an example for visualization in the docs or Jupyter notebook, so I've been doing

from IPython.display import SVG, display
dna_form = bpforms.DnaForm().from_str('ACGT')
image = dna_form.get_image()
display(SVG(image))

in the notebook or just saved the SVG string to a file and viewed it in my browser. Is there a better way of doing this?

jonrkarr commented 4 years ago

SVG is one of the most common formats for images. SVG files can be viewed by all modern web browsers.

  1. Save SVG to file.
  2. Open file in web browser.

SVG images can also be viewed inside Jupyter notebooks as Paul illustrated above.