Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Roman Sarrazin-Gendron
BP6.1
Commits
470db6c1
Commit
470db6c1
authored
Jan 17, 2018
by
Roman Sarrazin-Gendron
Browse files
update distance between module
parent
a73b176c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bayes_to_seqpy.py
View file @
470db6c1
...
...
@@ -400,7 +400,9 @@ def seq_to_struct(
if
component
<
len
(
position_subsets
)
-
1
:
dis
=
component_distance
[
component
]
if
dis
[
1
]
<
4
:
dis
[
1
]
=
4
dis
[
1
]
=
10
else
:
dis
[
1
]
=
1.5
*
dis
[
1
]
if
len
(
re_call
)
>
0
:
re_call
=
re_call
+
r
")([ACGU]{"
+
str
(
2
)
+
","
+
str
(
dis
[
1
])
+
"})"
if
len
(
i
)
==
1
:
...
...
src/validation.py
View file @
470db6c1
...
...
@@ -273,21 +273,23 @@ def cross_validation(modules_to_test):
print
(
scores
[
k
])
crossval_results
[
i
].
append
(
scores
[
k
])
else
:
continue
found
=
False
new_seq
,
new_ss
=
[],[]
offset
=
0
if
last
-
first
<
3
00
:
if
last
-
first
<
4
00
:
helices
=
BayesPairing
.
find_loops
(
ss
)[
1
]
print
(
"HELICES"
)
print
(
helices
)
for
helix
in
helices
:
if
first
>
helix
[
0
]
and
last
<
helix
[
1
]:
found
=
True
new_seq
=
seq
[
helix
[
0
]:
helix
[
1
]]
new_ss
=
ss
[
helix
[
0
]:
helix
[
1
]]
offset
=
helix
[
0
]
break
else
:
continue
if
len
(
new_seq
)
>
400
:
if
len
(
new_seq
)
>
400
or
found
==
False
:
continue
#filler = 200-(last-first)
#split = random.randrange(0,filler)
...
...
@@ -308,9 +310,9 @@ def cross_validation(modules_to_test):
crossval_results
[
i
].
append
(
scores
[
k
])
cv_fn
=
"crossval_"
+
str
(
i
)
cv_fn
=
"
car_
crossval_"
+
str
(
i
)
+
".cPickle"
pickle
.
dump
(
crossval_results
[
i
],
open
(
cv_fn
,
"wb"
))
pickle
.
dump
(
crossval_results
,
open
(
"crossval_results.cPickle"
,
"wb"
))
pickle
.
dump
(
crossval_results
,
open
(
"
just_short_carnaval_
crossval_results
_fixed_max_len
.cPickle"
,
"wb"
))
if
__name__
==
"__main__"
:
modules_to_test
=
range
(
0
,
len
(
graphs
))
cross_validation
(
modules_to_test
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment