-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexceptions.py
52 lines (35 loc) · 1.86 KB
/
exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class ApplicationException(Exception):
def __init__(self, message):
super(ApplicationException, self).__init__(message)
class UnknownEnzymeException(ApplicationException):
"""All sequences were excluded during filtering"""
def __init__(self, target, similar):
super(UnknownEnzymeException, self).__init__(
'{} is undefined, but its similar to: {}'.format(target, ', '.join(similar)))
class UnknownOrientationStateException(ApplicationException):
"""All sequences were excluded during filtering"""
def __init__(self, ori):
super(UnknownOrientationStateException, self).__init__('unknown orientation state [{}].'.format(ori))
class NoneAcceptedException(ApplicationException):
"""All sequences were excluded during filtering"""
def __init__(self):
super(NoneAcceptedException, self).__init__('all sequences were excluded')
class TooFewException(ApplicationException):
"""Method requires a minimum of nodes"""
def __init__(self, minseq, method):
super(TooFewException, self).__init__('More than {} sequences are required to apply {}'.format(minseq, method))
class NoRemainingClustersException(ApplicationException):
def __init__(self, msg):
super(NoRemainingClustersException, self).__init__(msg)
class NoReportException(ApplicationException):
"""Clustering does not contain a report"""
def __init__(self, clid):
super(NoReportException, self).__init__('No clusters contained an ordering'.format(clid))
class ZeroLengthException(ApplicationException):
"""Sequence of zero length"""
def __init__(self, seq_name):
super(ZeroLengthException, self).__init__('Sequence [{}] has zero length'.format(seq_name))
class ParsingError(ApplicationException):
"""An error during input parsing"""
def __init__(self, msg):
super(ParsingError, self).__init__(msg)