summaryrefslogtreecommitdiff
path: root/elink
diff options
context:
space:
mode:
authorAaron M. Ucko <ucko@debian.org>2021-01-24 17:24:00 -0500
committerAaron M. Ucko <ucko@debian.org>2021-01-24 17:24:00 -0500
commitfbbab8008d5097238a962aa54b5515b77867392e (patch)
treede6d8e1bd987b3dcb2431aef1f84c67ba71f2c63 /elink
parente6110438bdc0c7eba20790c6ff0a597565505d38 (diff)
New upstream version 14.1.20201130+dfsg
Diffstat (limited to 'elink')
-rwxr-xr-xelink37
1 files changed, 34 insertions, 3 deletions
diff --git a/elink b/elink
index 4797c1e..9e376ed 100755
--- a/elink
+++ b/elink
@@ -34,6 +34,15 @@
pth=$( dirname "$0" )
+case ":$PATH:" in
+ *:"$pth":* )
+ ;;
+ * )
+ PATH="$PATH:$pth"
+ export PATH
+ ;;
+esac
+
# conditionally execute original Perl implementation
PERL=""
@@ -343,7 +352,7 @@ then
needHistory=true
fi
-# take database from WebEnv value or -db argument
+# take database from dbase value or -db argument
if [ -z "$dbase" ]
then
@@ -452,7 +461,7 @@ then
fi
fi
-# special case to lookup accessions in assembly
+# special case to lookup accessions in assembly database
if [ "$dbase" = "assembly" ] && [ "$needHistory" = false ] && [ -n "$ids" ]
then
@@ -464,8 +473,30 @@ then
fi
fi
+# special case to lookup accessions in protein database
+
+if [ "$dbase" = "protein" ] && [ "$needHistory" = false ] && [ -n "$ids" ]
+then
+ hasAccns=$( echo "$ids" | sed -e 's/[0-9,]//g' )
+ if [ -n "$hasAccns" ]
+ then
+ query=$( ProteinAccnQuery )
+ ids=$( esearch -db "$dbase" -query "$query" | efetch -format uid )
+ fi
+fi
+
# -cited or -cites access the NIH Open Citation Collection dataset (see PMID 31600197)
+PostInIcite() {
+
+ if [ -n "$web_env" ]
+ then
+ epost -db pubmed -web "$web_env" -log "$log"
+ else
+ epost -db pubmed -log "$log"
+ fi
+}
+
LinkInIcite() {
iciteElement="$1"
@@ -479,7 +510,7 @@ LinkInIcite() {
done |
accn-at-a-time |
sort -n | uniq |
- epost -db pubmed -log "$log"
+ PostInIcite
}
QueryIcite() {