Skip to content

Commit

Permalink
fix for KoslickiLab#20, added other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmudhera committed Aug 30, 2022
1 parent f156f4d commit acd3c97
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/get_reference_genomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def download_FNA_file(self, path, current_directory_name): # download all FASTA

def download_GBFF_file(self,path, current_directory_name):
ftp = self.ftp
path = self.make_file(os.path.join(path, f"{current_directory_name}"))
#path = self.make_file(os.path.join(path, f"{current_directory_name}"))
for filename in ftp.nlst():
if filename.endswith(".gbff.gz"):
completeName = os.path.join(path, filename)
Expand Down Expand Up @@ -201,12 +201,15 @@ def main():
break

# download selected genome and gbff
print('Downloading genome: ' + current_directory_name)

try:
helper.download_FNA_file(path, current_directory_name)
helper.download_GBFF_file(path, current_directory_name)
except EOFError:
print(path, current_directory_name)
print('Exiting for now')
print('Problem downloading genome ' + current_directory_name + ' due to a closed onnection, skipping this.')
cmd = 'rm -rf ' + path+'/'+current_directory_name
print(cmd)
exit(-1)
continue
total_downloaded += 1
Expand Down

0 comments on commit acd3c97

Please sign in to comment.