Skip to main content

A Streamlit component for coarse-grained DNA/RNA visualization with OxView

Project description

Streamlit Oxview Component

A Streamlit component for the display of coarse-grained DNA/RNA 3D models. It is a wrapper around the oxdna-viewer. The colormap is always disabled.

Installation

This component requires access to write files to the temporary directory.

pip install st_oxview

Example

Alt Text

Look at the example for a streamlit Web App:

Streamlit App

Usage

Display with drag and drop

You can make a empty oxview fram and drag and drop the files to the frame.

import streamlit as st
from st_oxview import oxview_from_text

success = oxview_from_file()

Just drag and drop the files to the frame.

Display from file paths

import streamlit as st
from st_oxview import oxview_from_file

success = oxview_from_file(configuration=path_to_conf, # path to the configuration file
                           topology=path_to_topo,      # path to the topology file
                           forces=None,                # path to the forces file
                           pdb=None,                   # path to the pdb file
                           js_script=None,             # path to the javascript script file
                           colormap=None,              # name of the Matplotlib colormap
                           index_colors=None,          # A color for each index according to the colormap (list of values between 0 and 1)
                           frame_id=None,                 # ID of the oxView frame: if a frame ID is set, it will be reused instead of creating a new frame
                           width='99%',                # width of the viewer frame
                           height='500',               # height of the viewer frame
                           key=None)                   # streamlit component key

Display from text

import streamlit as st
from st_oxview import oxview_from_text

with open("configuration.dat", "r") as f:
    conf_text = f.read()

with open("topology.top", "r") as f:
    topo_text = f.read()

success = oxview_from_file(configuration=conf_text, # text of the configuration file
                           topology=topo_text,      # text of the topology file
                           forces=None,             # text of the forces file
                           pdb=None,                # text of the pdb file
                           js_script=None,          # text of the javascript script file
                           colormap=None,           # name of the Matplotlib colormap
                           index_colors=None,       # A color for each index according to the colormap (list of values between 0 and 1)
                           width='99%',             # width of the viewer frame
                           height='500',            # height of the viewer frame
                           key=None)                # streamlit component key


The functions return a boolean value indicating if the program was able to write and read the files.

How to cite:

Please include this citation if the OxView Component is used in an academic study:

Lucandia. Lucandia/st_oxview; Zenodo, 2024. https://zenodo.org/doi/10.5281/zenodo.12515559.

DOI

License

Code is licensed under the GNU General Public License v3.0 (GPL-3.0)

License: GPL-3.0

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

st_oxview-0.1.8.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

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

st_oxview-0.1.8-py3-none-any.whl (3.9 MB view details)

Uploaded Python 3

File details

Details for the file st_oxview-0.1.8.tar.gz.

File metadata

  • Download URL: st_oxview-0.1.8.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for st_oxview-0.1.8.tar.gz
Algorithm Hash digest
SHA256 92c4fcffb90df8acf16c51fd61e5a924e9ec0cc44ac3dfe41a0d3611ee2861b1
MD5 fbd6bcd4c3eb4299920b06931d87b01e
BLAKE2b-256 14daa53c0c6bc91b072c0bbb166a1b5085b4969d93100b516ff6741ed1a6bd55

See more details on using hashes here.

File details

Details for the file st_oxview-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: st_oxview-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for st_oxview-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7668d569ae3da0441685e4feb4c483f5da8776e01270730969cbdd1ae2f4d838
MD5 4373c544e748f1d5a2f7699bc72b7986
BLAKE2b-256 079a6e7c8306998ba440b239f61ae6fb4096112b4d7f244f2820f0d0f03e2f6d

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