Skip to content

Commit

Permalink
don't try to update exp file if no new ofns present
Browse files Browse the repository at this point in the history
  • Loading branch information
Clare72 committed Oct 6, 2023
1 parent ff16bdf commit 6bd1394
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/ontology/VFB_scRNAseq.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ $(TMPDIR)/excluded_datasets_and_assays.tsv: get_FB_data | $(TMPDIR)

.PHONY: make_exp_ofns
# check whether ofn exists for each tsv, delete tsv if true, make ofn then delete tsv if false.
make_exp_ofns: install_linkml #process_FB_expdata
make_exp_ofns: install_linkml process_FB_expdata
for file in $(wildcard $(EXPDIR)/*.tsv); do \
if [ -e $${file%.tsv}.ofn ]; then \
rm $$file; \
Expand Down Expand Up @@ -133,20 +133,23 @@ endif
echo "\nOntology source file updated!\n"

$(COMPONENTSDIR)/expression_data.owl: make_exp_ofns | $(COMPONENTSDIR)
ifeq ($(REFRESH_EXP),TRUE)
$(ROBOT) merge --inputs "$(EXPDIR)/*.ofn" \
-o $(TMPDIR)/expression_data.owl
else
$(ROBOT) merge --input $@ --inputs "$(EXPDIR)/*.ofn" \
-o $(TMPDIR)/expression_data.owl
endif
$(ROBOT) annotate --input $(TMPDIR)/expression_data.owl \
--ontology-iri "http://purl.obolibrary.org/obo/VFB_scRNAseq/components/expression_data.owl" \
convert --format ofn -o [email protected] &&\
cat [email protected] | sed -e 's/(neo_custom:expression_\([a-z]\+\) "\([0-9]\+\.[0-9]\+\)")/(neo_custom:expression_\1 "\2"^^xsd:float)/g' -e 's/(neo_custom:hide_in_terminfo "\([a-z]\+\)")/(neo_custom:hide_in_terminfo "\1"^^xsd:boolean)/g' > $@ &&\
gzip -c $@ > [email protected] &&\
rm -f $(EXPDIR)/*.ofn [email protected] &&\
echo "\nGene expression file updated!\n"
@if [ -e $(EXPDIR)/*.ofn ]; then \
if [ "$(REFRESH_EXP)" = "TRUE" ]; then \
$(ROBOT) merge --inputs "$(EXPDIR)/*.ofn" \
annotate --ontology-iri "http://purl.obolibrary.org/obo/VFB_scRNAseq/components/expression_data.owl" \
convert --format ofn -o $@.tmp; \
elif [ -n "$(wildcard $(EXPDIR)/*.ofn)" ]; then \
$(ROBOT) merge --input $@ --inputs "$(EXPDIR)/*.ofn" \
annotate --ontology-iri "http://purl.obolibrary.org/obo/VFB_scRNAseq/components/expression_data.owl" \
convert --format ofn -o $@.tmp; \
fi; \
cat $@.tmp | sed -e 's/(neo_custom:expression_\([a-z]\+\) "\([0-9]\+\.[0-9]\+\)")/(neo_custom:expression_\1 "\2"^^xsd:float)/g' -e 's/(neo_custom:hide_in_terminfo "\([a-z]\+\)")/(neo_custom:hide_in_terminfo "\1"^^xsd:boolean)/g' > $@ && \
gzip -c $@ > $@.gz && \
rm -f $(EXPDIR)/*.ofn $@.tmp && \
echo "\nGene expression file updated!\n"; \
else \
echo "\nNo changes to gene expression file!\n"; \
fi

# add VFB iri
$(ONT).owl: $(ONT)-full.owl
Expand Down

0 comments on commit 6bd1394

Please sign in to comment.