-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
165 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
paper/paper.html | ||
paper/paper.log | ||
paper/paper.pdf | ||
/py/src/democapsid.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,102 +3,37 @@ | |
|
||
cff-version: 1.2.0 | ||
title: >- | ||
democapsid | ||
message: 'If you use this software, please cite it as below.' | ||
democapsid | ||
message: "If you use this software, please cite it as below." | ||
type: software | ||
authors: | ||
- given-names: Daniel | ||
family-names: Negrón | ||
email: [email protected] | ||
affiliation: George Mason University | ||
orcid: 'https://orcid.org/0000-0002-6123-2441' | ||
identifiers: | ||
- type: doi | ||
value: 10.1101/2020.12.02.408252 | ||
description: The bioRxiv preprint of the paper. | ||
repository-code: 'https://github.com/dnanto/democapsid' | ||
url: 'https://github.com/dnanto/democapsid/capsid.html' | ||
abstract: >- | ||
This work implements Caspar-Klug Theory to | ||
generate high-quality, vectorized capsid cartoons | ||
in the browser and is the first online tool that | ||
provides comprehensive style customization, | ||
geometry, and SVG export of icosahedra and nets | ||
with different lattice structures. | ||
keywords: | ||
- virus | ||
- capsid | ||
- caspar-klug | ||
- moody | ||
- icosahedron | ||
- prolate | ||
- oblate | ||
- elongated | ||
- lattice | ||
- 2D | ||
- 3D | ||
- svg | ||
- biology | ||
- graphics | ||
- render | ||
- projection | ||
- perspective | ||
- publication | ||
- figure | ||
- demoscene | ||
license: MIT | ||
preferred-citation: | ||
type: article | ||
authors: | ||
- given-names: Daniel | ||
family-names: Negrón | ||
email: [email protected] | ||
affiliation: George Mason University | ||
orcid: 'https://orcid.org/0000-0002-6123-2441' | ||
doi: 10.1101/2020.12.02.408252 | ||
journal: bioRxiv | ||
abstract: >- | ||
orcid: "https://orcid.org/0000-0002-6123-2441" | ||
identifiers: | ||
- type: doi | ||
value: 10.1101/2020.12.02.408252 | ||
description: The bioRxiv preprint of the paper. | ||
repository-code: "https://github.com/dnanto/democapsid" | ||
url: "https://github.com/dnanto/democapsid/capsid.html" | ||
abstract: >- | ||
This work implements Caspar-Klug Theory to | ||
generate high-quality, vectorized capsid cartoons | ||
in the browser and is the first online tool that | ||
provides comprehensive style customization, | ||
geometry, and SVG export of icosahedra and nets | ||
with different lattice structures. | ||
Motivation Few online services exist for rendering | ||
high-quality viral capsid figures compatible with | ||
common productivity software to develop effective | ||
infographics in the field of virology. | ||
Results The capsid.js library renders class I viral | ||
capsids within an online application that | ||
parameterizes style options, perspectives, and | ||
lattice patterns with SVG export. | ||
Availability This project is actively developed on | ||
GitHub (https://github.com/dnanto/capsid), | ||
distributed under the MIT License, hosted on GitHub | ||
Pages, and runs on modern browsers | ||
(https://dnanto.github.io/capsid/capsid.html). | ||
Supplementary information Supplementary data are | ||
available on GitHub. | ||
month: 12 | ||
title: >- | ||
Vectorized Capsid Rendering in the Browser with | ||
Capsid.js | ||
year: 2021 | ||
keywords: | ||
keywords: | ||
- virus | ||
- capsid | ||
- caspar-klug | ||
- moody | ||
- icosahedron | ||
- prolate | ||
- oblate | ||
- elongated | ||
- elongated | ||
- lattice | ||
- 2D | ||
- 3D | ||
|
@@ -110,4 +45,69 @@ preferred-citation: | |
- perspective | ||
- publication | ||
- figure | ||
- demoscene | ||
- demoscene | ||
license: MIT | ||
preferred-citation: | ||
type: article | ||
authors: | ||
- given-names: Daniel | ||
family-names: Negrón | ||
email: [email protected] | ||
affiliation: George Mason University | ||
orcid: "https://orcid.org/0000-0002-6123-2441" | ||
doi: 10.1101/2020.12.02.408252 | ||
journal: bioRxiv | ||
abstract: >- | ||
This work implements Caspar-Klug Theory to | ||
generate high-quality, vectorized capsid cartoons | ||
in the browser and is the first online tool that | ||
provides comprehensive style customization, | ||
geometry, and SVG export of icosahedra and nets | ||
with different lattice structures. | ||
Motivation Few online services exist for rendering | ||
high-quality viral capsid figures compatible with | ||
common productivity software to develop effective | ||
infographics in the field of virology. | ||
Results The capsid.js library renders class I viral | ||
capsids within an online application that | ||
parameterizes style options, perspectives, and | ||
lattice patterns with SVG export. | ||
Availability This project is actively developed on | ||
GitHub (https://github.com/dnanto/capsid), | ||
distributed under the MIT License, hosted on GitHub | ||
Pages, and runs on modern browsers | ||
(https://dnanto.github.io/capsid/capsid.html). | ||
Supplementary information Supplementary data are | ||
available on GitHub. | ||
month: 12 | ||
title: >- | ||
Vectorized Capsid Rendering in the Browser with | ||
Capsid.js | ||
year: 2021 | ||
keywords: | ||
- 2D | ||
- 3D | ||
- biology | ||
- capsid | ||
- caspar-klug | ||
- demoscene | ||
- elongated | ||
- figure | ||
- graphics | ||
- icosahedron | ||
- lattice | ||
- oblate | ||
- perspective | ||
- projection | ||
- prolate | ||
- publication | ||
- render | ||
- svg | ||
- virology | ||
- virus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- [ ] comments/documentation | ||
- [ ] python package | ||
- [ ] R package | ||
- [ ] Blender addo |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 - 2024, Daniel Antonio Negrón (dnanto/remaindeer) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
========== | ||
democapsid | ||
========== | ||
|
||
|
||
Calculate meshes for icosahedral virus capsids. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ authors = [ | |
maintainers = [ | ||
{ name="Daniel Antonio Negrón", email="[email protected]" }, | ||
] | ||
description = "This package includes methods to calculate the coordinates of viral capsids." | ||
description = "Calculate meshes for icosahedral virus capsids." | ||
readme = "README.md" | ||
license = {text = "MIT License"} | ||
requires-python = ">=3.9.11" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env python3 | ||
|
||
"""Top-level package for democapsid.""" | ||
|
||
__author__ = """Daniel Antonio Negrón""" | ||
__email__ = '[email protected]' | ||
__version__ = '0.0.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
from functools import partial | ||
|
||
from .cli import parse_args | ||
from .democapsid import calc_ckm, calc_ckv, calc_ico, calc_lattice, cylinderize | ||
|
||
args = parse_args(sys.argv[1:]) | ||
h, k, H, K, s, R, t, c = args.h, args.k, args.H, args.K, args.symmetry, args.radius, args.tile, args.sphericity | ||
|
||
lattice = calc_lattice(t, R) | ||
ckv = calc_ckv(h, k, H, K, lattice[0]) | ||
ckm = calc_ckm(ckv, lattice) | ||
|
||
if args.mode == "ico": | ||
inflater = spherize if h == H and k == K else partial(cylinderize, s=s) | ||
meshes = calc_ico(ckv, ckm, s, c, inflater) | ||
|
||
print("x", "y", "z", "face", "polygon", "point", sep="\t") | ||
for i, mesh in enumerate(meshes[1:], start=1): | ||
for j, polygon in enumerate(mesh, start=1): | ||
for k, point in enumerate(polygon[0], start=1): | ||
print(*point, i, j, k, sep="\t") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
def parse_args(argv): | ||
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser | ||
parser = ArgumentParser( | ||
prog="democapsid", | ||
formatter_class=ArgumentDefaultsHelpFormatter, | ||
description="Calculate meshes for icosahedral virus capsids." | ||
) | ||
for ele in "hkHK": | ||
parser.add_argument(ele, default=1, type=int, help=f"the {ele} lattice parameter") | ||
choices = (5, 3, 2) | ||
parser.add_argument("-symmetry", default=choices[0], type=int, help=f"the axial symmetry: {choices}") | ||
parser.add_argument("-radius", default=1, type=int, help="the hexagonal lattice unit radius") | ||
choices = ("hex", "trihex", "snubhex", "rhombitrihex") | ||
choices = (*choices, *("dual" + ele for ele in choices)) | ||
parser.add_argument("-tile", default=choices[0], help="the hexagonal lattice unit tile") | ||
parser.add_argument("-sphericity", default=0, type=float, help="the sphericity value") | ||
choices = ("ico", "net") | ||
parser.add_argument("-mode", default=choices[0], help="the sphericity value") | ||
return parser.parse_args(argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters