Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AMIBIO
VARNA-api
Commits
1b7a3eb8
Commit
1b7a3eb8
authored
Dec 08, 2020
by
htyao
Browse files
Include sequence argument
parent
829514c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
varnaapi.py
View file @
1b7a3eb8
...
...
@@ -634,23 +634,33 @@ class Motif(VARNA):
struct
=
""
extra_bps
=
[]
pos
=
0
for
c
in
motif
:
for
i
in
range
(
len
(
motif
)):
c
=
motif
[
i
]
if
c
==
"*"
:
extra_bps
.
append
((
pos
+
1
,
pos
+
2
))
if
sequence
is
not
None
and
not
sequence
[
i
]
==
'*'
:
raise
Exception
(
"Motif and sequence are not compatible at position {}"
.
format
(
i
))
extra_bps
.
append
((
pos
+
1
,
pos
+
2
))
seq
+=
" & "
struct
+=
"(&)"
pos
+=
2
else
:
seq
+=
" "
if
sequence
is
not
None
:
w
=
sequence
[
i
]
else
:
w
=
" "
if
w
==
'*'
:
raise
Exception
(
"Motif and sequence are not compatible at position {}"
.
format
(
i
))
seq
+=
w
struct
+=
c
pos
+=
1
seq
=
" "
+
seq
+
" "
struct
=
"("
+
struct
+
")"
seq
=
" "
+
seq
+
" "
struct
=
"("
+
struct
+
")"
self
.
sequence
=
seq
self
.
structure
=
struct
self
.
length
=
pos
+
2
extra_bps
.
append
((
0
,
self
.
length
-
1
))
extra_bps
.
append
((
0
,
self
.
length
-
1
))
self
.
extra_bps
=
extra_bps
self
.
_init_features
()
# Default Bases Styles
self
.
rootBasesStyle
=
BasesStyle
(
fill
=
"#606060"
,
outline
=
"#FFFFFF"
,
number
=
"#FFFFFF"
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment