Skip to content

Commit

Permalink
fix framed dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
cdanielmachado committed Oct 1, 2019
1 parent 47de13b commit 7eb898a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ carveme.egg-info/*

docs/_build/*
Dockerfile
.idea/encodings.xml
10 changes: 9 additions & 1 deletion carveme/reconstruction/ncbi_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def load_ncbi_table(inputfile):
return table


def download_ncbi_genome(accession, refseq_table, prefer_protein=True):
def download_ncbi_genome(accession, refseq_table, prefer_protein=True, overwrite=False):

if accession not in refseq_table.index:
print('Invalid accession code')
Expand All @@ -27,6 +27,10 @@ def download_ncbi_genome(accession, refseq_table, prefer_protein=True):

outputfile = '{}.faa.gz'.format(accession)

if os.path.exists(outputfile) and not overwrite:
print('File exists, skipping.')
return outputfile

_, result = urllib.request.urlretrieve(url, outputfile)

if result.get_content_type() != 'application/x-gzip':
Expand All @@ -40,6 +44,10 @@ def download_ncbi_genome(accession, refseq_table, prefer_protein=True):

outputfile = '{}.fna.gz'.format(accession)

if os.path.exists(outputfile) and not overwrite:
print('File exists, skipping.')
return outputfile

_, result = urllib.request.urlretrieve(url, outputfile)

if result.get_content_type() != 'application/x-gzip':
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
framed==0.5.1
framed>=0.5
pandas>=0.20.0
requests>=2.18

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
readme = readme_file.read()

requirements = [
"framed==0.5.1",
"framed>=0.5",
"pandas>=0.20.0",
"requests>=2.18"
]
Expand Down

0 comments on commit 7eb898a

Please sign in to comment.