From b5fa1318e10edf0b30cd76ae251ad700c3796c04 Mon Sep 17 00:00:00 2001 From: adf Date: Tue, 24 Sep 2024 17:14:02 -0400 Subject: [PATCH] tweaks for a version of sequence server that the mines can post sequences to --- .env | 3 ++- compose.yml | 2 +- db/Dockerfile | 2 +- lib/sequenceserver/config.rb | 2 +- lib/sequenceserver/links.rb | 14 ++++++++++---- lib/sequenceserver/routes.rb | 2 +- public/js/form.js | 3 +-- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.env b/.env index 514542da8..f0fe340b7 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ -COMPOSE_PROJECT_NAME=lis-blast +COMPOSE_PROJECT_NAME=all-genera-blast3 +REVERSE_PROXY_PORT=8010 diff --git a/compose.yml b/compose.yml index bcb20820d..c737403fe 100644 --- a/compose.yml +++ b/compose.yml @@ -14,4 +14,4 @@ services: healthcheck: test: ["CMD-SHELL", "{ curl -qo /dev/null http://localhost:4567/searchdata.json || exit 1; } && [ $$(ps -p $$(pgrep --parent 1 --ful sequenceserver) -o rss=) -lt 4000000 ] || kill 1"] ports: - - "4567:4567" + - "${REVERSE_PROXY_PORT}:4567" diff --git a/db/Dockerfile b/db/Dockerfile index f1e71850c..ec4e40ab4 100644 --- a/db/Dockerfile +++ b/db/Dockerfile @@ -1,7 +1,6 @@ FROM ncbi/blast-static:2.14.1 WORKDIR /db -VOLUME ["/db"] ENV DATA_STORE=https://data.legumeinfo.org RUN printf '#!/bin/bash\nset -o pipefail -o errexit -o nounset; curl ${DATA_STORE}/${1} | gzip -dc | makeblastdb -parse_seqids -hash_index -dbtype ${2} -taxid ${3} -title "${4}" -out $(basename ${1#.f*.gz})\n' > /usr/local/bin/mkblastdb \ @@ -109,3 +108,4 @@ RUN mkblastdb Vigna/angularis/annotations/Gyeongwon.gnm3.ann1.3Nz5/vigan.Gyeongw RUN mkblastdb Vigna/radiata/annotations/VC1973A.gnm7.ann1.RWBG/vigra.VC1973A.gnm7.ann1.RWBG.protein.faa.gz prot 157791 'Vigna radiata VC1973A v7.1 proteins' RUN mkblastdb Vigna/unguiculata/annotations/IT97K-499-35.gnm1.ann2.FD7K/vigun.IT97K-499-35.gnm1.ann2.FD7K.protein_primary.faa.gz prot 3917 'Vigna unguiculata IT97K-499-35 v1.2 proteins' +VOLUME ["/db"] diff --git a/lib/sequenceserver/config.rb b/lib/sequenceserver/config.rb index 297645ef8..1e8a3c3cd 100644 --- a/lib/sequenceserver/config.rb +++ b/lib/sequenceserver/config.rb @@ -130,7 +130,7 @@ def defaults } }, num_threads: 1, - num_jobs: 1, + num_jobs: 5, job_lifetime: 43_200, # Set cloud_share_url to 'disabled' to disable the cloud sharing feature cloud_share_url: 'https://share.sequenceserver.com/api/v1/shared-job', diff --git a/lib/sequenceserver/links.rb b/lib/sequenceserver/links.rb index 3dc228714..dcfbfc11b 100644 --- a/lib/sequenceserver/links.rb +++ b/lib/sequenceserver/links.rb @@ -87,8 +87,10 @@ def jbrowse end # Prepare other fields besides sessionTracks - locStart = coordinates[1][0].to_s() - locEnd = coordinates[1][1].to_s() + #locStart = coordinates[1][0].to_s() + #locEnd = coordinates[1][1].to_s() + locStart = hsps[0].sstart.to_s() + locEnd = hsps[0].send.to_s() assembly = id.match('^.+gnm\d+')[0] tracks = 'sequenceserver_track' @@ -134,8 +136,12 @@ def jbrowse sessionTracks << ']}}]' # Assemble the JBrowse link URL from the fields above - url = 'https://dev.peanutbase.org/tools/jbrowse2/' - url << '?loc=' + id + ':' + locStart + '-' + locEnd + url = 'https://all-genera.lis.ncgr.org/tools/jbrowse2/' + if locStart <= locEnd + url << '?loc=' + id + ':' + locStart + '-' + locEnd + else + url << '?loc=' + id + ':' + locEnd + '-' + locStart + end url << '&assembly=' + assembly url << '&tracks=' + tracks url << '&sessionTracks=' + sessionTracks diff --git a/lib/sequenceserver/routes.rb b/lib/sequenceserver/routes.rb index 9effe1966..5873118cd 100644 --- a/lib/sequenceserver/routes.rb +++ b/lib/sequenceserver/routes.rb @@ -66,7 +66,7 @@ class Routes < Sinatra::Base secret: ENV.fetch('SESSION_SECRET') { SecureRandom.alphanumeric(64) } ) - use Rack::Csrf, raise: true, skip: ['POST:/cloud_share'] + #use Rack::Csrf, raise: true, skip: ['POST:/cloud_share'] end unless ENV['SEQUENCE_SERVER_COMPRESS_RESPONSES'] == 'false' diff --git a/public/js/form.js b/public/js/form.js index 2ab4b3e34..ff4602ddb 100644 --- a/public/js/form.js +++ b/public/js/form.js @@ -203,7 +203,6 @@ export class Form extends Component {
-
@@ -305,4 +304,4 @@ class MixedNotification extends Component {
); } -} \ No newline at end of file +}