Skip to content
This repository was archived by the owner on Jan 24, 2018. It is now read-only.

Commit 8620a87

Browse files
authored
Merge branch 'master' into 1392_notes
2 parents 3bc8193 + b013734 commit 8620a87

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

docs/installation.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Download and unpack the example data:
6262

6363
.. code-block:: bash
6464
65-
$ wget https://github.com/ga4gh/server/releases/download/data/ga4gh-example-data-v4.3.tar
66-
$ tar -xf ga4gh-example-data-v4.3.tar
65+
$ wget https://github.com/ga4gh/server/releases/download/data/ga4gh-example-data-v4.5.tar
66+
$ tar -xf ga4gh-example-data-v4.5.tar
6767
6868
Create the WSGI file at ``/srv/ga4gh/application.wsgi`` and write the following
6969
contents:
@@ -190,13 +190,13 @@ If you already have a dataset on your machine, you can download and deploy the a
190190

191191
.. code-block:: bash
192192
193-
$ docker run -e GA4GH_DATA_SOURCE=/data -v /my/ga4gh_data/:/data:ro -d -p 8000:80 --name ga4gh_server afirth/ga4gh-server:latest
193+
$ docker run -e GA4GH_DATA_SOURCE=/data -v /my/ga4gh_data/:/data:ro -d -p 8000:80 --name ga4gh_server ga4gh/ga4gh-server:latest
194194
195195
Replace ``/my/ga4gh_data/`` with the path to your data.
196196

197197
This will:
198198

199-
* pull the automatically built image from `Dockerhub <https://registry.hub.docker.com/u/afirth/ga4gh-server/>`_
199+
* pull the automatically built image from `Dockerhub <https://registry.hub.docker.com/u/ga4gh/ga4gh-server/>`_
200200
* start an apache server running mod_wsgi on container port 80
201201
* mount your data read-only to the docker container
202202
* assign a name to the container
@@ -210,7 +210,7 @@ If you do not have a dataset yet, you can deploy a container which includes the
210210

211211
.. code-block:: bash
212212
213-
$ docker run -d -p 8000:80 --name ga4gh_demo afirth/ga4gh-server:develop-demo
213+
$ docker run -d -p 8000:80 --name ga4gh_demo ga4gh/ga4gh-server:develop-demo
214214
215215
This is identical to the production container, except that a copy of the demo data is included and appropriate defaults are set.
216216

@@ -228,11 +228,11 @@ From the client, the server is accessible at ``http://server/``, and the ``/tmp/
228228
229229
# start the server daemon
230230
# assumes the demo data on host at /my/ga4gh_data
231-
$ docker run -e GA4GH_DEBUG=True -e GA4GH_DATA_SOURCE=/data -v /my/ga4gh_data/:/data:ro -d --name ga4gh_server afirth/ga4gh-server:latest
231+
$ docker run -e GA4GH_DEBUG=True -e GA4GH_DATA_SOURCE=/data -v /my/ga4gh_data/:/data:ro -d --name ga4gh_server ga4gh/ga4gh-server:latest
232232
233233
# start the client and drop into a bash shell, with mydev/ mounted read/write
234234
# --link adds a host entry for server, and --rm destroys the container when you exit
235-
$ docker run -e GA4GH_DEBUG=True -v /tmp/mydev/:/app/mydev:rw -it --name ga4gh_client --link ga4gh_server:server --entrypoint=/bin/bash --rm afirth/ga4gh-server:latest
235+
$ docker run -e GA4GH_DEBUG=True -v /tmp/mydev/:/app/mydev:rw -it --name ga4gh_client --link ga4gh_server:server --entrypoint=/bin/bash --rm ga4gh/ga4gh-server:latest
236236
237237
# call the client code script
238238
root@md5:/app# ./mydev/demo_example.py
@@ -260,7 +260,7 @@ For more info on port forwarding see `the VirtualBox manual <https://www.virtual
260260
Advanced
261261
++++++++
262262

263-
If you want to build the images yourself, that is possible. The `afirth/ga4gh-server repo <https://registry.hub.docker.com/u/afirth/ga4gh-server/>`_
263+
If you want to build the images yourself, that is possible. The `ga4gh/ga4gh-server repo <https://registry.hub.docker.com/u/ga4gh/ga4gh-server/>`_
264264
builds automatically on new commits, so this is only needed if you want to modify the Dockerfiles, or build from a different source.
265265

266266
The prod and demo builds are based off of `mod_wsgi-docker <https://github.com/GrahamDumpleton/mod_wsgi-docker>`_, a project from the author of mod_wsgi.
@@ -319,7 +319,7 @@ To enable DEBUG on your docker server, call docker run with ``-e GA4GH_DEBUG=Tru
319319

320320
.. code-block:: bash
321321
322-
$ docker run -itd -p 8000:80 --name ga4gh_demo -e GA4GH_DEBUG=True afirth/ga4gh-server:develop-demo
322+
$ docker run -itd -p 8000:80 --name ga4gh_demo -e GA4GH_DEBUG=True ga4gh/ga4gh-server:latest
323323
324324
This will set the environment variable which is read by config.py
325325

ga4gh/repo/rnaseq2ga.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RnaSqliteStore(object):
2020
def __init__(self, sqliteFileName):
2121
self._dbConn = sqlite3.connect(sqliteFileName)
2222
self._cursor = self._dbConn.cursor()
23-
self._batchSize = 100
23+
self._batchSize = 2000
2424
self._rnaValueList = []
2525
self._expressionValueList = []
2626

@@ -109,16 +109,20 @@ def setUnits(self, units):
109109
elif units == "tpm":
110110
self._units = 2
111111

112-
def writeExpression(self, rnaQuantificationId, quantfilename):
112+
def writeExpression(self, rnaQuantificationId, quantfilename,
113+
featureSetNames=None):
113114
"""
114115
Reads the quantification results file and adds entries to the
115116
specified database.
116117
"""
117118
isNormalized = self._isNormalized
118119
units = self._units
119120
featureSets = None
120-
if self._dataset:
121-
featureSets = self._dataset.getFeatureSets()
121+
if self._dataset and featureSetNames:
122+
featureSets = []
123+
for annotationName in featureSetNames.split(","):
124+
featureSets.append(
125+
self._dataset.getFeatureSetByName(annotationName))
122126
with open(quantfilename, "r") as quantFile:
123127
quantificationReader = csv.DictReader(quantFile, delimiter=b"\t")
124128
for expression in quantificationReader:
@@ -246,9 +250,10 @@ def writeRnaseqTable(rnaDB, analysisIds, description, annotationId,
246250
rnaDB.batchaddRNAQuantification()
247251

248252

249-
def writeExpressionTable(writer, data):
253+
def writeExpressionTable(writer, data, featureSetNames=None):
250254
for rnaQuantId, quantfilename in data:
251-
writer.writeExpression(rnaQuantId, quantfilename)
255+
writer.writeExpression(
256+
rnaQuantId, quantfilename, featureSetNames=featureSetNames)
252257

253258

254259
def rnaseq2ga(quantificationFilename, sqlFilename, localName, rnaType,
@@ -291,4 +296,6 @@ def rnaseq2ga(quantificationFilename, sqlFilename, localName, rnaType,
291296
featureSetIds,
292297
readGroupId=readGroupIds, programs=programs,
293298
bioSampleId=bioSampleId)
294-
writeExpressionTable(writer, [(localName, quantificationFilename)])
299+
writeExpressionTable(
300+
writer, [(localName, quantificationFilename)],
301+
featureSetNames=featureSetNames)

0 commit comments

Comments
 (0)