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
df296ad8
Commit
df296ad8
authored
7 months ago
by
pinyili2
Browse files
Options
Downloads
Patches
Plain Diff
add
parent
6c543c98
No related branches found
No related tags found
1 merge request
!1
Pinyili2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mrdna/readers/__init__.py
+2
-2
2 additions, 2 deletions
mrdna/readers/__init__.py
mrdna/readers/segmentmodel_from_lists.py
+16
-20
16 additions, 20 deletions
mrdna/readers/segmentmodel_from_lists.py
with
18 additions
and
22 deletions
mrdna/readers/__init__.py
+
2
−
2
View file @
df296ad8
...
@@ -37,10 +37,10 @@ def read_list(infile,**model_parameters):
...
@@ -37,10 +37,10 @@ def read_list(infile,**model_parameters):
return
model_from_basepair_stack_3prime
(
coords
,
bp
,
stack
,
three_prime
)
return
model_from_basepair_stack_3prime
(
coords
,
bp
,
stack
,
three_prime
)
def
read_pandas
(
df
,
coordinate_col
=
"
r
"
,
bp_col
=
"
bp
"
,
stack_col
=
"
stack
"
,
three_prime_col
=
"
threeprime
"
,
def
read_pandas
(
df
,
coordinate_col
=
"
r
"
,
bp_col
=
"
bp
"
,
stack_col
=
"
stack
"
,
three_prime_col
=
"
threeprime
"
,
seq_col
=
None
,
orientation_col
=
None
):
seq_col
=
"
seq
"
,
orientation_col
=
"
orientation
"
):
from
.segmentmodel_from_lists
import
model_from_pandas
from
.segmentmodel_from_lists
import
model_from_pandas
return
model_from_pandas
(
df
,
coordinate_col
,
bp_col
,
stack_col
,
three_prime_col
,
return
model_from_pandas
(
df
,
coordinate_col
,
bp_col
,
stack_col
,
three_prime_col
,
seq_col
,
orientation_col
)
,
seq_col
,
orientation_col
)
def
read_atomic_pdb
(
pdb_file
,
**
model_parameters
):
def
read_atomic_pdb
(
pdb_file
,
**
model_parameters
):
from
.segmentmodel_from_pdb
import
SegmentModelFromPdb
from
.segmentmodel_from_pdb
import
SegmentModelFromPdb
...
...
This diff is collapsed.
Click to expand it.
mrdna/readers/segmentmodel_from_lists.py
+
16
−
20
View file @
df296ad8
...
@@ -477,45 +477,39 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
...
@@ -477,45 +477,39 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
return
model
return
model
def
model_from_pandas
(
df
,
coordinate_col
=
"
r
"
,
bp_col
=
"
bp
"
,
stack_col
=
"
stack
"
,
three_prime_col
=
"
threeprime
"
,
def
model_from_pandas
(
df
,
coordinate_col
=
"
r
"
,
bp_col
=
"
bp
"
,
stack_col
=
"
stack
"
,
three_prime_col
=
"
threeprime
"
,
seq_col
=
None
,
orientation_col
=
None
,
seq_col
=
"
seq
"
,
orientation_col
=
"
orientation
"
,
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
)
dimensions
=
(
5000
,
5000
,
5000
)
,
**
model_parameters
):
,
**
model_parameters
):
try
:
try
:
c
=
df
[
coordinate_col
]
c
=
np
.
array
(
list
(
df
[
coordinate_col
]
))
except
:
except
:
print
(
"
cannot locate coordinate
"
)
print
(
"
cannot locate coordinate
"
)
try
:
try
:
bp
=
df
[
bp_col
]
bp
=
np
.
array
(
df
[
bp_col
]
)
except
:
except
:
print
(
"
cannot locate bp
"
)
print
(
"
cannot locate bp
"
)
try
:
try
:
stack
=
df
[
stack_col
]
stack
=
np
.
array
(
df
[
stack_col
]
)
except
:
except
:
print
(
"
cannot find stack
"
)
print
(
"
cannot find stack
"
)
try
:
try
:
tprime
=
df
[
three_prime_col
]
tprime
=
np
.
array
(
df
[
three_prime_col
]
)
except
:
except
:
print
(
"
cannot locate 3
'
s
"
)
print
(
"
cannot locate 3
'
s
"
)
if
seq_col
is
not
None
:
try
:
try
:
seq
=
np
.
array
(
df
[
seq_col
])
seq
=
df
[
seq_col
]
except
:
except
:
print
(
"
no sequence inputted
"
)
print
(
"
no sequence inputted
"
)
seq
=
None
else
:
seq
=
None
seq
=
None
if
orientation_col
is
not
None
:
try
:
try
:
orient
=
np
.
array
(
list
(
df
[
orientation_col
]))
orient
=
df
[
orientation_col
]
except
:
except
:
print
(
"
no orientation inputted
"
)
print
(
"
no orientation inputted
"
)
orient
=
None
orient
=
None
else
:
orient
=
None
try
:
try
:
model
=
model_from_basepair_stack_3prime
(
c
,
bp
,
stack
,
tprime
,
model
=
model_from_basepair_stack_3prime
(
c
,
bp
,
stack
,
tprime
,
...
@@ -525,6 +519,8 @@ def model_from_pandas(df,coordinate_col="r",bp_col="bp",stack_col="stack",three_
...
@@ -525,6 +519,8 @@ def model_from_pandas(df,coordinate_col="r",bp_col="bp",stack_col="stack",three_
local_twist
=
local_twist
,
local_twist
=
local_twist
,
dimensions
=
dimensions
,
dimensions
=
dimensions
,
**
model_parameters
)
**
model_parameters
)
model
.
_dataframe
=
df
return
model
return
model
except
:
except
:
print
(
"
cannot phrase DataFrame, aborted
"
)
print
(
"
cannot phrase DataFrame, aborted
"
)
...
...
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