Permalink
Browse files

Assume stranded features for bad LOCUS link GenBank files.

i.e. Default to assuming nucleotides (and so stranded features)
rather then amino acids (where the protein features have no strand)

Based on an issue reported by Kai Blin.

Unit test to follow...
  • Loading branch information...
1 parent 21cd969 commit 18399310c2532632657c1c0c47381214c691b23d @peterjc peterjc committed Jun 17, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 Bio/GenBank/__init__.py
@@ -969,12 +969,12 @@ def location(self, content):
assert location_line.endswith(")")
location_line = location_line[11:-1]
strand = -1
- elif 'DNA' in self._seq_type.upper() or 'RNA' in self._seq_type.upper():
- #Nucleotide
- strand = 1
- else:
- #Protein
+ elif "PROTEIN" in self._seq_type.upper():
strand = None
+ else:
+ #Assume nucleotide otherwise feature strand for
+ #GenBank files with bad LOCUS lines set to None
+ strand = 1
#Special case handling of the most common cases for speed
if _re_simple_location.match(location_line):

0 comments on commit 1839931

Please sign in to comment.