Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
3
3DNA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume Machabert
3DNA
Commits
52376378
Commit
52376378
authored
3 years ago
by
Joan Hérisson
Browse files
Options
Downloads
Patches
Plain Diff
refactor
parent
7e3489c4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
3dna/RotTable.py
+21
-15
21 additions, 15 deletions
3dna/RotTable.py
with
21 additions
and
15 deletions
3dna/RotTable.py
+
21
−
15
View file @
52376378
from
copy
import
deepcopy
from
json
import
load
as
json_load
from
os
import
path
as
os_path
here
=
os_path
.
abspath
(
os_path
.
dirname
(
__file__
))
class
RotTable
:
"""
Represents
the
rotation table
"""
"""
Represents
a
rotation table
"""
# 3 first values: 3 angle values
# 3 last values: SD values
__ORIGINAL_ROT_TABLE
=
json_load
(
open
(
os_path
.
join
(
here
,
'
table.json
'
))
)
def
__init__
(
self
):
self
.
__Rot_Table
=
deepcopy
(
RotTable
.
__ORIGINAL_ROT_TABLE
)
def
__init__
(
self
,
filename
:
str
=
None
):
if
filename
is
None
:
filename
=
os_path
.
join
(
here
,
'
table.json
'
)
self
.
rot_table
=
json_load
(
open
(
filename
))
###################
# WRITING METHODS #
###################
def
setTwist
(
self
,
dinucleotide
:
str
,
value
:
float
):
self
.
rot_table
[
dinucleotide
][
0
]
=
value
def
setWedge
(
self
,
dinucleotide
:
str
,
value
:
float
):
self
.
rot_table
[
dinucleotide
][
1
]
=
value
def
setDirection
(
self
,
dinucleotide
:
str
,
value
:
float
):
self
.
rot_table
[
dinucleotide
][
2
]
=
value
###################
# READING METHODS #
###################
def
getTwist
(
self
,
dinucleotide
:
str
):
return
self
.
getTable
()[
dinucleotide
][
0
]
def
get
Twist
(
self
,
dinucleotide
):
return
self
.
__Rot_
Table
[
dinucleotide
][
0
]
def
get
Wedge
(
self
,
dinucleotide
:
str
):
return
self
.
get
Table
()
[
dinucleotide
][
1
]
def
get
Wedge
(
self
,
dinucleotide
):
return
self
.
__Rot_
Table
[
dinucleotide
][
1
]
def
get
Direction
(
self
,
dinucleotide
:
str
):
return
self
.
get
Table
()
[
dinucleotide
][
2
]
def
get
Direction
(
self
,
dinucleotide
):
return
self
.
__R
ot_
T
able
[
dinucleotide
][
2
]
def
get
Table
(
self
):
return
self
.
r
ot_
t
able
###################
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment