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
RNABayesPairing
Commits
86f4750c
Commit
86f4750c
authored
Dec 12, 2018
by
Roman Sarrazin-Gendron
Browse files
oups
parent
df2e8f54
Changes
1
Hide whitespace changes
Inline
Side-by-side
bayespairing/src/parse_sequences.py
View file @
86f4750c
...
...
@@ -121,13 +121,13 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
if
"fa"
in
input
.
lower
()
and
ss
==
""
:
prediction_scores
=
{}
sequences
=
[]
sequences
=
[]
with
open
(
input
,
"rU"
)
as
f
:
for
num
,
record
in
enumerate
(
SeqIO
.
parse
(
f
,
"fasta"
)):
id
=
record
.
id
seq
=
str
(
record
.
seq
)
seq
=
seq
.
upper
()
sequences
.
append
(
seq
)
seq
=
seq
.
upper
()
sequences
.
append
(
seq
)
#print("PARSING SEQUENCE ", id, "\n")
if
"T"
in
seq
:
seq
=
str
(
seq
).
replace
(
"T"
,
"U"
)
...
...
@@ -176,16 +176,16 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
elif
"fa"
in
input
.
lower
()
and
ss
==
"infile"
:
prediction_scores
=
{}
sequences
=
[]
sequences
=
[]
with
open
(
input
,
"rU"
)
as
f
:
lines
=
f
.
readlines
()
for
line_n
in
range
(
0
,
len
(
lines
),
3
):
id
=
lines
[
line_n
].
strip
(
">"
).
strip
(
"
\n
"
)
seq
=
lines
[
line_n
+
1
].
strip
(
"
\n
"
).
strip
()
seq
=
seq
.
upper
()
seq
=
seq
.
upper
()
ss
=
lines
[
line_n
+
2
].
strip
(
"
\n
"
).
strip
()
sequences
.
append
(
seq
)
p
#rint("PARSING SEQUENCE ", id, "\n")
sequences
.
append
(
seq
)
#
p
rint("PARSING SEQUENCE ", id, "\n")
if
"T"
in
seq
:
seq
=
str
(
seq
).
replace
(
"T"
,
"U"
)
if
len
(
seq
)
<=
200
:
...
...
@@ -231,9 +231,9 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
pickle
.
dump
(
prediction_scores
,
open
(
"../output/"
+
o
+
".pickle"
,
"wb"
))
else
:
if
"T"
in
input
:
input
=
input
.
upper
()
input
=
input
.
upper
()
input
=
str
(
input
).
replace
(
"T"
,
"U"
)
sequences
=
[
input
]
sequences
=
[
input
]
if
len
(
input
)
<=
200
:
maxs
=
run_BP
(
input
,
ss
,
modules_to_parse
,
dataset
,
"NONE"
,
m
,
n
,
sm
,
mc
,
p
,
k
,
sscons
)
all_maxes
=
[]
...
...
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