Skip to content

Commit

Permalink
download stable ncbi version and add version
Browse files Browse the repository at this point in the history
  • Loading branch information
anitacaron committed Sep 18, 2023
1 parent 73d2f8d commit ef38468
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit ef38468

Please sign in to comment.