Skip to content

Commit

Permalink
Another pass at transform
Browse files Browse the repository at this point in the history
  • Loading branch information
caufieldjh committed Jul 22, 2024
1 parent d671b84 commit f61eed5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ download:

.PHONY: run
run: download
$(RUN) ingest sevilleja_transform
$(RUN) ingest transform
$(RUN) python scripts/generate-report.py


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
from biolink_model.datamodel.pydanticmodel_v2 import * # Replace * with any necessary data classes from the Biolink Model
from koza.cli_utils import get_koza_app

koza_app = get_koza_app("data_source, ex. alliance, flybase, or hpoa._type_of_ingest, ex. gene, disease_to_phenotype, or disease_associations.")
koza_app = get_koza_app("sevilleja_transform")

while (row := koza_app.get_row()) is not None:
# Code to transform each row of data
# For more information, see https://koza.monarchinitiative.org/Ingests/transform
entity_a = Entity(
id=f"XMPL:00000{row['example_column_1'].split('_')[-1]}",
name=row["example_column_1"],
id=f"plot:{row['Plot']}",
name=row['Plot'],
category=["biolink:Entity"],
)
entity_b = Entity(
id=f"XMPL:00000{row['example_column_2'].split('_')[-1]}",
name=row["example_column_2"],
id=f"treat:{row['treat']}",
name=row['treat'],
category=["biolink:Entity"],
)
association = Association(
id=str(uuid.uuid1()),
subject=row["example_column_1"],
predicate=row["example_column_3"],
object=row["example_column_2"],
subject=row['Plot'],
predicate="plot_received_treatment",
object=row['treat'],
subject_category="SUBJ",
object_category="OBJ",
category=["biolink:Association"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Config file for transforming data from a source
# See additional/optional config parameters at https://koza.monarchinitiative.org/Ingests/source_config/

name: "Sevilleja_et_al_2022"
name: "sevilleja_transform"
metadata: "./src/restoration_ingests/metadata.yaml"
format: "csv"
files:
- "./data/DATA-antsVeg_4years.csv"
- "DATA-antsVeg_4years.csv"
#################################################################################################
### file_archive is typically optional, but required if: ###
### 1. files is not provided ###
Expand Down

0 comments on commit f61eed5

Please sign in to comment.