Skip to content

Commit

Permalink
Merge pull request #198 from lldelisle/updateArgParse
Browse files Browse the repository at this point in the history
Update arg parse
  • Loading branch information
joachimwolff authored Mar 26, 2020
2 parents 4b12447 + ecdf80d commit a18f3e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ optional arguments:
plot, in BED format, can be given. If this is the
case, multiple files will be created using a prefix
the value of --outFileName
--width WIDTH figure width in centimeters
--width WIDTH figure width in centimeters (default is 40)
--height HEIGHT Figure height in centimeters. If not given, the figure
height is computed based on the heights of the tracks.
If given, the track height are proportionally scaled
Expand All @@ -100,9 +100,10 @@ optional arguments:
--outFileName OUTFILENAME, -out OUTFILENAME
File name to save the image, file prefix in case
multiple images are stored
--fontSize FONTSIZE Font size for the labels of the plot
--fontSize FONTSIZE Font size for the labels of the plot (default is 0.3 *
figure width)
--dpi DPI Resolution for the image in case the ouput is a raster
graphics image (e.g png, jpg)
graphics image (e.g png, jpg) (default is 72)
--trackLabelFraction TRACKLABELFRACTION
By default the space dedicated to the track labels is
0.05 of the plot width. This fraction can be changed
Expand Down
17 changes: 4 additions & 13 deletions pygenometracks/plotTracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,7 @@
from pygenometracks._version import __version__
from .utilities import InputError

DEFAULT_BED_COLOR = '#1f78b4'
DEFAULT_BIGWIG_COLOR = '#33a02c'
DEFAULT_BEDGRAPH_COLOR = '#a6cee3'
DEFAULT_MATRIX_COLORMAP = 'RdYlBu_r'
DEFAULT_TRACK_HEIGHT = 3 # in centimeters
DEFAULT_FIGURE_WIDTH = 40 # in centimeters
# proportion of width dedicated to (figure, legends)
# DEFAULT_WIDTH_RATIOS = (0.95, 0.05)
DEFAULT_MARGINS = {'left': 0.04, 'right': 0.92, 'bottom': 0.12, 'top': 0.9}


def parse_arguments(args=None):
Expand Down Expand Up @@ -189,7 +181,7 @@ def parse_arguments(args=None):
)

parser.add_argument('--width',
help='figure width in centimeters',
help='figure width in centimeters (default is {})'.format(DEFAULT_FIGURE_WIDTH),
type=float,
default=DEFAULT_FIGURE_WIDTH)

Expand All @@ -209,13 +201,12 @@ def parse_arguments(args=None):
required=True)

parser.add_argument('--fontSize',
help='Font size for the labels of the plot',
type=float,
)
help='Font size for the labels of the plot (default is 0.3 * figure width)',
type=float)

parser.add_argument('--dpi',
help='Resolution for the image in case the'
' ouput is a raster graphics image (e.g png, jpg)',
' ouput is a raster graphics image (e.g png, jpg) (default is 72)',
type=int,
default=72
)
Expand Down

0 comments on commit a18f3e4

Please sign in to comment.