Skip to content

Commit 391a6ed

Browse files
committed
Update error messages and parsing of --colorList
1 parent 41920d5 commit 391a6ed

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

deeptools/deepBlue.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __init__(self, sample, url="http://deepblue.mpi-inf.mpg.de/xmlrpc", userKey=
137137
# Set self.experimentID
138138
experimentID = self.getEID()
139139
if not experimentID:
140-
raise RuntimeError("The requested sample({}) has no associated experiment!".format(sample))
140+
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))
141141

142142
# Set self.info
143143
(status, resp) = self.server.info(self.experimentID, userKey)

deeptools/parserCommon.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ def check_float_0_1(value):
1111
return v
1212

1313

14+
def check_list_of_comma_values(value):
15+
if value is None:
16+
return None
17+
for foo in value:
18+
foo = value.split(",")
19+
if len(foo) < 2:
20+
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)
21+
return value
22+
23+
1424
def output(args=None):
1525
parser = argparse.ArgumentParser(add_help=False)
1626
group = parser.add_argument_group('Output')
@@ -610,7 +620,7 @@ def heatmapperOptionalArgs(mode=['heatmap', 'profile'][0]):
610620
'As for --colorMap, the color lists are recycled if their number is smaller thatn the number of'
611621
'plotted heatmaps. '
612622
'The number of transitions is defined by the --colorNumber option.',
613-
623+
type=check_list_of_comma_values,
614624
nargs='+')
615625

616626
optional.add_argument(

0 commit comments

Comments
 (0)