Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mrdna
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
tbgl
tools
mrdna
Commits
044a63a0
Commit
044a63a0
authored
7 months ago
by
pinyili2
Browse files
Options
Downloads
Patches
Plain Diff
add code
parent
536fadcc
No related branches found
No related tags found
1 merge request
!1
Pinyili2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mrdna/readers/segmentmodel_from_lists.py
+55
-4
55 additions, 4 deletions
mrdna/readers/segmentmodel_from_lists.py
with
55 additions
and
4 deletions
mrdna/readers/segmentmodel_from_lists.py
+
55
−
4
View file @
044a63a0
...
@@ -234,7 +234,7 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
...
@@ -234,7 +234,7 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
max_basepairs_per_bead
=
5
,
max_basepairs_per_bead
=
5
,
max_nucleotides_per_bead
=
5
,
max_nucleotides_per_bead
=
5
,
local_twist
=
False
,
local_twist
=
False
,
dimensions
=
(
5000
,
5000
,
5000
)
,
return_prop
=
False
dimensions
=
(
5000
,
5000
,
5000
)
**
model_parameters
):
**
model_parameters
):
"""
"""
Creates a SegmentModel object from lists of each nucleotide
'
s
Creates a SegmentModel object from lists of each nucleotide
'
s
...
@@ -475,11 +475,62 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
...
@@ -475,11 +475,62 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
if
sequence
is
None
:
if
sequence
is
None
:
for
s
in
model
.
segments
:
for
s
in
model
.
segments
:
s
.
randomize_unset_sequence
()
s
.
randomize_unset_sequence
()
if
return_prop
is
True
:
nt_prop
=
pd
.
DataFrame
({
"
r
"
:
coordinate
,
"
bp
"
:
basepair
,
"
stack
"
:
stack
,
"
fwd
"
:
fwd
,
"
threeprime
"
:
three_prime
,
"
seq
"
:
sequence
,
"
orientation
"
:
orientation
})
return
model
return
model
,
nt_prop
def
model_from_pandas
(
df
,
coordinate_col
=
"
r
"
,
bp_col
=
"
bp
"
,
stack_col
=
"
stack
"
,
three_prime_col
=
"
threeprime
"
,
seq_col
=
None
,
orientation_col
=
None
,
max_basepairs_per_bead
=
5
,
max_nucleotides_per_bead
=
5
,
local_twist
=
False
,
dimensions
=
(
5000
,
5000
,
5000
)
**
model_parameters
):
try
:
c
=
df
[
coordinate_col
]
except
:
print
(
"
cannot locate coordinate
"
)
try
:
bp
=
df
[
bp_col
]
except
:
print
(
"
cannot locate bp
"
)
try
:
stack
=
df
[
stack_col
]
except
:
print
(
"
cannot find stack
"
)
try
:
tprime
=
df
[
three_prime_col
]
except
:
print
(
"
cannot locate 3
'
s
"
)
if
seq_col
is
not
None
:
try
:
seq
=
df
[
seq_col
]
except
:
print
(
"
no sequence inputted
"
)
seq
=
None
else
:
else
:
seq
=
None
if
orientation_col
is
not
None
:
try
:
orient
=
df
[
orientation_col
]
except
:
print
(
"
no orientation inputted
"
)
orient
=
None
else
:
orient
=
None
try
:
model
=
model_from_basepair_stack_3prime
(
c
,
bp
,
stack
,
tprime
,
sequence
=
seq
,
orientation
=
orient
,
max_basepairs_per_bead
=
max_basepairs_per_bead
,
max_nucleotides_per_bead
=
max_nucleotides_per_bead
,
local_twist
=
local_twist
,
dimensions
=
dimensions
**
model_parameters
)
model
.
_dataframe
=
df
return
model
return
model
except
:
print
(
"
cannot phrase DataFrame, aborted
"
)
def
UNIT_circular
():
def
UNIT_circular
():
"""
Make a circular DNA strand, with dsDNA in the middle
"""
"""
Make a circular DNA strand, with dsDNA in the middle
"""
...
...
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