Spaces:
Running
Running
Update mtdna_classifier.py
Browse files- mtdna_classifier.py +2 -2
mtdna_classifier.py
CHANGED
|
@@ -242,12 +242,12 @@ def infer_location_fromNCBI(accession):
|
|
| 242 |
handle.close()
|
| 243 |
match = re.search(r'/(geo_loc_name|country|location)\s*=\s*"([^"]+)"', text)
|
| 244 |
if match:
|
| 245 |
-
return match.group(2) # This is the value like "Brunei"
|
| 246 |
return None
|
| 247 |
|
| 248 |
except Exception as e:
|
| 249 |
print("❌ Entrez error:", e)
|
| 250 |
-
return ""
|
| 251 |
|
| 252 |
|
| 253 |
# STEP 5: Main pipeline: accession -> 1. get pubmed id and isolate -> 2. get doi -> 3. get text -> 4. prediction -> 5. output: inferred location + explanation + confidence score
|
|
|
|
| 242 |
handle.close()
|
| 243 |
match = re.search(r'/(geo_loc_name|country|location)\s*=\s*"([^"]+)"', text)
|
| 244 |
if match:
|
| 245 |
+
return match.group(2), match.group(0) # This is the value like "Brunei"
|
| 246 |
return None
|
| 247 |
|
| 248 |
except Exception as e:
|
| 249 |
print("❌ Entrez error:", e)
|
| 250 |
+
return "",""
|
| 251 |
|
| 252 |
|
| 253 |
# STEP 5: Main pipeline: accession -> 1. get pubmed id and isolate -> 2. get doi -> 3. get text -> 4. prediction -> 5. output: inferred location + explanation + confidence score
|