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
RNABayesPairing2
Commits
c853871a
Commit
c853871a
authored
May 11, 2021
by
Yixiong Sun
Browse files
Updated validation code
parent
b165d07e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
bayespairing/src/make_BN_from_carnaval.py
View file @
c853871a
...
...
@@ -409,31 +409,6 @@ def call_makeBN(mod, dataset, module_data, Lambda=1, Theta=1,retrain=False):
'''
# Temporary placeholder function for CV for building a Bayesian Network
def
make_BN
(
module
,
dataset
,
graphs
,
motif_sequences
,
Lambda
=
0.35
,
Theta
=
1
):
# Test sequences should be tuple of seq and positions, seems like it is outdated/not used
test_seqs
=
[]
# Build the BN with the motif sequences
g
=
graphs
[
module
][
0
]
aln
=
{}
for
n
in
sorted
(
list
(
g
.
nodes
())):
aln
[
n
]
=
n
alignment
=
get_alignment
(
g
,
aln
,
motif_sequences
)
motif
=
make_graph_from_carnaval
(
g
,
alignment
)
pwm
=
BN_builder
.
build_pwm
(
sorted
(
list
(
motif
.
nodes
())),
alignment
)
BN
=
BN_builder
.
build_BN
(
motif
,
pwm
,
alignment
)
# PDBs array is also empty, outdated?
BN
.
from_alignment_dataset
(
dataset
,
module
,
[
g
],
alignment
,
test_seqs
,
[],
Lambda
,
Theta
)
return
BN
if
__name__
==
"__main__"
:
...
...
bayespairing/src/module_from_desc.py
View file @
c853871a
...
...
@@ -275,13 +275,13 @@ def create_module(desc, fasta, model_name, list_of_nodes, PDBs=[], pdb_info_file
pdb_aln
=
[]
pdb_seq
=
[]
# Try to load PDB_info
if
os
.
path
.
isfile
(
pdb_info_file
):
if
pdb_info_file
is
not
None
and
os
.
path
.
isfile
(
pdb_info_file
):
with
open
(
pdb_info_file
,
'rb'
)
as
f
:
pdb_aln
,
pdb_seq
=
pickle
.
load
(
f
)
# try to load full_seq_file
full_records
=
[]
if
os
.
path
.
isfile
(
full_seq_file
):
if
full_seq_file
is
not
None
and
os
.
path
.
isfile
(
full_seq_file
):
full_records
=
list
(
SeqIO
.
parse
(
full_seq_file
,
"fasta"
))
# module signatures from list of nodes
...
...
bayespairing/src/validation.py
View file @
c853871a
This diff is collapsed.
Click to expand it.
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