about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins2026-04-05 11:15:23 +0200
committerPjotr Prins2026-04-05 11:15:23 +0200
commit433e5670464565948ead89097190b303168e27f0 (patch)
tree5172e1c30e117d8e8503010c14894c3a2414594a
parent45be8b7f1e4bc046fd2e5b1a6bdf4c6db4057788 (diff)
downloadgenecup-433e5670464565948ead89097190b303168e27f0.tar.gz
Settings now use edirect updated EDIRECT_LOCAL_ARCHIVE
-rw-r--r--README.md4
-rw-r--r--etc/archive-pubmed.service3
-rwxr-xr-xmore_functions.py8
-rwxr-xr-xserver.py2
4 files changed, 8 insertions, 9 deletions
diff --git a/README.md b/README.md
index 9e52138..749a9c5 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ Following the instruction provided by NCBI: https://www.nlm.nih.gov/dataguide/ed
 Point environment variables to this dir and run in the local source tree:
 
 ```
-env EDIRECT_PUBMED_ARCHIVE=/export/PubMed `guix build -L . genecup-gemini`/bin/genecup --port 4201
+env EDIRECT_LOCAL_ARCHIVE=/export3/PubMed/Source `guix build -L . genecup-gemini`/bin/genecup --port 4201
 ```
 
 You can run from a proper container:
@@ -57,7 +57,7 @@ guix shell -L ~/guix-bioinformatics -L . -C -N -F genecup-gemini -- genecup --po
 Environment variables used:
 
 ```
-EDIRECT_PUBMED_ARCHIVE: PubMed datadir (defaults to built-in minipubmed)
+EDIRECT_LOCLA_ARCHIVE: PubMed datadir (defaults to built-in minipubmed)
 GENECUP_DATADIR: SQLITE DB directory (default .)
 NLTK_DATA: punkt_tab directory (defaults to built-in nltk-punkt)
 TMPDIR (default /tmp)
diff --git a/etc/archive-pubmed.service b/etc/archive-pubmed.service
index ba5b293..703a23e 100644
--- a/etc/archive-pubmed.service
+++ b/etc/archive-pubmed.service
@@ -7,9 +7,8 @@ AssertPathExists=/export/PubMed
 
 [Service]
 ExecStart=/usr/local/guix-profiles/genecup/bin/index-pubmed
-Environment="EDIRECT_PUBMED_MASTER=/export/PubMed" "PERL_LWP_SSL_CA_FILE=/etc/ssl/certs/ca-certificates.crt" "PATH=/usr/local/guix-profiles/ratspub/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin"
+Environment="EDIRECT_LOCAL_ARCHIVE=/export/PubMed" "PERL_LWP_SSL_CA_FILE=/etc/ssl/certs/ca-certificates.crt" "PATH=/usr/local/guix-profiles/ratspub/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin"
 User=hchen
 
 [Install]
 WantedBy=multi-user.target
-
diff --git a/more_functions.py b/more_functions.py
index ef43e30..96e20e5 100755
--- a/more_functions.py
+++ b/more_functions.py
@@ -200,14 +200,14 @@ def searchArchived(sets, query, filetype,sents, path_user):
         gwas_json+="{ \"id\": \"" + edgeID + "\", \"source\": \"" + query + "\", \"target\": \"" + key + "\", \"sentCnt\": \"" + str(catCnt[key]) + "\",  \"url\":\"/sentences?edgeID=" + edgeID + "\" },\n"
     return(nodes+edges,gwas_json,sn_file)
 
-pubmed_path=os.environ.get("EDIRECT_PUBMED_MASTER", "./minipubmed")
+pubmed_path=os.environ.get("EDIRECT_LOCAL_ARCHIVE", "./minipubmed")
 print(f"  pubmed_path={pubmed_path}")
 
 if not os.path.isdir(pubmed_path):
-    print(f"ERROR: EDIRECT_PUBMED_MASTER directory not found: {pubmed_path}")
+    print(f"ERROR: EDIRECT_LOCAL_ARCHIVE directory not found: {pubmed_path} - note this is a recent env variable that replaces the others")
     raise SystemExit(1)
-testdir = os.path.join(pubmed_path, "Archive", "01")
+testdir = os.path.join(pubmed_path, "pubmed", "Archive", "00")
 if not os.path.isdir(testdir):
-    print(f"ERROR: PubMed/Archive not found in {pubmed_path}")
+    print(f"ERROR: PubMed/Archive not found in {testdir} (EDIRECT_LOCAL_ARCHIVE={pubmed_path})")
     raise SystemExit(1)
     raise SystemExit(1)
diff --git a/server.py b/server.py
index 2a2b925..6c5c6a4 100755
--- a/server.py
+++ b/server.py
@@ -1941,7 +1941,7 @@ if __name__ == '__main__':
     parser.add_argument('-d', '--debug', action='store_true', help='enable debug mode')
     args = parser.parse_args()
     print("GeneCup server starting...")
-    print(f"  EDIRECT_PUBMED_MASTER={os.environ.get('EDIRECT_PUBMED_MASTER', '(not set)')}")
+    print(f"  EDIRECT_LOCAL_ARCHIVE={os.environ.get('EDIRECT_LOCAL_ARCHIVE', '(not set)')}")
     print(f"  GEMINI_API_KEY={'set (from ~/.config/gemini/credentials)' if GEMINI_API_KEY else '(not set)'}")
     print(f"  NLTK_DATA={os.environ.get('NLTK_DATA', '(not set)')}")
     print(f"  GENECUP_DATADIR={os.environ.get('GENECUP_DATADIR', '(not set, default: ./)')}")