Spaces:
Running
Running
Update pipeline.py
Browse files- pipeline.py +10 -0
pipeline.py
CHANGED
@@ -83,6 +83,15 @@ def download_file_from_drive(remote_name, folder_id, local_path):
|
|
83 |
while not done:
|
84 |
_, done = downloader.next_chunk()
|
85 |
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
def run_with_timeout(func, args=(), kwargs={}, timeout=20):
|
88 |
"""
|
@@ -198,6 +207,7 @@ def pipeline_with_gemini(accessions):
|
|
198 |
all_exists = download_file_from_drive(all_filename, sample_folder_id, file_all_path)
|
199 |
print("chunk exist: ", chunk_exists)
|
200 |
# first way: ncbi method
|
|
|
201 |
if country.lower() != "unknown":
|
202 |
stand_country = standardize_location.smart_country_lookup(country.lower())
|
203 |
print("stand_country: ", stand_country)
|
|
|
83 |
while not done:
|
84 |
_, done = downloader.next_chunk()
|
85 |
return True
|
86 |
+
def download_drive_file_content(file_id):
|
87 |
+
request = drive_service.files().get_media(fileId=file_id)
|
88 |
+
fh = io.BytesIO()
|
89 |
+
downloader = MediaIoBaseDownload(fh, request)
|
90 |
+
done = False
|
91 |
+
while not done:
|
92 |
+
_, done = downloader.next_chunk()
|
93 |
+
fh.seek(0)
|
94 |
+
return fh.read().decode("utf-8")
|
95 |
|
96 |
def run_with_timeout(func, args=(), kwargs={}, timeout=20):
|
97 |
"""
|
|
|
207 |
all_exists = download_file_from_drive(all_filename, sample_folder_id, file_all_path)
|
208 |
print("chunk exist: ", chunk_exists)
|
209 |
# first way: ncbi method
|
210 |
+
print("country.lower: ",country.lower())
|
211 |
if country.lower() != "unknown":
|
212 |
stand_country = standardize_location.smart_country_lookup(country.lower())
|
213 |
print("stand_country: ", stand_country)
|