Skip to content

Commit

Permalink
Merge pull request #89 from PNNL-CompBio/schema-build
Browse files Browse the repository at this point in the history
Adding in tests to build schema to database
  • Loading branch information
sgosline authored Sep 20, 2024
2 parents 2a8b813 + e6af5f0 commit ca8aacb
Show file tree
Hide file tree
Showing 24 changed files with 38 additions and 1,081 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 16 additions & 3 deletions build_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
'''
Expand All @@ -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):
'''
Expand All @@ -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():
'''
Expand All @@ -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 =[]
Expand Down
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

0 comments on commit ca8aacb

Please sign in to comment.