Skip to content

Commit 21b5e8c

Browse files
committed
Resolve #13
1 parent 9b1e612 commit 21b5e8c

File tree

3 files changed

+33
-36
lines changed

3 files changed

+33
-36
lines changed

README.md

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Here are the environment variables you'll need to set (substituting values betwe
5959
- `EDRN_CANCERDATAEXPO_DATA` — set to a path to contain blobstorage, filestorage, and logs.
6060
- `EDRN_CANCERDATAEXPO_PORT` — set to a free port number
6161
- `EDRN_CANCERDATAEXPO_VERSION` — set to a version number of `latest`
62+
- `EDRN_IMAGE_OWNER` — set to `nutjob4life` or leave it blank to use your local Docker containers
6263

6364

6465
### 🧱 Building the Image
@@ -89,19 +90,16 @@ To run the CancerDataExpo for the **first time**, create empty directories to ho
8990
--project-name cancerdataexpo \
9091
up --detach
9192

93+
The `docker-compose.yaml` assumes that `EDRN_CANCERDATAEXPO_DATA` is `usr/local/labcas/cancerdataexpo/docker-data` which is appropriate for `edrn-docker.jpl.nasa.gov` where this normally runs, and that `EDRN_CANCERDATAEXPO_PORT` is 2131, and that `EDRN_CANCERDATAEXPO_VERSION` is `latest`, so you can simply say:
94+
95+
docker-compose --project-name cancerdataexpo up --detach
96+
9297
You can check the logs with:
9398

94-
env \
95-
EDRN_CANCERDATAEXPO_DATA=/usr/local/labcas/cancerdataexpo/docker-data \
96-
EDRN_CANCERDATAEXPO_VERSION=latest \
97-
EDRN_CANCERDATAEXPO_PORT=2131 \
98-
docker-compose \
99-
--project-name cancerdataexpo \
100-
logs --follow
99+
docker-compose --project-name cancerdataexpo logs --follow
101100

102101
**📝 Note:** With no existing database, the initiall startup might fail (see the logs, message "Resource Busy"). If this happens, stop it and start it again.
103102

104-
105103
Once this is up and running, head to http://localhost:${EDRN_CANCERDATAEXPO_PORT}/manage_main and log in (with username `admin` and password `admin`) and change the default password in the `acl_users` object. Next, create an instance of the CancerDataExpo by visiting http://localhost:${EDRN_CANCERDATAEXPO_PORT}/@@plone-addsite?site_id=Plone&advanced=1 and entering the following:
106104

107105
- Path identifier: `cancerdataexpo`
@@ -123,25 +121,14 @@ Then click "Save". Lastly, head to the RDF Generators and give the LabCAS genera
123121

124122
Need to bring it all down?
125123

126-
env \
127-
EDRN_CANCERDATAEXPO_DATA=/usr/local/labcas/cancerdataexpo/docker-data \
128-
EDRN_CANCERDATAEXPO_VERSION=latest \
129-
EDRN_CANCERDATAEXPO_PORT=2131 \
130-
docker-compose \
131-
--project-name cancerdataexpo \
132-
down
124+
docker-compose --project-name cancerdataexpo down
125+
133126

134127
### 🎽 Subsequent Runs
135128

136129
Start it up again?
137130

138-
env \
139-
EDRN_CANCERDATAEXPO_DATA=/usr/local/labcas/cancerdataexpo/docker-data \
140-
EDRN_CANCERDATAEXPO_VERSION=latest \
141-
EDRN_CANCERDATAEXPO_PORT=2131 \
142-
docker-compose \
143-
--project-name cancerdataexpo \
144-
up --detach
131+
docker-compose --project-name cancerdataexpo up --detach
145132

146133

147134
#### 🐛 Advanced Debugging
@@ -160,5 +147,3 @@ Add a Manager user (not through the web, like above):
160147
Get a shell:
161148

162149
docker container run --volume ${EDRN_CANCERDATAEXPO_DATA}/blobstorage:/data/blobstorage --tty --rm --interactive --network cancerdataexpo_frontsidebus --entrypoint /bin/bash cancerdataexpo:latest
163-
164-

docker-compose.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
---
55
services:
66
appserver:
7-
# image: cancerdataexpo:${EDRN_CANCERDATAEXPO_VERSION:-latest}
8-
image: nutjob4life/cancerdataexpo:${EDRN_CANCERDATAEXPO_VERSION:-latest}
7+
image: ${EDRN_IMAGE_OWNER-nutjob4life/}cancerdataexpo:${EDRN_CANCERDATAEXPO_VERSION:-latest}
98
volumes:
109
-
1110
type: bind
12-
source: ${EDRN_CANCERDATAEXPO_DATA}/blobstorage
11+
source: ${EDRN_CANCERDATAEXPO_DATA:-/usr/local/labcas/cancerdataexpo/docker-data}/blobstorage
1312
target: /data/blobstorage
1413
consistency: consistent
1514
-
1615
type: bind
17-
source: ${EDRN_CANCERDATAEXPO_DATA}/log
16+
source: ${EDRN_CANCERDATAEXPO_DATA:-/usr/local/labcas/cancerdataexpo/docker-data}/log
1817
target: /data/log
1918
consistency: delegated
2019
ports:
@@ -41,23 +40,22 @@ services:
4140
org.label-schema.name: CancerDataExpo Application Server
4241
org.label-schema.description: Zope appserver running the exposition for cancer data.
4342
db:
44-
# image: cancerdataexpo:${EDRN_CANCERDATAEXPO_VERSION:-latest}
45-
image: nutjob4life/cancerdataexpo:${EDRN_CANCERDATAEXPO_VERSION:-latest}
43+
image: ${EDRN_IMAGE_OWNER-nutjob4life/}cancerdataexpo:${EDRN_CANCERDATAEXPO_VERSION:-latest}
4644
command: zeo
4745
volumes:
4846
-
4947
type: bind
50-
source: ${EDRN_CANCERDATAEXPO_DATA}/filestorage
48+
source: ${EDRN_CANCERDATAEXPO_DATA:-/usr/local/labcas/cancerdataexpo/docker-data}/filestorage
5149
target: /data/filestorage
5250
consistency: consistent
5351
-
5452
type: bind
55-
source: ${EDRN_CANCERDATAEXPO_DATA}/blobstorage
53+
source: ${EDRN_CANCERDATAEXPO_DATA:-/usr/local/labcas/cancerdataexpo/docker-data}/blobstorage
5654
target: /data/blobstorage
5755
consistency: consistent
5856
-
5957
type: bind
60-
source: ${EDRN_CANCERDATAEXPO_DATA}/log
58+
source: ${EDRN_CANCERDATAEXPO_DATA:-/usr/local/labcas/cancerdataexpo/docker-data}/log
6159
target: /data/log
6260
consistency: delegated
6361
networks:
@@ -72,7 +70,7 @@ services:
7270
org.label-schema.name: CancerDataExpo DB Server
7371
org.label-schema.description: Zope Enterprise Objects DB server for the cancer data exposition.
7472
memory-cache:
75-
image: memcached
73+
image: memcached:1.6.9-alpine
7674
networks:
7775
- frontsidebus
7876
restart: on-failure

src/edrn.rdf/edrn/rdf/dmccprotocolrdfgenerator.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# encoding: utf-8
2-
# Copyright 2012 California Institute of Technology. ALL RIGHTS
2+
# Copyright 2012–2021 California Institute of Technology. ALL RIGHTS
33
# RESERVED. U.S. Government Sponsorship acknowledged.
44

55
'''DMCC Protocol RDF Generator. An RDF generator that describes EDRN protocols using the DMCC's bungling web services.
@@ -178,6 +178,12 @@ class IDMCCProtocolRDFGenerator(IRDFGenerator):
178178
description=_('Uniform Resource Identifier for the cancer type predicate.'),
179179
required=True,
180180
)
181+
cancerTypeURIPrefix = schema.TextLine(
182+
title=_('Disease URI Prefix'),
183+
description=_('URI prefix to identity Disease objects for the cancer type studied by a protocol.'),
184+
required=True,
185+
default='http://edrn.nci.nih.gov/data/diseases/'
186+
)
181187
commentsURI = schema.TextLine(
182188
title=_('Comments URI'),
183189
description=_('Uniform Resource Identifier for the comments predicate.'),
@@ -412,7 +418,6 @@ def addToGraph(self, graph, context):
412418
'Protocol_Aims': 'aimsURI',
413419
'Protocol_Analytic_Method': 'analyticMethodURI',
414420
'Protocol_Blinding': 'blindingURI',
415-
'Protocol_Cancer_Type': 'cancerTypeURI',
416421
'Protocol_Collaborative_Group': 'collaborativeGroupTextURI',
417422
'Protocol_Comments': 'commentsURI',
418423
'Protocol_Data_Sharing_Plan': 'dataSharingPlanURI',
@@ -484,13 +489,22 @@ def _addMiscFields(self, graph, context):
484489
if not obj: continue
485490
predicateURI = URIRef(getattr(context, predicateFieldName))
486491
graph.add((subjectURI, predicateURI, Literal(obj)))
492+
def _addCancerTypes(self, graph, context):
493+
subjectURI, predicateURI = self.getSubjectURI(context), URIRef(context.cancerTypeURI)
494+
values = self.slots.get('Protocol_Cancer_Type', '')
495+
for value in values.strip().split(', '):
496+
value = value.strip()
497+
if value:
498+
graph.add((subjectURI, predicateURI, URIRef(context.cancerTypeURIPrefix + value)))
487499
def addToGraph(self, graph, specifics, context):
488500
self._addInvolvedInvestigatorSites(graph, specifics, context)
489501
self._addOtherSites(graph, context)
490502
self._addPublications(graph, context)
491503
self._addFieldsOfResearch(graph, context)
504+
self._addCancerTypes(graph, context)
492505
self._addMiscFields(graph, context)
493506

507+
494508
_specificsMap = {
495509
'Animal_Subject_Training_Received': 'animalTraining',
496510
'Human_Subject_Training_Recieved': 'humanTraining',

0 commit comments

Comments
 (0)