-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ingest): Format ingested country: division
into geoLocCountry, geoLocAdmin1, geoLocAdmin2
#2991
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Cornelius Roemer <[email protected]>
Co-authored-by: Cornelius Roemer <[email protected]>
anna-parker
changed the title
WIP: Format_country
feat(ingest): Format ingested Oct 11, 2024
country: division
into geoLocCountry, geoLocAdmin1, geoLocAdmin2
Still need to map the output of division and location into geoLocAdmin1 and geoLocAdmin2 - this should be done in a separate rule and then joined with other metadata fields, maybe in prepare data. |
2 tasks
corneliusroemer
force-pushed
the
format_authors
branch
2 times, most recently
from
October 18, 2024 14:58
533f051
to
f480d67
Compare
Closing as I improved this in #3026 by using |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #
preview URL: https://format-country.loculus.org/
Summary
We have mentioned in the past it would be good to break down NCBI's geoloc field. This is of the format:
country: division
, where division can normally be further split into geoLocAdmin1 and geoLocAdmin2.Sadly the format of the division field is inconsistent. For example for the US some samples have
or use the abbreviation. This means to extract more specific details we will need to do string matching. It also became clear to me that NIH does not clean their sequences based on the common occurrence of
state, city
otherscity, state
, yet others do not separate state with a,
butConneticut
.Astrahan
is another example of this. I have now added a list of common misspellings, potentially in future we could use fuzzy matching for this.I got chatgpt to write me up some nice yaml lists with all states/regions/provinces for countries where we have a lot of samples with geoLocAdmin1 information.
By default for unmapped countries I keep the mapping as is:
division
is mapped togeoLocAdmin1
.For mapped countries I put the state(region/province) in
geoLocAdmin1
if thedivision
matches the state (division
must include the state name). I put the entiredivision
string intogeoLocAdmin2
as well - unless it is an exact match for the state, then I do not additionally add it togeoLocAdmin2
(to avoid duplication). If no state matchesdivision
I put the entiredivision
string ingeoLocAdmin2
.Potential Alternatives
Screenshot
Previous list of
geoLocAdmin1
fields:New formatting:
PR Checklist