Skip to content

Commit

Permalink
Make downloader recogise ERR accessions.
Browse files Browse the repository at this point in the history
Relates to #16
  • Loading branch information
s-andrews committed Oct 19, 2021
1 parent d293b6b commit 725c60c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sradownloader
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def download_sample_ena (sample, options):
for line in response:
line = line.decode("UTF-8").strip()
print(line)
if line.startswith("SRR"):
if line.startswith("SRR") or line.startswith("ERR"):
found_accession_line = True
sections = line.split("\t")

Expand Down Expand Up @@ -255,8 +255,8 @@ def read_samples (options):

# The sample_file might be one of three things
# 1. An SRA RunTable file
# 2. A simple file of SRR accessions
# 3. An SRR accession (not a file name)
# 2. A simple file of SRR/ERR accessions
# 3. An SRR/ERR accession (not a file name)
#
# We need to account for all of these

Expand Down Expand Up @@ -316,7 +316,7 @@ def read_samples (options):

except FileNotFoundError as err:
# This could be a bare accession
if sample_file.startswith("SRR"):
if sample_file.startswith("SRR") or sample_file.startswith("ERR"):
sample_name = ""
if not options.nogeo :
sample_name = get_geo_name(sample_file, options)
Expand Down

0 comments on commit 725c60c

Please sign in to comment.