Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding in tests to build schema to database #89

Merged
merged 4 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -56,25 +56,6 @@ jobs:
tags: sgosline/srp-exposome:latest
push: true

build-push-db:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push dbschema
uses: docker/build-push-action@v3
with:
file: dbSchema/Dockerfile
tags: sgosline/srp-dbschema:latest
push: true

build-push-exp:
runs-on: ubuntu-latest
steps:
19 changes: 16 additions & 3 deletions build_script.py
Original file line number Diff line number Diff line change
@@ -70,6 +70,13 @@ def runSampMap(is_sample=False,drcfiles=[],smap='',cid='',\
print(cmd)
os.system(cmd)
print('ls -la .')
##now we validate the files that came out.
dblist=['/tmp/samples.csv','/tmp/chemicals.csv','/tmp/samplesToChemicals.csv']
for ftype in ['ChemXYCoords.csv','DoseResponse.csv','BMDs.csv']:
dblist.append('/tmp/zebrafishChem'+ftype)
dblist.append('/tmp/zebrafishSamp'+ftype)
runSchemaCheck(dblist)


def runExposome(chem_id_file):
'''
@@ -78,6 +85,7 @@ def runExposome(chem_id_file):
cmd = 'Rscript exposome/exposome_summary_stats.R '+chem_id_file
print(cmd)
os.system(cmd)
runSchemaCheck(['/tmp/exposomeGeneStats.csv'])

def runExpression(gex,chem,ginfo):
'''
@@ -86,13 +94,18 @@ def runExpression(gex,chem,ginfo):
cmd = 'Rscript zfExp/parseGexData.R '+gex+' '+chem+' '+ginfo
print(cmd)
os.system(cmd)
runSchemaCheck(['/tmp/srpDEGPathways.csv','/tmp/srpDEGStats.csv','/tmp/allGeneEx.csv'])

def runSchemaCheck(dbfiles=[]):
'''
run schema checking
'''
##TODO: make this work with files as arguments
cmd = 'python dbSchema/main.py'
##TODO: make this work with internal calls
for filename in dbfiles:
classname = os.path.basename(filename).split('.')[0]
cmd = 'linkml-validate --schema srpAnalytics.yaml '+filename+' --target-class '+classname
print(cmd)
os.system(cmd)

def main():
'''
@@ -106,7 +119,7 @@ def main():
# file parsing - collects all files we might need for the tool below
####
##first find the morphology and behavior pairs for chemical sources
chemdf = df.loc[df.sample_type=='chemical']
chemdf = df.loc[df.sample_type=='chemical']
morph = chemdf.loc[chemdf.data_type=='morphology']
beh = chemdf.loc[chemdf.data_type=='behavior']
tupes =[]
18 changes: 0 additions & 18 deletions dbSchema/Dockerfile

This file was deleted.

125 changes: 0 additions & 125 deletions dbSchema/ingest.py

This file was deleted.

57 changes: 0 additions & 57 deletions dbSchema/main.py

This file was deleted.

10 changes: 0 additions & 10 deletions dbSchema/requirements.txt

This file was deleted.

Loading
Loading