Skip to content

Commit

Permalink
Throw a warning instead of an exception when a GFF target feature doe…
Browse files Browse the repository at this point in the history
…s not exist
  • Loading branch information
abretaud committed Nov 6, 2018
1 parent 4448f78 commit 457b104
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ $ chakin feature load_fasta \
## History
- 2.2.3
- Throw a warning instead of an exception when a GFF target feature does not exist
- 2.2.2
- Bug fixes and improvements to the expression module
Expand Down
9 changes: 6 additions & 3 deletions chado/feature/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,8 @@ def _add_target(self, feat, target_str):

target = target_str.split(' ')
if len(target) != 3 and len(target) != 4:
raise Exception('Malformed Target value: {}'.format(target_str))
warn('Malformed Target value: {}, skipping'.format(target_str))
return

strand = 1
if len(target) == 4:
Expand All @@ -1148,7 +1149,8 @@ def _add_target(self, feat, target_str):
elif target[3] == '-':
strand = -1
else:
raise Exception('Malformed Target value (bad strand): {}'.format(target_str))
warn('Malformed Target value (bad strand): {}, skipping'.format(target_str))
return

landmark_str = target[0]
landmark = None
Expand All @@ -1164,7 +1166,8 @@ def _add_target(self, feat, target_str):
break

if landmark is None:
raise Exception('Malformed Target value (unknown target): {}'.format(target_str))
warn('Malformed Target value (unknown target): {}, skipping'.format(target_str))
return

self._do_add_featureloc(landmark, feat, rank, start, end, strand)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="chado",
version='2.2.2',
version='2.2.3',
description="Chado library",
author="Anthony Bretaudeau",
author_email="[email protected]",
Expand Down

0 comments on commit 457b104

Please sign in to comment.