Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dpi in tracks #292

Open
wants to merge 10 commits into
base: dev_api
Choose a base branch
from
19 changes: 4 additions & 15 deletions examples/BedMatrixExampleTrack.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# -*- coding: utf-8 -*-
import numpy as np
from . BedGraphTrack import BedGraphTrack
from . GenomeTrack import GenomeTrack
from . BedGraphLikeTrack import BedGraphLikeTrack


class BedGraphMatrixTrack(BedGraphTrack):
# this track class extends a BedGraphTrack that is already part of
class BedGraphMatrixTrack(BedGraphLikeTrack):
# this track class extends a BedGraphLikeTrack that is already part of
# pyGenomeTracks. The advantage of extending this class is that
# we can re-use the code for reading a bedgraph file
SUPPORTED_ENDINGS = ['.bm', '.bm.gz']
TRACK_TYPE = 'bedgraph_matrix'
OPTIONS_TXT = GenomeTrack.OPTIONS_TXT + f"""
OPTIONS_TXT = BedGraphLikeTrack.OPTIONS_TXT + f"""
# a bedgraph matrix file is like a bedgraph, except that per bin there
# are more than one value (separated by tab). This file type is
# produced by the HiCExplorer tool hicFindTads and contains
Expand Down Expand Up @@ -38,12 +37,6 @@ class BedGraphMatrixTrack(BedGraphTrack):
'height': [0, np.inf]}
INTEGER_PROPERTIES = {}

# In BedGraphTrack the method set_properties_defaults
# has been adapted to a coverage track. Here we want to
# go back to the initial method:
def set_properties_defaults(self):
GenomeTrack.set_properties_defaults(self)

def plot(self, ax, chrom_region, start_region, end_region):
"""
Args:
Expand Down Expand Up @@ -88,7 +81,3 @@ def plot(self, ax, chrom_region, start_region, end_region):
def plot_y_axis(self, ax, plot_axis):
"""turn off y_axis plot"""
pass

def __del__(self):
if self.tbx is not None:
self.tbx.close()
40 changes: 19 additions & 21 deletions pygenometracks/tests/test_data/master_tracks.ini
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,11 @@ height = 2
# Otherwise, each plot use its own scale
#overlay_previous = yes

# If the bed file contains the exon
# structure (bed 12) then this is plotted. Otherwise
# a region **with direction** is plotted.
# If the bed file contains a column for color (column 9), then this color can be used by
# setting:
#color = bed_rgb
# if color is a valid colormap name (like RbBlGn), then the score (column 5) is mapped
# to the colormap.
# In this case, the the min_value and max_value for the score can be provided, otherwise
# the maximum score and minimum score found are used.
#color = RdYlBu
#min_value=0
#max_value=100
# If the color is simply a color name, then this color is used and the score is not considered.
color = darkblue
# optional: line_width
#line_width = 0.5
# optional, default is black. To remove the border, simply set 'border_color' to none
#border_color = black

# whether printing the labels
labels = false
# optional:
Expand All @@ -155,18 +145,13 @@ labels = false
#max_labels = 60
# optional: font size can be given to override the default size
fontsize = 10
# optional: line_width
#line_width = 0.5
# the display parameter defines how the bed file is plotted.
# Default is 'stacked' where regions are plotted on different lines so
# we can see all regions and all labels.
# The other options are ['collapsed', 'interleaved', 'triangles']
# These options assume that the regions do not overlap.
# `collapsed`: The bed regions are plotted one after the other in one line.
# `interleaved`: The bed regions are plotted in two lines, first up, then down, then up etc.
# optional, default is black. To remove the border, simply set 'border_color' to none
# Not used in tssarrow style
#border_color = black
# style to plot the genes when the display is not triangles
#style = UCSC
#style = flybase
Expand Down Expand Up @@ -205,9 +190,22 @@ fontsize = 10
# If you want that the tip of the arrow correspond to
# the extremity of the interval use:
# arrowhead_included = true

# If the bed file contains a column for color (column 9), then this color can be used by
# setting:
#color = bed_rgb
# if color is a valid colormap name (like RbBlGn), then the score (column 5) is mapped
# to the colormap.
# In this case, the the min_value and max_value for the score can be provided, otherwise
# the maximum score and minimum score found are used.
#color = RdYlBu
#min_value=0
#max_value=100
# If the color is simply a color name, then this color is used and the score is not considered.
color = darkblue
# optional. If not given is guessed from the file ending.
file_type = bed

[epilog.qcat]
file = pygenometracks/tests/test_data/epilog.qcat.bgz

Expand Down
Loading