diff --git a/src/ontology/dpo.Makefile b/src/ontology/dpo.Makefile index 2938f1c..0cff934 100644 --- a/src/ontology/dpo.Makefile +++ b/src/ontology/dpo.Makefile @@ -28,6 +28,24 @@ tmp/remaining_classes.txt: tmp/all_patternised_classes.txt tmp/all_defined_class tmp/remaining_definitions.owl: $(SRC) tmp/remaining_classes.txt $(ROBOT) filter -i $< -T tmp/remaining_classes.txt --axioms "equivalent annotation" --trim false -o $@ +########################## +##### Pattern labels ##### +########################## + +# all filenames for pattern tsvs +ALL_DOSDP_TSVs = $(wildcard $(PATTERNDIR)/data/default/*.tsv) + +$(TMPDIR)/$(ONT)-merged.db: $(SRC) + $(ROBOT) merge -i $< -o $(TMPDIR)/$(ONT)-merged.owl + semsql make $@ + +update_pattern_labels: $(TMPDIR)/$(ONT)-merged.db + wget -O $(SCRIPTSDIR)/update_term_labels_in_file.py https://raw.githubusercontent.com/FlyBase/flybase-ontology-scripts/master/update_term_labels_in_file/src/update_term_labels_in_file.py + for file in $(ALL_DOSDP_TSVs) ; do \ + python3 $(SCRIPTSDIR)/update_term_labels_in_file.py -f $$file -i auto -c $< ; \ + done + + ################################## ##### Custom mirroring rules ##### ################################## diff --git a/src/patterns/data/default/abnormalAbsenceOfBiologicalProcess.tsv b/src/patterns/data/default/abnormalAbsenceOfBiologicalProcess.tsv index f930682..003b734 100644 --- a/src/patterns/data/default/abnormalAbsenceOfBiologicalProcess.tsv +++ b/src/patterns/data/default/abnormalAbsenceOfBiologicalProcess.tsv @@ -1,3 +1,3 @@ -defined_class defined_class_label biological_process biological_process_label -FBcv:0000418 flightless GO:0060361 flight -FBcv:0000389 paralytic GO:0050879 multicellular organismal movement \ No newline at end of file +defined_class defined_class_label biological_process biological_process_label +FBcv:0000418 flightless GO:0060361 flight +FBcv:0000389 paralytic GO:0050879 multicellular organismal movement diff --git a/src/patterns/data/default/abnormalAnatomicalEntity.tsv b/src/patterns/data/default/abnormalAnatomicalEntity.tsv index 2355d32..bdf5b2d 100644 --- a/src/patterns/data/default/abnormalAnatomicalEntity.tsv +++ b/src/patterns/data/default/abnormalAnatomicalEntity.tsv @@ -1,2 +1,2 @@ -defined_class defined_class_label anatomical_entity anatomical_entity_label -FBcv:0000435 neuroanatomy defective FBbt:00005093 nervous system \ No newline at end of file +defined_class defined_class_label anatomical_entity anatomical_entity_label +FBcv:0000435 abnormal neuroanatomy FBbt:00005093 nervous system diff --git a/src/patterns/data/default/abnormalBehavior.tsv b/src/patterns/data/default/abnormalBehavior.tsv index a587366..9b16508 100644 --- a/src/patterns/data/default/abnormalBehavior.tsv +++ b/src/patterns/data/default/abnormalBehavior.tsv @@ -1,25 +1,25 @@ defined_class defined_class_label behavior_process behavior_process_label -FBcv:0000387 behavior defective GO:0007610 behavior -FBcv:0000403 chemosensitive behavior defective GO:0007635 chemosensory behavior -FBcv:0000679 circadian behavior defective GO:0048512 circadian behavior -FBcv:0000396 eclosion rhythm defective GO:0008062 eclosion rhythm -FBcv:0000419 feeding behavior defective GO:0007631 feeding behavior -FBcv:0000420 grooming behavior defective GO:0007625 grooming behavior -FBcv:0000669 hatching behavior defective GO:0035187 hatching behavior -FBcv:0000720 jump response defective GO:0007630 jump response -FBcv:0000397 learning defective GO:0007612 learning -FBcv:0000414 locomotor behavior defective GO:0007626 locomotory behavior -FBcv:0000395 locomotor rhythm defective GO:0045475 locomotor rhythm -FBcv:0000401 mating rhythm defective GO:0035648 circadian mating behavior -FBcv:0000398 memory defective GO:0007613 memory -FBcv:0000412 optomotor response defective GO:0007634 optokinetic behavior -FBcv:0006004 oviposition defective GO:0018991 oviposition -FBcv:0000680 proboscis extension reflex defective GO:0007637 proboscis extension reflex -FBcv:0000402 song defective GO:0045433 "male courtship behavior, veined wing generated song production" -FBcv:0000411 visual behavior defective GO:0007632 visual behavior -FBcv:0000721 mating behavior defective GO:0007617 mating behavior -FBcv:0000400 mating defective GO:0007618 mating -FBcv:0000399 courtship behavior defective GO:0007619 courtship behavior +FBcv:0000387 abnormal behavior GO:0007610 behavior +FBcv:0000403 abnormal chemosensory behavior GO:0007635 chemosensory behavior +FBcv:0000679 abnormal circadian behavior GO:0048512 circadian behavior +FBcv:0000396 abnormal eclosion rhythm GO:0008062 eclosion rhythm +FBcv:0000419 abnormal feeding behavior GO:0007631 feeding behavior +FBcv:0000420 abnormal grooming behavior GO:0007625 grooming behavior +FBcv:0000669 abnormal hatching behavior GO:0035187 hatching behavior +FBcv:0000720 abnormal jump response GO:0007630 jump response +FBcv:0000397 abnormal learning GO:0007612 learning +FBcv:0000414 abnormal locomotor behavior GO:0007626 locomotory behavior +FBcv:0000395 abnormal locomotor rhythm GO:0045475 locomotor rhythm +FBcv:0000401 abnormal mating rhythm GO:0035648 circadian mating behavior +FBcv:0000398 abnormal memory GO:0007613 memory +FBcv:0000412 abnormal optomotor response GO:0007634 optokinetic behavior +FBcv:0006004 abnormal oviposition GO:0018991 egg-laying behavior +FBcv:0000680 abnormal proboscis extension reflex GO:0007637 proboscis extension reflex +FBcv:0000402 abnormal song GO:0045433 male courtship behavior, veined wing generated song production +FBcv:0000411 abnormal visual behavior GO:0007632 visual behavior +FBcv:0000721 abnormal mating behavior GO:0007617 mating behavior +FBcv:0000400 abnormal mating GO:0007618 mating +FBcv:0000399 abnormal courtship behavior GO:0007619 courtship behavior FBcv:0007500 abnormal anesthesia-resistant memory GO:0007615 anesthesia-resistant memory FBcv:0007501 abnormal short-term memory GO:0007614 short-term memory FBcv:0007502 abnormal medium-term memory GO:0072375 medium-term memory @@ -29,4 +29,4 @@ FBcv:0000416 uncoordinated NBO:0000339 motor coordination FBcv:0000421 abnormal touch response NBO:0000332 touch related behavior FBcv:0007527 abnormal adult walking behavior GO:0007628 adult walking behavior FBcv:0007528 abnormal larval locomotory behavior GO:0008345 larval locomotory behavior -FBcv:0007529 abnormal adult locomotory behavior GO:0008344 adult locomotory behavior \ No newline at end of file +FBcv:0007529 abnormal adult locomotory behavior GO:0008344 adult locomotory behavior diff --git a/src/patterns/data/default/abnormalBiologicalProcess.tsv b/src/patterns/data/default/abnormalBiologicalProcess.tsv index debd8bc..1d6097d 100644 --- a/src/patterns/data/default/abnormalBiologicalProcess.tsv +++ b/src/patterns/data/default/abnormalBiologicalProcess.tsv @@ -1,43 +1,43 @@ defined_class defined_class_label biological_process biological_process_label -FBcv:0000384 aging defective GO:0007568 aging -FBcv:0000407 auditory perception defective GO:0007605 sensory perception of sound -FBcv:0000686 axis specification defective GO:0009798 axis specification -FBcv:0000668 cell adhesion defective GO:0007155 cell adhesion -FBcv:0000671 cell cycle defective GO:0007049 cell cycle -FBcv:0000424 cell death defective GO:0008219 cell death -FBcv:0000427 cell growth defective GO:0016049 cell growth -FBcv:0000716 cell migration defective GO:0016477 cell migration -FBcv:0000394 circadian rhythm defective GO:0007623 circadian rhythm -FBcv:0000684 cold stress response defective GO:0009409 response to cold -FBcv:0006000 copulation defective GO:0007620 copulation -FBcv:0000433 cytokinesis defective GO:0000910 cytokinesis -FBcv:0000706 diapause defective GO:0055115 entry into diapause -FBcv:0000423 DNA repair defective GO:0006281 DNA repair -FBcv:0000324 dorsal/ventral axis specification defective GO:0009950 dorsal/ventral axis specification -FBcv:0000670 eclosion defective GO:0007562 eclosion -FBcv:0000672 endomitotic cell cycle defective GO:0007113 endocytosis -FBcv:0000417 flight defective GO:0060361 flight -FBcv:0000388 gravitaxis defective GO:0048060 negative gravitaxis -FBcv:0000410 heat stress response defective GO:0009408 response to heat -FBcv:0000448 immune response defective GO:0006955 immune response -FBcv:0000431 meiotic cell cycle defective GO:0051321 meiotic cell cycle -FBcv:0000432 mitotic cell cycle defective GO:0000278 mitotic cell cycle -FBcv:0000409 osmotic stress response defective GO:0006970 response to osmotic stress -FBcv:0000725 oxidative stress response defective GO:0006979 response to oxidative stress -FBcv:0000393 pain response defective GO:0048265 response to pain +FBcv:0000384 abnormal aging GO:0007568 obsolete aging +FBcv:0000407 abnormal auditory perception GO:0007605 sensory perception of sound +FBcv:0000686 abnormal axis specification GO:0009798 axis specification +FBcv:0000668 abnormal cell adhesion GO:0007155 cell adhesion +FBcv:0000671 abnormal cell cycle GO:0007049 cell cycle +FBcv:0000424 abnormal cell death GO:0008219 cell death +FBcv:0000427 abnormal cell growth GO:0016049 cell growth +FBcv:0000716 abnormal cell migration GO:0016477 cell migration +FBcv:0000394 abnormal circadian rhythm GO:0007623 circadian rhythm +FBcv:0000684 abnormal cold stress response GO:0009409 response to cold +FBcv:0006000 abnormal copulation GO:0007620 copulation +FBcv:0000433 abnormal cytokinesis GO:0000910 cytokinesis +FBcv:0000706 abnormal diapause GO:0055115 entry into diapause +FBcv:0000423 abnormal DNA repair GO:0006281 DNA repair +FBcv:0000324 abnormal dorsal/ventral axis specification GO:0009950 dorsal/ventral axis specification +FBcv:0000670 abnormal eclosion GO:0007562 eclosion +FBcv:0000672 abnormal endomitotic cell cycle GO:0007113 endomitotic cell cycle +FBcv:0000417 abnormal flight GO:0060361 flight +FBcv:0000388 abnormal gravitaxis GO:0048060 negative gravitaxis +FBcv:0000410 abnormal heat stress response GO:0009408 response to heat +FBcv:0000448 abnormal immune response GO:0006955 immune response +FBcv:0000431 abnormal meiotic cell cycle GO:0051321 meiotic cell cycle +FBcv:0000432 abnormal mitotic cell cycle GO:0000278 mitotic cell cycle +FBcv:0000409 abnormal osmotic stress response GO:0006970 response to osmotic stress +FBcv:0000725 abnormal oxidative stress response GO:0006979 response to oxidative stress +FBcv:0000393 abnormal pain response GO:0048265 response to pain FBcv:0000422 photoperiod response variant GO:0043153 entrainment of circadian clock by photoperiod -FBcv:0000413 phototaxis defective GO:0042331 phototaxis -FBcv:0000449 planar polarity defective GO:0001736 establishment of planar polarity -FBcv:0000707 reproductive diapause defective GO:0055116 entry into reproductive diapause -FBcv:0000681 sensory perception defective GO:0007600 sensory perception -FBcv:0000436 sex-determination defective GO:0007530 sex determination -FBcv:0000705 sleep defective GO:0030431 sleep -FBcv:0000404 smell perception defective GO:0007608 sensory perception of smell -FBcv:0000708 starvation stress response defective GO:0042594 response to starvation -FBcv:0000408 stress response defective GO:0006950 response to stress -FBcv:0000405 taste perception defective GO:0050909 sensory perception of taste -FBcv:0000683 temperature response defective GO:0009266 response to temperature stimulus -FBcv:0000002 thermotaxis defective GO:0043052 thermotaxis -FBcv:0000682 touch perception defective GO:0050975 sensory perception of touch -FBcv:0004000 visual perception defective GO:0050953 response to light stimulus -FBcv:0000451 wound healing defective GO:0042060 wound healing +FBcv:0000413 abnormal phototaxis GO:0042331 phototaxis +FBcv:0000449 abnormal planar polarity GO:0001736 establishment of planar polarity +FBcv:0000707 abnormal reproductive diapause GO:0055116 entry into reproductive diapause +FBcv:0000681 abnormal sensory perception GO:0007600 sensory perception +FBcv:0000436 abnormal sex-determination GO:0007530 sex determination +FBcv:0000705 abnormal sleep GO:0030431 sleep +FBcv:0000404 abnormal smell perception GO:0007608 sensory perception of smell +FBcv:0000708 abnormal starvation stress response GO:0042594 response to starvation +FBcv:0000408 abnormal stress response GO:0006950 response to stress +FBcv:0000405 abnormal taste perception GO:0050909 sensory perception of taste +FBcv:0000683 abnormal temperature response GO:0009266 response to temperature stimulus +FBcv:0000002 abnormal thermotaxis GO:0043052 thermotaxis +FBcv:0000682 abnormal touch perception GO:0050975 sensory perception of touch +FBcv:0004000 abnormal visual perception GO:0050953 sensory perception of light stimulus +FBcv:0000451 abnormal wound healing GO:0042060 wound healing diff --git a/src/patterns/data/default/abnormalNumberOfAnatomicalEntity.tsv b/src/patterns/data/default/abnormalNumberOfAnatomicalEntity.tsv index ceffe4b..712c9c9 100644 --- a/src/patterns/data/default/abnormalNumberOfAnatomicalEntity.tsv +++ b/src/patterns/data/default/abnormalNumberOfAnatomicalEntity.tsv @@ -1,2 +1,2 @@ defined_class defined_class_label anatomical_entity anatomical_entity_label -FBcv:0000709 cell number defective CL:0000000 cell +FBcv:0000709 abnormal cell number CL:0000000 cell diff --git a/src/patterns/data/default/abnormalPigmentationOfAnatomicalEntity.tsv b/src/patterns/data/default/abnormalPigmentationOfAnatomicalEntity.tsv index 8a2c88e..2a06f35 100644 --- a/src/patterns/data/default/abnormalPigmentationOfAnatomicalEntity.tsv +++ b/src/patterns/data/default/abnormalPigmentationOfAnatomicalEntity.tsv @@ -1,3 +1,3 @@ -defined_class defined_class_label anatomical_entity anatomical_entity_label -FBcv:0000356 body color defective FBbt:00000001 organism -FBcv:0000355 eye color defective FBbt:00004508 eye \ No newline at end of file +defined_class defined_class_label anatomical_entity anatomical_entity_label +FBcv:0000356 abnormal body color FBbt:00000001 organism +FBcv:0000355 abnormal eye color FBbt:00004508 eye diff --git a/src/patterns/data/default/abnormalShapeOfPhysicalEntity.tsv b/src/patterns/data/default/abnormalShapeOfPhysicalEntity.tsv index e70ec16..14172cb 100644 --- a/src/patterns/data/default/abnormalShapeOfPhysicalEntity.tsv +++ b/src/patterns/data/default/abnormalShapeOfPhysicalEntity.tsv @@ -1,2 +1,2 @@ -defined_class defined_class_label entity entity_label -FBcv:0000429 cell shape defective CL:0000000 cell \ No newline at end of file +defined_class defined_class_label entity entity_label +FBcv:0000429 abnormal cell shape CL:0000000 cell diff --git a/src/patterns/data/default/abnormalSizeOfAnatomicalEntity.tsv b/src/patterns/data/default/abnormalSizeOfAnatomicalEntity.tsv index f30839e..d2a2653 100644 --- a/src/patterns/data/default/abnormalSizeOfAnatomicalEntity.tsv +++ b/src/patterns/data/default/abnormalSizeOfAnatomicalEntity.tsv @@ -1,4 +1,4 @@ -defined_class defined_class_label entity entity_label -FBcv:0000665 body size defective FBbt:00000001 organism -FBcv:0000428 cell size defective CL:0000000 cell -FBcv:0000357 size defective FBbt:00007001 anatomical structure \ No newline at end of file +defined_class defined_class_label entity entity_label +FBcv:0000665 abnormal body size FBbt:00000001 organism +FBcv:0000428 abnormal cell size CL:0000000 cell +FBcv:0000357 abnormal size FBbt:00007001 anatomical structure diff --git a/src/patterns/data/default/abnormallyDecreasedEfficacyOfBehavior.tsv b/src/patterns/data/default/abnormallyDecreasedEfficacyOfBehavior.tsv index 4000a64..aa9882f 100644 --- a/src/patterns/data/default/abnormallyDecreasedEfficacyOfBehavior.tsv +++ b/src/patterns/data/default/abnormallyDecreasedEfficacyOfBehavior.tsv @@ -1,7 +1,7 @@ defined_class defined_class_label behavior_process behavior_process_label -FBcv:0007518 decreased memory GO:0007613 memory -FBcv:0007520 decreased short-term memory GO:0007614 short-term memory -FBcv:0007522 decreased long-term memory GO:0007616 long-term memory -FBcv:0007524 decreased anesthesia-resistant memory GO:0007615 anesthesia-resistant memory -FBcv:0007526 decreased medium-term memory GO:0072375 medium-term memory -FBcv:0007531 decreased efficacy of learning GO:0007612 learning \ No newline at end of file +FBcv:0007518 decreased efficacy of memory GO:0007613 memory +FBcv:0007520 decreased efficacy of short-term memory GO:0007614 short-term memory +FBcv:0007522 decreased efficacy of long-term memory GO:0007616 long-term memory +FBcv:0007524 decreased efficacy of anesthesia-resistant memory GO:0007615 anesthesia-resistant memory +FBcv:0007526 decreased efficacy of medium-term memory GO:0072375 medium-term memory +FBcv:0007531 decreased efficacy of learning GO:0007612 learning diff --git a/src/patterns/data/default/abnormallyDecreasedNumberOfAnatomicalEntity.tsv b/src/patterns/data/default/abnormallyDecreasedNumberOfAnatomicalEntity.tsv index 24f2513..add1086 100644 --- a/src/patterns/data/default/abnormallyDecreasedNumberOfAnatomicalEntity.tsv +++ b/src/patterns/data/default/abnormallyDecreasedNumberOfAnatomicalEntity.tsv @@ -1,2 +1,2 @@ defined_class defined_class_label anatomical_entity anatomical_entity_label -FBcv:0000359 decreased cell number CL:0000000 cell \ No newline at end of file +FBcv:0000359 decreased cell number CL:0000000 cell diff --git a/src/patterns/data/default/abnormallyDecreasedOccurrenceOfBiologicalProcess.tsv b/src/patterns/data/default/abnormallyDecreasedOccurrenceOfBiologicalProcess.tsv index 86f63ff..f12d04e 100644 --- a/src/patterns/data/default/abnormallyDecreasedOccurrenceOfBiologicalProcess.tsv +++ b/src/patterns/data/default/abnormallyDecreasedOccurrenceOfBiologicalProcess.tsv @@ -1,3 +1,3 @@ defined_class defined_class_label biological_process biological_process_label FBcv:0006006 decreased occurrence of cell division GO:0051301 cell division -FBcv:0000425 decreased cell death GO:0008219 cell death +FBcv:0000425 increased cell death GO:0008219 cell death diff --git a/src/patterns/data/default/abnormallyDecreasedRateOfBehavior.tsv b/src/patterns/data/default/abnormallyDecreasedRateOfBehavior.tsv index 1312829..59973c5 100644 --- a/src/patterns/data/default/abnormallyDecreasedRateOfBehavior.tsv +++ b/src/patterns/data/default/abnormallyDecreasedRateOfBehavior.tsv @@ -1,7 +1,7 @@ defined_class defined_class_label behavior_process behavior_process_label FBcv:0007514 decreased sleep GO:0030431 sleep -FBcv:0007516 decreased feeding behavior GO:0007631 feeding behavior -FBcv:0007544 decreased rate of chemosensory behaviour GO:0007635 chemosensory behaviour +FBcv:0007516 decreased rate of feeding behavior GO:0007631 feeding behavior +FBcv:0007544 decreased rate of chemosensory behavior GO:0007635 chemosensory behavior FBcv:0007545 decreased rate of proboscis extension reflex GO:0007637 proboscis extension reflex FBcv:0007546 decreased rate of grooming behavior GO:0007625 grooming behavior FBcv:0007547 decreased rate of locomotory behavior GO:0007626 locomotory behavior @@ -12,4 +12,4 @@ FBcv:0007551 decreased rate of mating behavior GO:0007617 mating behavior FBcv:0007552 decreased rate of courtship behavior GO:0007619 courtship behavior FBcv:0007553 decreased rate of flight behavior GO:0007629 flight behavior FBcv:0007554 decreased rate of jump response GO:0007630 jump response -FBcv:0007555 decreased rate of copulation GO:0007620 copulation \ No newline at end of file +FBcv:0007555 decreased rate of copulation GO:0007620 copulation diff --git a/src/patterns/data/default/abnormallyDecreasedRateOfBiologicalProcess.tsv b/src/patterns/data/default/abnormallyDecreasedRateOfBiologicalProcess.tsv index b211391..c1910b0 100644 --- a/src/patterns/data/default/abnormallyDecreasedRateOfBiologicalProcess.tsv +++ b/src/patterns/data/default/abnormallyDecreasedRateOfBiologicalProcess.tsv @@ -1,5 +1,5 @@ defined_class defined_class_label biological_process biological_process_label -FBcv:0000718 decreased cell growth GO:0016049 cell growth -FBcv:0000390 hypoactive GO:0050879 multicellular organismal movement +FBcv:0000718 decreased cell growth rate GO:0016049 cell growth +FBcv:0000390 decreased rate of movement GO:0050879 multicellular organismal movement FBcv:0007510 decreased rate of phototaxis GO:0042331 phototaxis -FBcv:0007512 decreased rate of cell adhesion GO:0007155 cell adhesion \ No newline at end of file +FBcv:0007512 decreased rate of cell adhesion GO:0007155 cell adhesion diff --git a/src/patterns/data/default/abnormallyDecreasedRateOfContinuousBiologicalProcess.tsv b/src/patterns/data/default/abnormallyDecreasedRateOfContinuousBiologicalProcess.tsv index c3f905a..5e9db52 100644 --- a/src/patterns/data/default/abnormallyDecreasedRateOfContinuousBiologicalProcess.tsv +++ b/src/patterns/data/default/abnormallyDecreasedRateOfContinuousBiologicalProcess.tsv @@ -1,2 +1,2 @@ defined_class defined_class_label biological_process biological_process_label -FBcv:0000791 delayed aging GO:0007568 aging \ No newline at end of file +FBcv:0000791 decreased speed of aging GO:0007568 obsolete aging diff --git a/src/patterns/data/default/abnormallyDecreasedResistanceOfWholeOrganismToChemicalEntity.tsv b/src/patterns/data/default/abnormallyDecreasedResistanceOfWholeOrganismToChemicalEntity.tsv index c4cd2ae..ff0326e 100644 --- a/src/patterns/data/default/abnormallyDecreasedResistanceOfWholeOrganismToChemicalEntity.tsv +++ b/src/patterns/data/default/abnormallyDecreasedResistanceOfWholeOrganismToChemicalEntity.tsv @@ -1,2 +1,2 @@ -defined_class defined_class_label chemical_entity chemical_entity_label -FBcv:0000440 chemical sensitive CHEBI:24431 chemical entity \ No newline at end of file +defined_class defined_class_label chemical_entity chemical_entity_label +FBcv:0000440 chemical sensitive CHEBI:24431 chemical entity diff --git a/src/patterns/data/default/abnormallyDecreasedResistanceOfWholeOrganismToEntity.tsv b/src/patterns/data/default/abnormallyDecreasedResistanceOfWholeOrganismToEntity.tsv index 2b16444..61dcb1e 100644 --- a/src/patterns/data/default/abnormallyDecreasedResistanceOfWholeOrganismToEntity.tsv +++ b/src/patterns/data/default/abnormallyDecreasedResistanceOfWholeOrganismToEntity.tsv @@ -1,2 +1,2 @@ -defined_class defined_class_label entity entity_label -FBcv:0000442 radiation sensitive ENVO:01001023 radiation \ No newline at end of file +defined_class defined_class_label entity entity_label +FBcv:0000442 radiation sensitive ENVO:01001023 radiation diff --git a/src/patterns/data/default/abnormallyIncreasedEfficacyOfBehavior.tsv b/src/patterns/data/default/abnormallyIncreasedEfficacyOfBehavior.tsv index e6060f2..19fdf42 100644 --- a/src/patterns/data/default/abnormallyIncreasedEfficacyOfBehavior.tsv +++ b/src/patterns/data/default/abnormallyIncreasedEfficacyOfBehavior.tsv @@ -1,7 +1,7 @@ defined_class defined_class_label behavior_process behavior_process_label -FBcv:0007517 increased memory GO:0007613 memory -FBcv:0007519 increased short-term memory GO:0007614 short-term memory -FBcv:0007521 increased long-term memory GO:0007616 long-term memory -FBcv:0007523 increased anesthesia-resistant memory GO:0007615 anesthesia-resistant memory -FBcv:0007525 increased medium-term memory GO:0072375 medium-term memory -FBcv:0007530 increased efficacy of learning GO:0007612 learning \ No newline at end of file +FBcv:0007517 increased efficacy of memory GO:0007613 memory +FBcv:0007519 increased efficacy of short-term memory GO:0007614 short-term memory +FBcv:0007521 increased efficacy of long-term memory GO:0007616 long-term memory +FBcv:0007523 increased efficacy of anesthesia-resistant memory GO:0007615 anesthesia-resistant memory +FBcv:0007525 increased efficacy of medium-term memory GO:0072375 medium-term memory +FBcv:0007530 increased efficacy of learning GO:0007612 learning diff --git a/src/patterns/data/default/abnormallyIncreasedOccurrenceOfBiologicalProcess.tsv b/src/patterns/data/default/abnormallyIncreasedOccurrenceOfBiologicalProcess.tsv index 64c2c5b..406b234 100644 --- a/src/patterns/data/default/abnormallyIncreasedOccurrenceOfBiologicalProcess.tsv +++ b/src/patterns/data/default/abnormallyIncreasedOccurrenceOfBiologicalProcess.tsv @@ -1,3 +1,3 @@ defined_class defined_class_label biological_process biological_process_label FBcv:0006005 increased occurrence of cell division GO:0051301 cell division -FBcv:0000426 increased cell death GO:0008219 cell death +FBcv:0000426 decreased cell death GO:0008219 cell death diff --git a/src/patterns/data/default/abnormallyIncreasedRateOfBehavior.tsv b/src/patterns/data/default/abnormallyIncreasedRateOfBehavior.tsv index 268a425..853bf9e 100644 --- a/src/patterns/data/default/abnormallyIncreasedRateOfBehavior.tsv +++ b/src/patterns/data/default/abnormallyIncreasedRateOfBehavior.tsv @@ -1,7 +1,7 @@ defined_class defined_class_label behavior_process behavior_process_label FBcv:0007513 increased sleep GO:0030431 sleep -FBcv:0007515 increased feeding behavior GO:0007631 feeding behavior -FBcv:0007532 increased rate of chemosensory behaviour GO:0007635 chemosensory behaviour +FBcv:0007515 increased rate of feeding behavior GO:0007631 feeding behavior +FBcv:0007532 increased rate of chemosensory behavior GO:0007635 chemosensory behavior FBcv:0007533 increased rate of proboscis extension reflex GO:0007637 proboscis extension reflex FBcv:0007534 increased rate of grooming behavior GO:0007625 grooming behavior FBcv:0007535 increased rate of locomotory behavior GO:0007626 locomotory behavior @@ -12,4 +12,4 @@ FBcv:0007539 increased rate of mating behavior GO:0007617 mating behavior FBcv:0007540 increased rate of courtship behavior GO:0007619 courtship behavior FBcv:0007541 increased rate of flight behavior GO:0007629 flight behavior FBcv:0007542 increased rate of jump response GO:0007630 jump response -FBcv:0007543 increased rate of copulation GO:0007620 copulation \ No newline at end of file +FBcv:0007543 increased rate of copulation GO:0007620 copulation diff --git a/src/patterns/data/default/abnormallyIncreasedRateOfBiologicalProcess.tsv b/src/patterns/data/default/abnormallyIncreasedRateOfBiologicalProcess.tsv index bc77a92..e88a6c0 100644 --- a/src/patterns/data/default/abnormallyIncreasedRateOfBiologicalProcess.tsv +++ b/src/patterns/data/default/abnormallyIncreasedRateOfBiologicalProcess.tsv @@ -1,5 +1,5 @@ defined_class defined_class_label biological_process biological_process_label -FBcv:0000717 increased cell growth GO:0016049 cell growth -FBcv:0000392 hyperactive GO:0050879 multicellular organismal movement +FBcv:0000717 increased cell growth rate GO:0016049 cell growth +FBcv:0000392 increased rate of movement GO:0050879 multicellular organismal movement FBcv:0007509 increased rate of phototaxis GO:0042331 phototaxis -FBcv:0007511 increased rate of cell adhesion GO:0007155 cell adhesion \ No newline at end of file +FBcv:0007511 increased rate of cell adhesion GO:0007155 cell adhesion diff --git a/src/patterns/data/default/abnormallyIncreasedRateOfContinuousBiologicalProcess.tsv b/src/patterns/data/default/abnormallyIncreasedRateOfContinuousBiologicalProcess.tsv index c6cb7ec..c589769 100644 --- a/src/patterns/data/default/abnormallyIncreasedRateOfContinuousBiologicalProcess.tsv +++ b/src/patterns/data/default/abnormallyIncreasedRateOfContinuousBiologicalProcess.tsv @@ -1,2 +1,2 @@ defined_class defined_class_label biological_process biological_process_label -FBcv:0000792 premature aging GO:0007568 aging \ No newline at end of file +FBcv:0000792 increased speed of aging GO:0007568 obsolete aging diff --git a/src/patterns/data/default/abnormallyIncreasedResistanceOfWholeOrganismToChemicalEntity.tsv b/src/patterns/data/default/abnormallyIncreasedResistanceOfWholeOrganismToChemicalEntity.tsv index 52926ed..3de7718 100644 --- a/src/patterns/data/default/abnormallyIncreasedResistanceOfWholeOrganismToChemicalEntity.tsv +++ b/src/patterns/data/default/abnormallyIncreasedResistanceOfWholeOrganismToChemicalEntity.tsv @@ -1,2 +1,2 @@ -defined_class defined_class_label chemical_entity chemical_entity_label -FBcv:0000439 chemical resistant CHEBI:24431 chemical entity \ No newline at end of file +defined_class defined_class_label chemical_entity chemical_entity_label +FBcv:0000439 chemical resistant CHEBI:24431 chemical entity diff --git a/src/patterns/data/default/abnormallyIncreasedResistanceOfWholeOrganismToEntity.tsv b/src/patterns/data/default/abnormallyIncreasedResistanceOfWholeOrganismToEntity.tsv index 65be684..5fe2e5f 100644 --- a/src/patterns/data/default/abnormallyIncreasedResistanceOfWholeOrganismToEntity.tsv +++ b/src/patterns/data/default/abnormallyIncreasedResistanceOfWholeOrganismToEntity.tsv @@ -1,2 +1,2 @@ -defined_class defined_class_label entity entity_label -FBcv:0000441 radiation resistant ENVO:01001023 radiation \ No newline at end of file +defined_class defined_class_label entity entity_label +FBcv:0000441 radiation resistant ENVO:01001023 radiation diff --git a/src/patterns/data/default/atrophiedAnatomicalEntity.tsv b/src/patterns/data/default/atrophiedAnatomicalEntity.tsv index ff7f19e..58758f7 100644 --- a/src/patterns/data/default/atrophiedAnatomicalEntity.tsv +++ b/src/patterns/data/default/atrophiedAnatomicalEntity.tsv @@ -1,2 +1,2 @@ -defined_class defined_class_label anatomical_entity anatomical_entity_label -FBcv:0000719 atrophy FBbt:00100313 multicellular structure \ No newline at end of file +defined_class defined_class_label anatomical_entity anatomical_entity_label +FBcv:0000719 atrophy FBbt:00100313 multicellular structure diff --git a/src/patterns/data/default/dpoAbnormalFertilityAndViabilityOfWholeOrganism.tsv b/src/patterns/data/default/dpoAbnormalFertilityAndViabilityOfWholeOrganism.tsv index b41a89e..6311d38 100644 --- a/src/patterns/data/default/dpoAbnormalFertilityAndViabilityOfWholeOrganism.tsv +++ b/src/patterns/data/default/dpoAbnormalFertilityAndViabilityOfWholeOrganism.tsv @@ -7,7 +7,7 @@ FBcv:0000378 grandchildless PATO:0001862 lack of fertility in offspring FBcv:0006001 increased fecundity PATO:0001695 increased fecundity FBcv:0000006 male semi-fertile PATO:0001761 male semi-fertile FBcv:0000371 male semi-sterile PATO:0001762 male semi-sterile -FBcv:0000370 male sterlie PATO:0000890 male sterile +FBcv:0000370 male sterile PATO:0000890 male sterile FBcv:0000364 sterile PATO:0000956 sterile FBcv:0000383 auxotroph PATO:0000422 auxotrophic FBcv:0000375 semi-fertile PATO:0001767 semi-fertile diff --git a/src/patterns/data/default/dpoFertilityAndViabilityOfWholeOrganism.tsv b/src/patterns/data/default/dpoFertilityAndViabilityOfWholeOrganism.tsv index bf91a76..0feba26 100644 --- a/src/patterns/data/default/dpoFertilityAndViabilityOfWholeOrganism.tsv +++ b/src/patterns/data/default/dpoFertilityAndViabilityOfWholeOrganism.tsv @@ -1,5 +1,5 @@ -defined_class defined_class_label quality quality_label -FBcv:0000377 female fertile PATO:0000888 female fertile -FBcv:0000374 fertile PATO:0000955 fertile -FBcv:0000376 male fertile PATO:0000891 male fertile -FBcv:0000349 viable PATO:0000719 viable \ No newline at end of file +defined_class defined_class_label quality quality_label +FBcv:0000377 female fertile PATO:0000888 female fertile +FBcv:0000374 fertile PATO:0000955 fertile +FBcv:0000376 male fertile PATO:0000891 male fertile +FBcv:0000349 viable PATO:0000719 viable diff --git a/src/scripts/update_term_labels_in_file.py b/src/scripts/update_term_labels_in_file.py new file mode 100644 index 0000000..c6e314a --- /dev/null +++ b/src/scripts/update_term_labels_in_file.py @@ -0,0 +1,136 @@ +import pandas as pd +import argparse + +# setup arguments that can be provided on command line +parser = argparse.ArgumentParser() + +parser.add_argument("--filename", "-f", help="Filename") +parser.add_argument("--id_col", "-i", help="Name of column containing IDs or 'auto' to autodetect column(s)") +parser.add_argument("--label_col", "-l", help="Name of column for labels (if -i is 'auto', '{id_col}_label' will be used)") +parser.add_argument("--sep", "-s", help="Separator for lists") +parser.add_argument("--source", "-c", help="Where to lookup labels ('VFB' or a filename)") +args = parser.parse_args() + +# if not running on command line, can edit defaults here: +if args.filename: + file = args.filename +else: + file = './file.tsv' +if args.id_col: + id_column_name = args.id_col +else: + id_column_name = 'auto' +if args.label_col: + label_column_name = args.label_col +else: + label_column_name = 'term_label' +if args.sep: + separator = args.sep +else: + separator = '|' +if args.source: + source = args.source +else: + source = 'VFB' + +# conditional imports +if source == 'VFB': + from vfb_connect.neo.neo4j_tools import Neo4jConnect, dict_cursor +else: + from oaklib import get_adapter + + +def get_id_cols(filename=file): + """Returns column names from the given file if '^[A-z]+:[0-9]+$' is in the column.""" + mapping = pd.read_csv(filename, sep='\t', dtype=str) + + id_cols = [] + for col in mapping.columns: + if len(mapping.loc[mapping[col].str.contains("^[A-z]+:[0-9]+$", na=False)]) > 0: + id_cols.append(col) + return id_cols + + +def replace_labels(dataframe, id_col_name=id_column_name, label_col_name=label_column_name, sep=separator, source=source): + """Updates labels from latest FBbt release (from VFB) based on IDs. + + Input is a dataframe - default for ID column to be 'FBbt_id' and label column as 'FBbt_name'. + Label column not required in input.""" + col_order = dataframe.columns + # separate ids to lists and make one flat list of unique values + dataframe['id_lists'] = dataframe[id_col_name].apply(lambda x: x.split(sep)) + flat_FBbt_list = list(set(dataframe['id_lists'].explode().tolist())) + flat_FBbt_list = list(filter(None, flat_FBbt_list)) # remove Nones + + if source == 'VFB': # get labels from VFB KB + flat_FBbt_list_converted = [item.replace(':', '_') for item in flat_FBbt_list] + + nc = Neo4jConnect('http://kb.virtualflybrain.org', 'neo4j', 'vfb') + query = ("MATCH (c:Class) WHERE c.short_form IN %s " + "RETURN c.short_form AS ID, c.label AS label" + % flat_FBbt_list_converted) + + q = nc.commit_list([query]) + labels = dict_cursor(q) + labels_df = pd.DataFrame(labels) + labels_df['ID'] = labels_df['ID'].apply(lambda x: x.replace('_', ':')) + labels_df = labels_df.set_index('ID') + + else: # get labels from local file + ontology = get_adapter(source) + labels_df = pd.DataFrame({}) + labels_df['ID'] = flat_FBbt_list + labels_df['label'] = labels_df['ID'].apply(lambda x: ontology.label(x)) + labels_df = labels_df.set_index('ID') + + labels_df = labels_df[labels_df['label'].notnull()] + + def label_lookup(ID_list): + """Looks up labels of items of a list of IDs in labels_df and returns list of labels.""" + label_list = [] + try: + label_list = [labels_df.loc[i, 'label'] for i in ID_list] + except KeyError: + pass + return label_list + + # allow label column not to be present in original spreadsheet (and add to columns to return if not there) + try: + dataframe = dataframe.drop(label_col_name, axis=1) + except KeyError: + ID_col_loc = col_order.get_loc(id_col_name) + col_order = col_order.insert(ID_col_loc + 1, label_col_name) + + # make column of lists of labels from column of lists of IDs + dataframe['label_lists'] = dataframe.loc[:, id_col_name].apply( + lambda x: label_lookup(x.split(sep))) + # convert lists to strings with separator + dataframe[label_col_name] = dataframe.loc[:,'label_lists'].apply( + lambda x: sep.join(x) if type(x) == list else x) + + dataframe = dataframe[col_order] + return dataframe + + +def replace_labels_in_file(filename, id_col_name=id_column_name, label_col_name=label_column_name, sep=separator): + """Updates labels from latest FBbt release (from VFB) based on IDs. + + Input is a file - default for ID column to be 'FBbt_id' and label column as 'FBbt_name'.""" + if id_col_name == 'auto': + id_columns = get_id_cols(filename) + else: + id_columns = id_col_name + + dataframe = pd.read_csv(filename, sep='\t', dtype=str, na_filter=False) + if not isinstance(id_columns, list): # if only one column, make it a list + id_columns = [id_columns] + for i in id_columns: + if id_col_name == 'auto': + label_col_name = i + '_label' + dataframe = replace_labels(dataframe, i, label_col_name, sep) + + dataframe.to_csv(filename, sep='\t', index=False) + + +if __name__ == "__main__": + replace_labels_in_file(file, id_column_name, label_column_name, separator)