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.

Installation

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

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
                           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
                           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.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

st_oxview-0.1.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: st_oxview-0.1.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for st_oxview-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8ed3ecb9dbea03103455744757ed1a12afa3a5e2277b71331edd57f96006c2a5
MD5 f3268db0b7a36755248aebe06fb53710
BLAKE2b-256 13c394fe211c34c5cc71a1fcaabcda140967d54107614142320fab82b9f98625

See more details on using hashes here.

File details

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

File metadata

  • Download URL: st_oxview-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for st_oxview-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a764cefaf0cb2b728a80820a2fc8b189f694ab5ea1371b9be995ca34a257fe6
MD5 d9c86a4f7b4d43f5c0d65a79ea2406fe
BLAKE2b-256 206307a1a6d47a08f42533cfc042c638fc9b5fd0d85311e957893c3aa4186e4d

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