Skip to main content

secstructartist

This package allows to include pretty secondary structure schemes in matplotlib plots.

example_rmsf.png

Table of content

Installation

Prerequisites

  • General prerequisites:
    • Python 3.8 or higher
    • pip
  • Third-party python packages:
    • matplotlib
    • numpy

Installation from PyPI

This is the recommended way to install the package.

  1. Create a virtual environment (optional but recommended):

    python3 -m venv secstructartist
    source secstructartist/bin/activate
    
  2. Install python module

    pip install secstructartist
    

Installation from GitHub

Here, you will download the repository, and manually build and install the package.

  1. Create a virtual environment (optional but recommended):

    python3 -m venv secstructartist
    source secstructartist/bin/activate
    
  2. Clone the repository:

    git clone https://github.com/bickeld/secstructartist.git
    cd secstructartist
    
  3. Build package and install

    make build
    make install
    

Usage

In the examples/ directory there is a Jupyter notebook (link) with plenty of code examples for simple and advanced use cases. Therefore, only the basics usage will be shown here.

A simple example

The simplest possible use case:

import matplotlib.pyplot as plt
import secstructartist as ssa

secstruct_str = "LLLSSSSSLLLLLHHHHHHHHLLLHHHHHHHHLLLLLLLLLSSSSSSLLLL"
fig, _objs = ssa.draw(secstruct_str)
fig.savefig("example0.png")

example0.png

Customizing your plots

Plots can be modified by initializing a custom SecStructArtist.

import matplotlib.pyplot as plt
import secstructartist as ssa

secstruct_str = "LLLSSSSSLLLLLHHHHHHHHLLLHHHHHHHHLLLLLLLLLSSSSSSLLLL"
nres = len(secstruct_str)

# Initialize a custom SecStructArtist istance to modify settings 
artist = ssa.SecStructArtist()
# Set global settings
artist.height = .7
artist.linewidth = .8
# Set settings of "H" - Helices
artist["H"].fillcolor = (.9, 0., 0.)
artist["H"].shadecolor = (.7, 0., 0.)
artist["H"].ribbon_period = 3.6
artist["H"].ribbon_width = 2.2
# Set settings of "S" - beta-Sheets
artist["S"].arrow_length = 2.7
artist["S"].fillcolor = "#ddcc00"
artist["S"].height = .5
# Set settings of "L" - loop
artist["L"].linecolor = "blue"
artist["L"].linewidth = 1.8

# Generate figure and axis
fig, ax = plt.subplots(figsize=(4,.4), dpi=150)

# Include secondary structure scheme above the plot
artist.draw(secstruct_str, xpos=list(range(3, 3+nres)), ypos=3.5, ax=ax)

ax.set_xlabel("Residue index")
ax.set_ylim([3, 4])

fig.savefig("example1.png")

example1.png

License

Distributed under the GNU General Public License v3 (GPLv3) License.

Contributing

If you find a bug, please open a bug report. If you have an idea for an improvement or new feature, please open a feature request.

Authors

ORCHiD - David Bickel

Metadata

Release files for secstructartist 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for secstructartist 1.1.3
File Size Uploaded
secstructartist-1.1.3.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for secstructartist 1.1.3
File Interpreter ABI Platform
secstructartist-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 24.5 kB

Release files / secstructartist-1.1.3.tar.gz

Download URL secstructartist-1.1.3.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1c3e804818d9c63d2468442610c77c7e96dce689f5960839e9fdfe1a403a045b
BLAKE2b-256 checksum
How to use checksums
a02dde19a350ecac66755043e40c47196d8bf5e99e27b87bc57e7fdd4d092a7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / secstructartist-1.1.3-py3-none-any.whl

Download URL secstructartist-1.1.3-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c719f998b4d140bae8d01f5d88f14c64b42febd73213461e292340258e7686b
BLAKE2b-256 checksum
How to use checksums
104357360a618eadd3f62f241e72330a03669b2531326e2fb8095b2d76ebf4a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page