diff --git a/Dockerfile b/Dockerfile index 504b8e3..173f5e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,10 +34,12 @@ ENV SITE_NAME="lis" \ GCV_URL="http://localhost:8100" \ TRIPAL_URL="https://legumeinfo.org" \ DEBUG="false" \ - HOST="gcv" + HOST="gcv" \ + USE_GENE_UNAME="false" # Patch needed for external links to tripal_phylotree ADD PR131.diff /opt/ +ADD gene_uname.diff /opt/ RUN mkdir -p /opt/gcv && \ mkdir -p /etc/gcv && \ @@ -46,7 +48,8 @@ RUN mkdir -p /opt/gcv && \ git checkout b195bf434fb9bc7f280c62c1dbd82642eca63448 && \ patch -p1 < /opt/PR131.diff && \ cd server && \ - pip install -r requirements.txt + pip install -r requirements.txt && \ + cp services/views.py /etc/gcv/original_views.py ADD config.json.template /etc/gcv/config.json.template ADD settings.py /opt/gcv/server/server/settings.py diff --git a/README.md b/README.md index ca79e7a..f47faa3 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ The following environment variables are available: |TRIPAL_URL|Address of a Tripal instance installed with tripal_phylotree module and a tripal_linkout module|https://legumeinfo.org| |DEBUG|Set to 'true' to activate the debug mode|false| |HOST|Hostname|gcv| +|USE_GENE_UNAME|Set to 'true' if you prefer GCV to look for genes using their uniquename|false| ## Contributing diff --git a/entrypoint.sh b/entrypoint.sh index ea8b2cc..437ade0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -84,6 +84,12 @@ npm run build cd /opt/gcv/server/ +cp /etc/gcv/original_views.py services/views.py +if [ "$USE_GENE_UNAME" == "true" ] +then + patch -p1 < /opt/gene_uname.diff +fi + # Run nginx in background nginx -g "daemon on;" diff --git a/gene_uname.diff b/gene_uname.diff new file mode 100644 index 0000000..738c9e5 --- /dev/null +++ b/gene_uname.diff @@ -0,0 +1,13 @@ +diff --git a/services/views.py b/services/views.py +index 895f92b..4d7bc7f 100644 +--- a/services/views.py ++++ b/services/views.py +@@ -302,7 +302,7 @@ def v1_gene_to_query_track(request): + # make sure the request type is POST and that it contains a focus gene name + if request.method == 'POST' and 'gene' in POST and 'neighbors' in POST: + # get the focus gene of the query track +- focus = get_object_or_404(Feature, name=POST['gene']) ++ focus = get_object_or_404(Feature, uniquename=POST['gene']) + focus_id = focus.pk + focus_order = list(GeneOrder.objects.filter(gene=focus)) + if len(focus_order) == 0: