Skip to content

Commit

Permalink
Update error messages and parsing of --colorList
Browse files Browse the repository at this point in the history
  • Loading branch information
dpryan79 committed Dec 2, 2016
1 parent 41920d5 commit 391a6ed
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deeptools/deepBlue.py
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ def __init__(self, sample, url="http://deepblue.mpi-inf.mpg.de/xmlrpc", userKey=
# Set self.experimentID
experimentID = self.getEID()
if not experimentID:
raise RuntimeError("The requested sample({}) has no associated experiment!".format(sample))
raise RuntimeError("The requested sample({}) has no associated experiment! If you did not intend to use samples on deepBlue, then it appears either you misspelled a file name or one of your BAM files is lacking a valid index.".format(sample))

# Set self.info
(status, resp) = self.server.info(self.experimentID, userKey)
12 changes: 11 additions & 1 deletion deeptools/parserCommon.py
Original file line number Diff line number Diff line change
@@ -11,6 +11,16 @@ def check_float_0_1(value):
return v


def check_list_of_comma_values(value):
if value is None:
return None
for foo in value:
foo = value.split(",")
if len(foo) < 2:
raise argparse.ArgumentTypeError("%s is an invalid element of a list of comma separated values. Only argument elements of the following form are accepted: 'foo,bar'" % foo)
return value


def output(args=None):
parser = argparse.ArgumentParser(add_help=False)
group = parser.add_argument_group('Output')
@@ -610,7 +620,7 @@ def heatmapperOptionalArgs(mode=['heatmap', 'profile'][0]):
'As for --colorMap, the color lists are recycled if their number is smaller thatn the number of'
'plotted heatmaps. '
'The number of transitions is defined by the --colorNumber option.',

type=check_list_of_comma_values,
nargs='+')

optional.add_argument(

0 comments on commit 391a6ed

Please sign in to comment.