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

## Table of content
* [Installation](#installation)
* [Prerequisites](#prerequisites)
* [Installation from PyPI](#installation-from-pypi)
* [Installation from GitHub](#installation-from-github)
* [Usage](#usage)
* [A simple example](#a-simple-example)
* [Customizing your plots](#customizing-your-plots)
* [License](#license)
* [Contributing](#contributing)
* [Authors](#authors)
## 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](https://github.com/bickeld/secstructartist/blob/main/examples/examples.ipynb))
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:
```python
import matplotlib.pyplot as plt
import secstructartist as ssa
secstruct_str = "LLLSSSSSLLLLLHHHHHHHHLLLHHHHHHHHLLLLLLLLLSSSSSSLLLL"
fig, _objs = ssa.draw(secstruct_str)
fig.savefig("example0.png")
```

### Customizing your plots
Plots can be modified by initializing a custom `SecStructArtist`.
```python
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")
```

## License
Distributed under the GNU General Public License v3 (GPLv3) License.
## Contributing
If you find a bug, please open a [bug report](https://github.com/bickeld/secstructartist/issues/new?labels=bug).
If you have an idea for an improvement or new feature, please open a [feature request](https://github.com/bickeld/secstructartist/issues/new?labels=enhancement).
## Authors
[](https://orcid.org/0000-0003-0332-8338) - David Bickel
Raw data
{
"_id": null,
"home_page": "https://github.com/bickeld/secstructartist",
"name": "secstructartist",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "David Bickel",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/a0/2d/de19a350ecac66755043e40c47196d8bf5e99e27b87bc57e7fdd4d092a7b/secstructartist-1.1.3.tar.gz",
"platform": null,
"description": "# secstructartist\n\nThis package allows to include pretty secondary structure schemes in \nmatplotlib plots.\n\n\n\n## Table of content\n\n* [Installation](#installation)\n * [Prerequisites](#prerequisites)\n * [Installation from PyPI](#installation-from-pypi)\n * [Installation from GitHub](#installation-from-github)\n* [Usage](#usage)\n * [A simple example](#a-simple-example)\n * [Customizing your plots](#customizing-your-plots)\n* [License](#license)\n* [Contributing](#contributing)\n* [Authors](#authors)\n\n## Installation\n\n### Prerequisites\n\n* **General prerequisites:**\n * Python 3.8 or higher\n * pip\n* **Third-party python packages:**\n * matplotlib\n * numpy\n\n### Installation from PyPI\n\nThis is the recommended way to install the package.\n\n1. Create a virtual environment (optional but recommended):\n ```\n python3 -m venv secstructartist\n source secstructartist/bin/activate\n ```\n\n2. Install python module\n ```\n pip install secstructartist\n ```\n\n### Installation from GitHub\n\nHere, you will download the repository, and manually build and install the\npackage.\n\n1. Create a virtual environment (optional but recommended):\n ```\n python3 -m venv secstructartist\n source secstructartist/bin/activate\n ```\n\n2. Clone the repository:\n ```\n git clone https://github.com/bickeld/secstructartist.git\n cd secstructartist\n ```\n\n3. Build package and install\n ```\n make build\n make install\n ```\n\n## Usage\n\nIn the `examples/` directory there is a Jupyter notebook ([link](https://github.com/bickeld/secstructartist/blob/main/examples/examples.ipynb))\nwith plenty of code examples for simple and advanced use cases. Therefore, only \nthe basics usage will be shown here.\n\n### A simple example\n\nThe simplest possible use case:\n\n```python\nimport matplotlib.pyplot as plt\nimport secstructartist as ssa\n\nsecstruct_str = \"LLLSSSSSLLLLLHHHHHHHHLLLHHHHHHHHLLLLLLLLLSSSSSSLLLL\"\nfig, _objs = ssa.draw(secstruct_str)\nfig.savefig(\"example0.png\")\n```\n\n\n\n### Customizing your plots\n\nPlots can be modified by initializing a custom `SecStructArtist`.\n\n```python\nimport matplotlib.pyplot as plt\nimport secstructartist as ssa\n\nsecstruct_str = \"LLLSSSSSLLLLLHHHHHHHHLLLHHHHHHHHLLLLLLLLLSSSSSSLLLL\"\nnres = len(secstruct_str)\n\n# Initialize a custom SecStructArtist istance to modify settings \nartist = ssa.SecStructArtist()\n# Set global settings\nartist.height = .7\nartist.linewidth = .8\n# Set settings of \"H\" - Helices\nartist[\"H\"].fillcolor = (.9, 0., 0.)\nartist[\"H\"].shadecolor = (.7, 0., 0.)\nartist[\"H\"].ribbon_period = 3.6\nartist[\"H\"].ribbon_width = 2.2\n# Set settings of \"S\" - beta-Sheets\nartist[\"S\"].arrow_length = 2.7\nartist[\"S\"].fillcolor = \"#ddcc00\"\nartist[\"S\"].height = .5\n# Set settings of \"L\" - loop\nartist[\"L\"].linecolor = \"blue\"\nartist[\"L\"].linewidth = 1.8\n\n# Generate figure and axis\nfig, ax = plt.subplots(figsize=(4,.4), dpi=150)\n\n# Include secondary structure scheme above the plot\nartist.draw(secstruct_str, xpos=list(range(3, 3+nres)), ypos=3.5, ax=ax)\n\nax.set_xlabel(\"Residue index\")\nax.set_ylim([3, 4])\n\nfig.savefig(\"example1.png\")\n```\n\n\n\n## License\n\nDistributed under the GNU General Public License v3 (GPLv3) License.\n\n## Contributing\n\nIf you find a bug, please open a [bug report](https://github.com/bickeld/secstructartist/issues/new?labels=bug).\nIf you have an idea for an improvement or new feature, please open a [feature request](https://github.com/bickeld/secstructartist/issues/new?labels=enhancement).\n\n## Authors\n\n[](https://orcid.org/0000-0003-0332-8338) - David Bickel\n",
"bugtrack_url": null,
"license": "OSI Approved :: GNU General Public License v3 (GPLv3)",
"summary": "Module to visualize protein secondary structure in matplotlib",
"version": "1.1.3",
"project_urls": {
"Homepage": "https://github.com/bickeld/secstructartist"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "104357360a618eadd3f62f241e72330a03669b2531326e2fb8095b2d76ebf4a0",
"md5": "15ff8431d0ae28728dcb0c964566c191",
"sha256": "3c719f998b4d140bae8d01f5d88f14c64b42febd73213461e292340258e7686b"
},
"downloads": -1,
"filename": "secstructartist-1.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "15ff8431d0ae28728dcb0c964566c191",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 13727,
"upload_time": "2023-09-19T12:50:52",
"upload_time_iso_8601": "2023-09-19T12:50:52.958131Z",
"url": "https://files.pythonhosted.org/packages/10/43/57360a618eadd3f62f241e72330a03669b2531326e2fb8095b2d76ebf4a0/secstructartist-1.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a02dde19a350ecac66755043e40c47196d8bf5e99e27b87bc57e7fdd4d092a7b",
"md5": "28225e378f3b429f8a8737d71fbab7f7",
"sha256": "1c3e804818d9c63d2468442610c77c7e96dce689f5960839e9fdfe1a403a045b"
},
"downloads": -1,
"filename": "secstructartist-1.1.3.tar.gz",
"has_sig": false,
"md5_digest": "28225e378f3b429f8a8737d71fbab7f7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10738,
"upload_time": "2023-09-19T12:50:54",
"upload_time_iso_8601": "2023-09-19T12:50:54.095296Z",
"url": "https://files.pythonhosted.org/packages/a0/2d/de19a350ecac66755043e40c47196d8bf5e99e27b87bc57e7fdd4d092a7b/secstructartist-1.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-19 12:50:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bickeld",
"github_project": "secstructartist",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "secstructartist"
}