Skip to content

Commit

Permalink
Added argparse as requirement on py26, increment version number for r…
Browse files Browse the repository at this point in the history
…elease.
  • Loading branch information
mdshw5 committed Sep 4, 2014
1 parent 045f7a8 commit 84c9fb5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions pyfaidx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ def __init__(self, filename, default_seq=None, key_function=None,
as_raw=False, strict_bounds=False):
"""
filename: name of fasta file
key_function: optional callback function which should return a unique key for the self.index dictionary when given rname.
as_raw: optional parameter to specify whether to return sequences as a Sequence() object or as a raw string. Default: False (i.e. return a Sequence() object).
key_function: optional callback function which should return a unique
key for the self.index dictionary when given rname.
as_raw: optional parameter to specify whether to return sequences as a
Sequence() object or as a raw string.
Default: False (i.e. return a Sequence() object).
"""
self.filename = filename
self.file = open(filename, 'rb')
Expand Down Expand Up @@ -186,8 +189,11 @@ def read_fai(self):
rname, rlen, offset, lenc, lenb = line.split('\t')
rname = self.key_function(rname)
if rname in self.index:
raise ValueError('Duplicate key "%s"'%rname)
self.index[rname] = IndexRecord(*map(int, (rlen, offset, lenc, lenb)))
raise ValueError('Duplicate key "%s"' % rname)
self.index[rname] = IndexRecord(*map(int, (rlen,
offset,
lenc,
lenb)))

def build_index(self):
with open(self.filename, 'r') as fastafile:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

install_requires = ['six']
if sys.version_info[0] == 2 and sys.version_info[1] == 6:
install_requires.append('ordereddict')
install_requires.extend(['ordereddict', 'argparse'])


setup(
name='pyfaidx',
provides='pyfaidx',
version='0.2.5',
version='0.2.6',
author='Matthew Shirley',
author_email='[email protected]',
url='http://mattshirley.com',
Expand Down

0 comments on commit 84c9fb5

Please sign in to comment.