Skip to content
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

Download stable NCBI version #85

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ all: ncbitaxon.owl ncbitaxon.obo ncbitaxon.json ncbi_diff_latest_current_obo.txt
all: ncbitaxon.owl.gz ncbitaxon.obo.gz ncbitaxon.json.gz

ROBOT=robot
DATE=$(shell date '+%Y-%m-01')

.PHONY: clean
clean:
Expand All @@ -12,7 +13,7 @@ build:
mkdir -p $@

build/taxdmp.zip: | build
curl -L -o $@ https://ftp.ncbi.nih.gov/pub/taxonomy/taxdmp.zip
curl -L -o $@ https://ftp.ncbi.nih.gov/pub/taxonomy/taxdump_archive/taxdmp_$(DATE).zip

ncbitaxon.ttl: src/ncbitaxon.py build/taxdmp.zip
python3 $^ $@
Expand Down
2 changes: 2 additions & 0 deletions src/ncbitaxon.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def convert(taxdmp_path, output_path, taxa=None):
citations = defaultdict(list)
with open(output_path, "w") as output:
isodate = date.today().isoformat()
ncbi_date = date.today().replace(day=1)
output.write(
f"""@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
Expand All @@ -205,6 +206,7 @@ def convert(taxdmp_path, output_path, taxa=None):
; terms:description "An ontology representation of the NCBI organismal taxonomy"
; terms:license <https://creativecommons.org/publicdomain/zero/1.0/>
; rdfs:comment "Built by https://github.com/obophenotype/ncbitaxon"^^xsd:string
; rdfs:comment "NCBI organismal taxonomy version {ncbi_date}"^^xsd:string
.

obo:IAO_0000115 a owl:AnnotationProperty
Expand Down