Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VARNA-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
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
AMIBIO
VARNA-api
Commits
a57a71fc
Commit
a57a71fc
authored
3 years ago
by
htyao
Browse files
Options
Downloads
Patches
Plain Diff
Add function show()
parent
0db6d234
No related branches found
No related tags found
1 merge request
!9
Add cartoon like example
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/varnaapi/models.py
+7
-0
7 additions, 0 deletions
src/varnaapi/models.py
with
7 additions
and
0 deletions
src/varnaapi/models.py
+
7
−
0
View file @
a57a71fc
...
...
@@ -4,6 +4,7 @@ import abc
from
string
import
ascii_lowercase
,
ascii_uppercase
from
colour
import
Color
import
subprocess
from
tempfile
import
NamedTemporaryFile
from
deprecated
import
deprecated
from
IPython.display
import
Image
,
display
,
SVG
...
...
@@ -243,6 +244,12 @@ class BasicDraw(VarnaConfig):
elif
output
[
-
3
:]
==
'
svg
'
:
display
(
SVG
(
filename
=
output
))
def
show
(
self
,
extension
=
'
png
'
):
"""
Show the drawing
Equivalent to `savefig(tmp, show=True)` where tmp is a temporary file
"""
tmp
=
NamedTemporaryFile
(
suffix
=
'
.
'
+
extension
)
self
.
savefig
(
tmp
.
name
,
show
=
True
)
class
Structure
(
BasicDraw
):
def
__init__
(
self
,
sequence
=
None
,
structure
=
None
):
...
...
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