Skip to content

Commit

Permalink
#58
Browse files Browse the repository at this point in the history
  • Loading branch information
turbomam committed Mar 8, 2022
1 parent e923409 commit 7f2e772
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ examples/outputs
temp/
output/

__MACOSX/

# Distribution / packaging
.Python
build/
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/sample-annotator.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
RUN = poetry run

biosample_sqlite_file = ~/biosample_basex_data_good_subset.db
#biosample_sqlite_file = ~/biosample_basex_data_good_subset.db
# curling from NERSC portal now
# but may want to change local destination... like a data directory?
# NOTE: this database file will be deleted by make clean. Don't do any manual modifications in there!
biosample_sqlite_file = biosample_basex_data_good_subset.db

.PHONY: test clean all

Expand Down Expand Up @@ -28,20 +32,21 @@ clean:
rm -rf examples/outputs/*tsv
rm -rf logs/*log
rm -rf target/*
rm -rf $(biosample_sqlite_file)

examples/outputs/report.tsv: examples/gold.json
$(RUN) annotate-sample -R $@ $<

downloads/mixs6_core.tsv:
curl -L -s 'https://docs.google.com/spreadsheets/d/1QDeeUcDqXes69Y2RjU2aWgOpCVWo5OVsBX9MKmMqi_o/export?format=tsv&gid=178015749' > $@

examples/outputs/non_attribute_metadata_sel_envs_partial.tsv:
examples/outputs/non_attribute_metadata_sel_envs_partial.tsv: $(biosample_sqlite_file)
$(RUN) sqlite_client_cli \
--sqlite_path $(biosample_sqlite_file) \
--query "select * from non_attribute_metadata_sel_envs limit 9" \
--tsv_out $@

rel_to_oxygen_example: downloads/mixs6_core.tsv
rel_to_oxygen_example: downloads/mixs6_core.tsv $(biosample_sqlite_file)
$(RUN) rel_to_oxygen_example \
--sqlite_path $(biosample_sqlite_file) \
--mixs_core_path $<
Expand All @@ -56,4 +61,17 @@ downloads/bibo.owl:

assets/bibo_DocumentStatus.tsv: downloads/bibo.owl bin/robot.jar
java -jar bin/robot.jar query --input $< --query sparql/bibo_DocumentStatus.sparql $@
sed --in-place=.bak 's/^\?//' $@
sed --in-place=.bak 's/^\?//' $@

# full db at https://portal.nersc.gov/project/m3513/biosample/biosample_basex.db.gz
# subset has few tables
# fewer rows in XXX (corresponding to samples with reapired env package values of XXX...)
# see XXX
# and fewer columns in XXX, highlighting
downloads/biosample_basex_data_good_subset.db.zip:
# --location (-L) pursues redirects
curl --location https://portal.nersc.gov/project/m3513/biosample/biosample_basex_data_good_subset.db.zip -o $@

# unzipped file goes into the cwd by default, which would usually be the root of the project
biosample_basex_data_good_subset.db: downloads/biosample_basex_data_good_subset.db.zip
unzip $<
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@

# NMDC Sample Annotator API

## Installing
## Setup
1. requires python 3.9... should we try to make this compatible with something earlier?
2. install [poetry application](https://python-poetry.org/docs/#installation)
3. `git clone [email protected]:microbiomedata/sample-annotator.git`
4. `cd sample-annotator`
5. `poetry install`
6. `mkdir bin`... that directory _should_ already be in the repo with a placeholder.txt file, or it should be created by the Makefile

test your setup with `make all`

## Contributing?
_Please_
1. create an issue describing the problem you plan to address or the contribution you intend to make
2. create a fork of the repo in your own GitHub account, or create a branch here in microbiomedata/sample-annotator. The name of the branch should be brief but include your issue number and a keyword or two from the issue's title
3. start adding code, probably in the `sample_annotator` subdirectory
4. save, `git add`, `git commit -m`, and `git push`
5. create a pull request
6. ask questions **any** time

## Command Line

Expand Down
10 changes: 0 additions & 10 deletions assets/bibo_DocumentStatus.tsv

This file was deleted.

10 changes: 0 additions & 10 deletions assets/bibo_DocumentStatus.tsv.bak

This file was deleted.

0 comments on commit 7f2e772

Please sign in to comment.