Skip to content

Commit

Permalink
Merge pull request #73 from UC-Davis-molecular-computing/dev
Browse files Browse the repository at this point in the history
removed Helix.svg_position and related constants
  • Loading branch information
dave-doty authored Jun 4, 2020
2 parents 9b1c4ac + 50772bb commit 9c66609
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 51 deletions.
Binary file added dist/scadnano-0.8.1.tar.gz
Binary file not shown.
7 changes: 4 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
sys.path.insert(0, os.path.abspath('../scadnano'))
# print(sys.path)

import scadnano_version
# from scadnano import current_version
current_version = "0.8.1"

# Type "make html" at the command line to generate the documentation.

Expand All @@ -35,8 +36,8 @@
# The full version, including alpha/beta/rc tags
# version = '0.7.0'
# release = '0.7.0'
version = scadnano_version.current_version
release = scadnano_version.current_version
version = current_version
release = current_version

# -- General configuration ---------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion scadnano/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from scadnano.scadnano import *
from scadnano.scadnano import *
current_version = "0.8.1"
76 changes: 33 additions & 43 deletions scadnano/scadnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,8 @@ class Grid(str, enum.Enum):
##########################################################################
# constants

# from . import scadnano_version
# import scadnano_version
# current_version: str = scadnano_version.current_version
# initial_version: str = scadnano_version.initial_version
current_version: str = "0.8.0"
initial_version: str = "0.0.1"
# from scadnano import current_version
current_version = "0.8.1"

default_idt_scale = "25nm"
default_idt_purification = "STD"
Expand All @@ -313,31 +309,34 @@ def default_major_tick_distance(grid: Grid) -> int:
default_roll: float = 0.0
default_yaw: float = 0.0

base_width_svg: float = 10.0
"""Width of a single base in the SVG main view of scadnano."""

base_height_svg: float = 10.0
"""Height of a single base in the SVG main view of scadnano."""

distance_between_helices_nm: float = 2.5
"""Distance between centers of helices in nanometers.
See :py:data:`distance_between_helices_svg` for explanation of this value."""

base_width_nm: float = 0.34
"""Width of a single DNA base in nanometers."""

distance_between_helices_svg: float = base_width_svg * distance_between_helices_nm / base_width_nm
"""Distance between tops of two consecutive helices (using default positioning rules).
This is set to (:const:`base_width_svg` * 2.5/0.34) based on the following calculation,
to attempt to make the DNA structure appear to scale in 2D drawings:
The width of one base pair of double-stranded DNA bp is 0.34 nm. In a DNA origami,
AFM images let us estimate that the average distance between adjacent double helices is 2.5 nm.
(A DNA double-helix is only 2 nm wide, but the helices electrostatically repel each other so the spacing
in a DNA origami or an other DNA nanostructure with many parallel DNA helices---e.g., single-stranded tile
lattices---is larger than 2 nm.)
Thus the distance between the helices is 2.5/0.34 ~ 7.5 times the width of a single DNA base.
"""
# XXX: code below related to SVG positions is not currently needed in the scripting library,
# but I want to make sure these conventions are documented somewhere, so they are just commented out for now.
#
# base_width_svg: float = 10.0
# """Width of a single base in the SVG main view of scadnano."""
#
# base_height_svg: float = 10.0
# """Height of a single base in the SVG main view of scadnano."""
#
# distance_between_helices_nm: float = 2.5
# """Distance between centers of helices in nanometers.
# See :py:data:`distance_between_helices_svg` for explanation of this value."""
#
# base_width_nm: float = 0.34
# """Width of a single DNA base in nanometers."""
#
# distance_between_helices_svg: float = base_width_svg * distance_between_helices_nm / base_width_nm
# """Distance between tops of two consecutive helices (using default positioning rules).
#
# This is set to (:const:`base_width_svg` * 2.5/0.34) based on the following calculation,
# to attempt to make the DNA structure appear to scale in 2D drawings:
# The width of one base pair of double-stranded DNA bp is 0.34 nm. In a DNA origami,
# AFM images let us estimate that the average distance between adjacent double helices is 2.5 nm.
# (A DNA double-helix is only 2 nm wide, but the helices electrostatically repel each other so the spacing
# in a DNA origami or an other DNA nanostructure with many parallel DNA helices---e.g., single-stranded tile
# lattices---is larger than 2 nm.)
# Thus the distance between the helices is 2.5/0.34 ~ 7.5 times the width of a single DNA base.
# """

DNA_base_wildcard: str = '?'
"""Symbol to insert when a DNA sequence has been assigned to a strand through complementarity, but
Expand Down Expand Up @@ -664,7 +663,6 @@ def m13(rotation: int = 5587, variant: M13Variant = M13Variant.p7249):
max_offset_key = 'max_offset'
min_offset_key = 'min_offset'
grid_position_key = 'grid_position'
svg_position_key = 'svg_position'
position3d_key = 'position'
legacy_position3d_keys = ['origin']

Expand Down Expand Up @@ -931,24 +929,16 @@ class Helix(_JSONSerializable):
Incrementing `b` moves the whole helix one base into the screen.
In the main view, a helix with `b` = 1 would have its base offset 0 line up with base offset 1
of a helix with `b` = 0.
However, the default y svg_position for helices does not otherwise depend on grid_position.
However, the default y position in the main view for helices does not otherwise depend on grid_position.
The default is to list the y-coordinates in order by helix idx.
Default is `h` = 0, `v` = index of :any:`Helix` in :py:data:`DNADesign.helices`, `b` = 0.
In the case of the honeycomb lattice, we use the same convention as cadnano for encoding hex coordinates see `misc/cadnano-format-specs/v2.txt`.
In the case of the honeycomb lattice, we use the same convention as cadnano for encoding hex coordinates,
see `misc/cadnano-format-specs/v2.txt`.
That convention is different from simply excluding coordinates from the hex lattice.
"""

svg_position: Tuple[float, float] = None
"""`(x,y)` SVG coordinates of base offset 0 of this Helix in the main view.
If `grid_position` and `position` are both omitted, then the default is
`x` = 0, `y` = [index of helix] * :any:`scadnano.distance_between_helices_svg`.
If `grid_position = (h,v,b)` is specified but `position` is omitted, then the default is
`x` = b * BASE_WIDTH_SVG, `y` = [index of :any:`Helix`] * :any:`scadnano.distance_between_helices_svg`."""

position3d: Position3D = None
"""Position (x,y,z) of this :any:`Helix` in 3D space.
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# import scadnano.scadnano_version as sv

# from scadnano.scadnano_version import current_version
from scadnano import current_version

# read the contents of your README file
from os import path
Expand All @@ -23,10 +24,10 @@

setup(name='scadnano',
packages=['scadnano'],
# version=sv.current_version,
version='0.8.0',
# download_url=f'https://github.com/UC-Davis-molecular-computing/scadnano-python-package/archive/v{sv.current_version}.zip',
download_url=f'https://github.com/UC-Davis-molecular-computing/scadnano-python-package/archive/v0.7.0.zip',
version=current_version,
# version='0.8.0',
download_url=f'https://github.com/UC-Davis-molecular-computing/scadnano-python-package/archive/v{current_version}.zip',
# download_url=f'https://github.com/UC-Davis-molecular-computing/scadnano-python-package/archive/v0.7.0.zip',
license='MIT',
description="Python scripting library for generating designs readable by scadnano.",
author="David Doty",
Expand Down

0 comments on commit 9c66609

Please sign in to comment.