Skip to content

Commit

Permalink
Catch variable nreads, fix #1
Browse files Browse the repository at this point in the history
Thanks @victorfica for the suggestion.
  • Loading branch information
bruvellu committed Aug 1, 2017
1 parent 9ddc2c3 commit 7c41913
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sra.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ def extract(self):
self.instrument_model = fields['instrument_model']
self.taxon_id = int(fields['taxon_id'])
self.scientific_name = fields['scientific_name']
self.nreads = int(fields['nreads'])
# Catch nreads="variable". See https://github.com/nelas/sra.py/issues/1
try:
self.nreads = int(fields['nreads'])
except:
self.nreads = 1
self.read_average = int(float(fields['read_average']))
self.run_accession = fields['run_accession']
if self.run_accession:
Expand Down

0 comments on commit 7c41913

Please sign in to comment.