Skip to content

Commit

Permalink
Merge pull request #1 from cfe-lab/update-drawsvg
Browse files Browse the repository at this point in the history
Update to drawsvg 2.x
  • Loading branch information
CBeelen authored Mar 28, 2023
2 parents 75fb692 + 3a1ff15 commit ca2edf5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ f = Figure()
for alignment in pysam.AlignmentFile(sys.argv[1]):
f.add(Track(alignment.query_start, alignment.query_end))

f.show(w=900).saveSvg("alignment.svg")
f.show(w=900).save_svg("alignment.svg")
```
6 changes: 3 additions & 3 deletions genetracks/elements.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Basic drawing elements for gene track figures
"""
import drawSvg as draw
import drawsvg as draw

class Figure:
"""Genetracks Figure
Expand Down Expand Up @@ -51,10 +51,10 @@ def show(self, w=None, h=None):
return d

def to_svg(self, path, w=None, h=None):
self.show(w=w, h=h).saveSvg(path)
self.show(w=w, h=h).save_svg(path)

def to_png(self, path, w=None, h=None):
self.show(w=w, h=h).savePng(path)
self.show(w=w, h=h).save_png(path)


class Element:
Expand Down
4 changes: 2 additions & 2 deletions genetracks/plasmid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Circularized genome figures
"""
import drawSvg as draw
import drawsvg as draw

class Plasmid:
"""Cicular genome figure
Expand All @@ -20,7 +20,7 @@ def show(self):
for region in self.regions:
d.append(region.draw(self.length))

d.setRenderSize(self.size)
d.set_render_size(self.size)
return d

class Region:
Expand Down

0 comments on commit ca2edf5

Please sign in to comment.