@@ -1632,6 +1632,45 @@ cdef class Gw:
16321632 self .thisptr.rasterToPng(c.c_str())
16331633 return self
16341634
1635+ def save_pdf (self , path ):
1636+ """
1637+ Saves a PDF file using the current configuration. Note calling draw() is
1638+ not needed beforehand.
1639+
1640+ Parameters
1641+ ----------
1642+ path : str
1643+ Path to save the PDF file
1644+
1645+ Returns
1646+ -------
1647+ Gw
1648+ Self for method chaining
1649+ """
1650+ cdef string c = path.encode(" utf-8" )
1651+ self .thisptr.saveToPdf(c.c_str())
1652+ return self
1653+
1654+ def save_svg (self , path ):
1655+ """
1656+ Saves an SVG file using the current configuration. Note calling draw() is
1657+ not needed beforehand.
1658+
1659+ Parameters
1660+ ----------
1661+ path : str
1662+ Path to save the SVG file
1663+
1664+ Returns
1665+ -------
1666+ Gw
1667+ Self for method chaining
1668+ """
1669+ cdef string c = path.encode(" utf-8" )
1670+ self .thisptr.saveToSvg(c.c_str())
1671+ return self
1672+
1673+
16351674 def draw_interactive (self , clear_buffer = False ):
16361675 """
16371676 Draw the visualization to the raster surface. Caches state for using with interactive functions.
@@ -1658,7 +1697,7 @@ cdef class Gw:
16581697
16591698 def draw (self ):
16601699 """
1661- Draw the visualization to the raster surface without buffering .
1700+ Draw the visualization to the raster surface.
16621701
16631702 Creates the raster surface if it doesn't exist yet.
16641703
@@ -1670,7 +1709,10 @@ cdef class Gw:
16701709 if not self .raster_surface_created:
16711710 self .make_raster_surface()
16721711 self .thisptr.processed = False
1673- self .thisptr.runDrawNoBuffer()
1712+ if self .thisptr.opts.link_op == 0 :
1713+ self .thisptr.runDrawNoBuffer()
1714+ else :
1715+ self .thisptr.runDraw()
16741716 return self
16751717
16761718 def draw_image (self ):
@@ -1685,7 +1727,10 @@ cdef class Gw:
16851727 if not self .raster_surface_created:
16861728 self .make_raster_surface()
16871729 self .thisptr.processed = False
1688- self .thisptr.runDrawNoBuffer()
1730+ if self .thisptr.opts.link_op == 0 :
1731+ self .thisptr.runDrawNoBuffer()
1732+ else :
1733+ self .thisptr.runDraw()
16891734 return Image.fromarray(self .array())
16901735
16911736 def view_region (self , chrom , start , end ):
0 commit comments