diff options
| author | Pjotr Prins | 2026-03-28 09:36:21 +0100 |
|---|---|---|
| committer | Pjotr Prins | 2026-03-28 09:36:21 +0100 |
| commit | 3554086ea2858c70d4a5be66e679890bad1216cb (patch) | |
| tree | 148dd006b74346beb50a9da1cc77565ea5c387f0 | |
| parent | 50f82526e8348c10bc1f16c92f6f0c1d879b9245 (diff) | |
| download | genecup-3554086ea2858c70d4a5be66e679890bad1216cb.tar.gz | |
Print external commands to console
| -rwxr-xr-x | more_functions.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/more_functions.py b/more_functions.py index 7f12215..8421ca6 100755 --- a/more_functions.py +++ b/more_functions.py @@ -22,9 +22,11 @@ def findWholeWord(w): def getabstracts(gene,query): query="\"(" + query + ") AND (" + gene + " [tiab])\"" - abstracts = os.popen("esearch -db pubmed -query " + query \ + cmd = "esearch -db pubmed -query " + query \ + " | efetch -format uid |fetch-pubmed -path "+ pubmed_path \ - + " | xtract -pattern PubmedArticle -element MedlineCitation/PMID,ArticleTitle,AbstractText|sed \"s/-/ /g\"").read() + + " | xtract -pattern PubmedArticle -element MedlineCitation/PMID,ArticleTitle,AbstractText|sed \"s/-/ /g\"" + print(f" popen: {cmd}") + abstracts = os.popen(cmd).read() return(abstracts) def getSentences(gene, sentences_ls): @@ -176,6 +178,7 @@ def searchArchived(sets, query, filetype,sents, path_user): return(nodes+edges,gwas_json,sn_file) pubmed_path=os.environ.get("EDIRECT_PUBMED_MASTER", "./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}") |
