-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
108 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
class BamFileNotFound(Exception): | ||
|
||
def __init__(self, filepath=None, patient_id=None, filetype=None): | ||
self.filepath = filepath | ||
self.patient_id = patient_id | ||
self.filetype = 'Bamfile' if filetype is None else filetype | ||
|
||
def __str__(self): | ||
if self.patient_id is not None: | ||
patient_str = 'Patient {}'.format(self.patient_id) | ||
else: | ||
patient_str = 'Patient' | ||
|
||
if self.filepath is not None: | ||
print_str = 'The {} ({}) for {} was not found.'.format(self.filetype, repr(self.filepath), patient_str) | ||
else: | ||
print_str = '{} has no {}.'.format(patient_str, self.filetype) | ||
return print_str | ||
|
||
class RNABamFileNotFound(BamFileNotFound): | ||
def __init__(self, filetype='tumor RNA Bamfile', *args, **kwargs): | ||
super().__init__(filetype=filetype, *args, **kwargs) | ||
|
||
class TumorBamFileNotFound(BamFileNotFound): | ||
def __init__(self, filetype='tumor sample bamfile', *args, **kwargs): | ||
super().__init__(filetype=filetype, *args, **kwargs) | ||
|
||
class NormalBamFileNotFound(BamFileNotFound): | ||
def __init__(self, filetype='normal sample bamfile', *args, **kwargs): | ||
super().__init__(filetype=filetype, *args, **kwargs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters