[med-svn] [Git][med-team/ncbi-entrez-direct][upstream] 6 commits: New upstream version 19.0.20230314+dfsg
Aaron M. Ucko (@ucko)
gitlab at salsa.debian.org
Fri Mar 31 04:30:29 BST 2023
Aaron M. Ucko pushed to branch upstream at Debian Med / ncbi-entrez-direct
Commits:
9fb1b7d3 by Aaron M. Ucko at 2023-03-15T21:42:11-04:00
New upstream version 19.0.20230314+dfsg
- - - - -
1b284baa by Aaron M. Ucko at 2023-03-22T21:35:28-04:00
New upstream version 19.1.20230316+dfsg
- - - - -
1cd38049 by Aaron M. Ucko at 2023-03-22T21:36:49-04:00
New upstream version 19.1.20230317+dfsg
- - - - -
b1381ead by Aaron M. Ucko at 2023-03-29T22:01:56-04:00
New upstream version 19.2.20230323+dfsg
- - - - -
4a1cd93d by Aaron M. Ucko at 2023-03-29T22:03:47-04:00
New upstream version 19.2.20230324+dfsg
- - - - -
d85fe067 by Aaron M. Ucko at 2023-03-30T23:04:11-04:00
New upstream version 19.2.20230330+dfsg
- - - - -
24 changed files:
- README
- archive-pubmed
- + blst2gm
- cmd/go.mod
- cmd/go.sum
- cmd/rchive.go
- cmd/transmute.go
- cmd/xtract.go
- download-ncbi-data
- ecommon.sh
- elink
- esearch
- eutils/format.go
- eutils/go.mod
- eutils/go.sum
- eutils/normal.go
- eutils/utils.go
- eutils/valid.go
- eutils/xml.go
- eutils/xplore.go
- + gm2ranges
- help/tst-efetch.txt
- test-edirect
- transmute
Changes:
=====================================
README
=====================================
@@ -14,7 +14,7 @@ Navigation programs (esearch, elink, efilter, and efetch) communicate by means o
Accessory programs (nquire, transmute, and xtract) can help eliminate the need for writing custom software to answer ad hoc questions. Queries can move seamlessly between EDirect programs and Unix utilities or scripts to perform actions that cannot be accomplished entirely within Entrez.
-All EDirect programs are designed to work on large sets of data. Intermediate results are stored on the Entrez history server. For best performance, obtain an API Key from NCBI, and place the following line in your .bash_profile and .zshrc configuration files:
+All EDirect programs are designed to work on large sets of data. Intermediate results are either saved on the Entrez history server or instantiated in the hidden message. For best performance, obtain an API Key from NCBI, and place the following line in your .bash_profile and .zshrc configuration files:
export NCBI_API_KEY=unique_api_key
@@ -314,7 +314,7 @@ Gene names and chromosomal positions are extracted by piping the records to:
with the -if statement eliminating coordinates from pseudoautosomal gene copies present on the Y chromosome telomeres. Results can now be sorted by position, and then filtered and partitioned:
- sort -k 1,1n | cut -f 2- |
+ sort-table -k 1,1n | cut -f 2- |
grep -v pseudogene | grep -v uncharacterized | grep -v hypothetical |
between-two-genes AMER1 FAAH2
@@ -481,7 +481,7 @@ Fetching data from Entrez works well when a few thousand records are needed, but
LOCAL RECORD CACHE
-EDirect can now preload over 30 million live PubMed records onto an inexpensive external 500 GB solid state drive as individual files for rapid retrieval. For example, PMID 12345678 would be stored at:
+EDirect can now preload over 35 million live PubMed records onto an inexpensive external 500 GB solid-state drive as individual files for rapid retrieval. For example, PMID 12345678 would be stored at:
/Archive/12/34/56/12345678.xml.gz
=====================================
archive-pubmed
=====================================
@@ -780,13 +780,19 @@ fi
if [ "$nihocc" = true ]
then
- if [ ! -f "$WORKING/Extras/open_citation_collection.zip" ]
+ cd "$WORKING/Extras"
+ if [ ! -f "open_citation_collection.zip" ]
then
- echo "ERROR: Please download open_citation_collection.zip file to Extras directory"
- echo ""
- echo "EXITING DUE TO MISSING NCBI OCC DATA FILE"
- echo ""
- nihocc=false
+ echo "Downloading NIH Open Citation Collection"
+ download-ncbi-data nihocc
+ if [ ! -f "open_citation_collection.zip" ]
+ then
+ echo "ERROR: Unable to download open_citation_collection.zip file to Extras directory"
+ echo ""
+ echo "EXITING DUE TO MISSING NCBI OCC DATA FILE"
+ echo ""
+ nihocc=false
+ fi
fi
fi
=====================================
blst2gm
=====================================
@@ -0,0 +1,18 @@
+#!/bin/bash -norc
+
+# Public domain notice for all NCBI EDirect scripts is located at:
+# https://www.ncbi.nlm.nih.gov/books/NBK179288/#chapter6.Public_Domain_Notice
+
+# cat smear.asn | blst2gm > smear.tsv
+# AY046051.1 126 5613|-1|5599 119|1|14 minus|minus|minus
+
+xtract -pattern annot_E \
+ -group desc/user -if type/str -equals "Blast Type" -FOUND label/str \
+ -group annot_E -if "&FOUND" -equals "BLASTN - mrna" \
+ -block align_E -ACCVER "()" -SCORE "()" -STARTS "()" -LENGTHS "()" -STRANDS "()" \
+ -subset denseg -sep "." -ACCVER accession,version \
+ -subset score_E -if id/str -equals "score" -SCORE value/int \
+ -subset starts_E -position odd -sep "|" --STARTS starts_E \
+ -subset strands_E -position odd -sep "|" --STRANDS strands_E \
+ -subset lens_E -sep "|" --LENGTHS lens_E \
+ -subset align_E -def "-" -element "&ACCVER" "&SCORE" "&STARTS" "&LENGTHS" "&STRANDS" -deq "\n"
=====================================
cmd/go.mod
=====================================
@@ -6,31 +6,36 @@ replace eutils => ../eutils
require (
eutils v0.0.0-00010101000000-000000000000 // indirect
- github.com/fatih/color v1.13.0 // indirect
+ github.com/bytedance/sonic v1.8.0 // indirect
+ github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
+ github.com/fatih/color v1.14.1 // indirect
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
- github.com/gin-gonic/gin v1.8.1 // indirect
- github.com/go-playground/locales v0.14.0 // indirect
- github.com/go-playground/universal-translator v0.18.0 // indirect
- github.com/go-playground/validator/v10 v10.10.0 // indirect
- github.com/goccy/go-json v0.9.7 // indirect
+ github.com/gin-gonic/gin v1.9.0 // indirect
+ github.com/go-playground/locales v0.14.1 // indirect
+ github.com/go-playground/universal-translator v0.18.1 // indirect
+ github.com/go-playground/validator/v10 v10.11.2 // indirect
+ github.com/goccy/go-json v0.10.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/compress v1.15.13 // indirect
+ github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/cpuid v1.3.1 // indirect
+ github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
- github.com/mattn/go-colorable v0.1.9 // indirect
- github.com/mattn/go-isatty v0.0.14 // indirect
+ github.com/mattn/go-colorable v0.1.13 // indirect
+ github.com/mattn/go-isatty v0.0.17 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
- github.com/pelletier/go-toml/v2 v2.0.1 // indirect
+ github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/surgebase/porter2 v0.0.0-20150829210152-56e4718818e8 // indirect
- github.com/ugorji/go/codec v1.2.7 // indirect
- golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
- golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/text v0.5.0 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
- gopkg.in/yaml.v2 v2.4.0 // indirect
+ github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
+ github.com/ugorji/go/codec v1.2.9 // indirect
+ golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
+ golang.org/x/crypto v0.5.0 // indirect
+ golang.org/x/net v0.7.0 // indirect
+ golang.org/x/sys v0.5.0 // indirect
+ golang.org/x/text v0.8.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
)
=====================================
cmd/go.sum
=====================================
@@ -1,96 +1,88 @@
-github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
+github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA=
+github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
+github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
-github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
+github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
+github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ=
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
-github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=
-github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
-github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
-github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
-github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
-github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
-github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
-github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0=
-github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos=
-github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM=
-github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8=
+github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k=
+github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
+github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
+github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
+github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
+github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU=
+github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s=
+github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA=
+github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
-github.com/klauspost/compress v1.15.13 h1:NFn1Wr8cfnenSJSA46lLq4wHCcBzKTSjnBIexDMMOV0=
-github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
+github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4=
+github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s=
github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4=
+github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
+github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
-github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
-github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
-github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
-github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
-github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
+github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
+github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
+github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
-github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU=
-github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
-github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
+github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=
+github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
-github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/surgebase/porter2 v0.0.0-20150829210152-56e4718818e8 h1:5vXv18UxS9YuPlwenRHgGnJrRgE/XUjMQGJzggIar94=
github.com/surgebase/porter2 v0.0.0-20150829210152-56e4718818e8/go.mod h1:galqUK/f4MNkChzZE+tDTitV20g9grEqy3P5IHaVIk8=
-github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
-github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
-github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
-golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI=
-golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
-golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
-golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
-golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
+github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
+github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU=
+github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
+golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU=
+golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE=
+golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
+golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
+golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
+golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
-google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
+google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
-gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
=====================================
cmd/rchive.go
=====================================
@@ -2113,7 +2113,7 @@ func main() {
switch args[0] {
case "-version":
fmt.Printf("%s\n", eutils.EDirectVersion)
- case "-help", "help":
+ case "-help", "help", "--help":
eutils.PrintHelp("rchive", "rchive-help.txt")
case "-extras", "-extra", "-advanced":
eutils.PrintHelp("rchive", "rchive-extras.txt")
=====================================
cmd/transmute.go
=====================================
@@ -337,6 +337,13 @@ func processTokens(rdr <-chan eutils.XMLBlock) {
}
buffer.WriteString(name)
buffer.WriteString("\n")
+ case eutils.PROCESSTAG:
+ buffer.WriteString("PT: ")
+ for i := 0; i < indent; i++ {
+ buffer.WriteString(" ")
+ }
+ buffer.WriteString(name)
+ buffer.WriteString("\n")
case eutils.NOTAG:
buffer.WriteString("NO:")
if indent != 0 {
@@ -433,6 +440,7 @@ func processOutline(rdr <-chan eutils.XMLBlock) {
case eutils.STOPTAG:
indent--
case eutils.DOCTYPETAG:
+ case eutils.PROCESSTAG:
case eutils.NOTAG:
case eutils.ISCLOSED:
txt := buffer.String()
@@ -539,6 +547,7 @@ func processSynopsis(rdr <-chan eutils.XMLBlock, leaf bool, delim string) {
}
}
case eutils.DOCTYPETAG:
+ case eutils.PROCESSTAG:
case eutils.NOTAG:
case eutils.ISCLOSED:
txt := buffer.String()
@@ -861,6 +870,7 @@ func processFilter(rdr <-chan eutils.XMLBlock, args []string) {
buffer.WriteString("\n")
}
case eutils.DOCTYPETAG:
+ case eutils.PROCESSTAG:
case eutils.NOTAG:
case eutils.ISCLOSED:
txt := buffer.String()
@@ -2108,7 +2118,7 @@ func main() {
switch args[0] {
case "-version":
fmt.Printf("%s\n", eutils.EDirectVersion)
- case "-help", "help":
+ case "-help", "help", "--help":
eutils.PrintHelp("transmute", "transmute-help.txt")
case "-extra", "-extras":
eutils.PrintHelp("transmute", "transmute-extras.txt")
=====================================
cmd/xtract.go
=====================================
@@ -363,7 +363,7 @@ func main() {
switch args[0] {
case "-version":
fmt.Printf("%s\n", eutils.EDirectVersion)
- case "-help", "help":
+ case "-help", "help", "--help":
eutils.PrintHelp("xtract", "xtract-help.txt")
case "-examples", "-example":
eutils.PrintHelp("xtract", "xtract-examples.txt")
=====================================
download-ncbi-data
=====================================
@@ -534,7 +534,59 @@ DoJournals() {
fi
if [ ! -f "jourmaps.xml" ] && [ -f "jourindx.txt" ]
then
- cat jourindx.txt | tbl2xml -set JouralMaps -rec Journal Key Indx > jourmaps.xml
+ cat jourindx.txt | tbl2xml -set JournalMaps -rec Journal Key Indx > jourmaps.xml
+ fi
+ fi
+}
+
+DoNIHOCC() {
+ base_url=""
+ new_file_date=""
+
+ latest_occ=$(
+ nquire -get https://api.figshare.com/v2/collections/4586573/articles |
+ xtract -pattern anon -sort-rev published_date |
+ xtract -pattern anon -position first -element "*"
+ )
+ if [ -n "$latest_occ" ]
+ then
+ base_url=$( echo "$latest_occ" | xtract -pattern anon -element url )
+ new_file_date=$( echo "$latest_occ" | xtract -pattern anon -element published_date | cut -c 1-10 )
+ fi
+
+ if [ -f "open_citation_collection.zip" ] && [ -n "$new_file_date" ]
+ then
+ curr_file_date=$( date -r open_citation_collection.zip "+%Y-%m-%d" )
+ if [ -n "$curr_file_date" ]
+ then
+ if [[ "$new_file_date" > "$curr_file_date" ]]
+ then
+ # remove out-of-date file
+ rm -f "open_citation_collection.zip"
+ fi
+ fi
+ fi
+
+ if [ ! -f "open_citation_collection.zip" ] && [ -n "$base_url" ]
+ then
+ download_url=$(
+ nquire -get "$base_url" |
+ xtract -pattern opt -group files \
+ -if name -equals open_citation_collection.zip \
+ -element download_url
+ )
+ if [ -n "$download_url" ]
+ then
+ orig_name=$( echo "${download_url}" | tr '/' '\n' | tail -n 1 )
+ echo "Downloading open_citation_collection.zip will likely take at least a half hour"
+ nquire -dwn "$download_url"
+ if [ -f "$download_url" ]
+ then
+ mv "$orig_name" open_citation_collection.zip
+ echo "Downloading open_citation_collection.zip is complete"
+ else
+ echo "Downloading of open_citation_collection.zip failed"
+ fi
fi
fi
}
@@ -559,7 +611,8 @@ case "$cmd" in
-h | -help | --help | help )
cat <<EOF
USAGE: $0
- pmc-oa | pmc-bioc | bioconcepts | generif | meshtree | taxnames | serials | journals | oa-list | oa-book | carotene
+ bioconcepts | generif | meshtree | taxnames | serials | journals | nihocc |
+ pmc-oa | pmc-bioc | oa-list | oa-book | carotene | globin | human | smear
EOF
exit 0
;;
@@ -595,6 +648,10 @@ EOF
DoJournals
exit 0
;;
+ nihocc | -nihocc )
+ DoNIHOCC
+ exit 0
+ ;;
oa-list | -oa-list )
if [ ! -f "books.xml" ]
then
@@ -645,6 +702,33 @@ EOF
fi
exit 0
;;
+ globin | -globin )
+ if [ ! -f "globin.xml" ]
+ then
+ nquire -asp ftp.ncbi.nlm.nih.gov "entrez/entrezdirect/samples" "globin.xml.zip"
+ unzip -qq globin.xml.zip
+ rm globin.xml.zip
+ fi
+ exit 0
+ ;;
+ human | -human )
+ if [ ! -f "human.xml" ]
+ then
+ nquire -asp ftp.ncbi.nlm.nih.gov "entrez/entrezdirect/samples" "carhumanotene.xml.zip"
+ unzip -qq human.xml.zip
+ rm human.xml.zip
+ fi
+ exit 0
+ ;;
+ smear | -smear )
+ if [ ! -f "smear.asn" ]
+ then
+ nquire -asp ftp.ncbi.nlm.nih.gov "entrez/entrezdirect/samples" "smear.asn.zip"
+ unzip -qq smear.asn.zip
+ rm smear.asn.zip
+ fi
+ exit 0
+ ;;
natural-earth | -natural-earth )
curl -Ls -O "https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip"
curl -Ls -O "https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_disputed_areas.zip"
=====================================
ecommon.sh
=====================================
@@ -32,7 +32,7 @@
#
# ==========================================================================
-version="19.0"
+version="19.2"
# initialize common flags
@@ -960,7 +960,6 @@ SearchSOLR() {
GenerateFromSOLR() {
- currentYear=$( date +"%Y" )
total="$num"
if [ "$total" -lt 1 ]
=====================================
elink
=====================================
@@ -146,6 +146,16 @@ do
shift
if [ $# -gt 0 ]
then
+ if [ -n "$target" ]
+ then
+ if [ "$target" = "$1" ]
+ then
+ echo "${INVT} WARNING: ${LOUD} Redundant -target '$1' argument${INIT}" >&2
+ else
+ echo "${INVT} ERROR: ${LOUD} Colliding -target '$target' and '$1' arguments${INIT}" >&2
+ exit 1
+ fi
+ fi
target="$1"
shift
else
@@ -254,6 +264,27 @@ then
ParseStdin
fi
+# additional argument reality checks
+
+if [ -n "$db" ] && [ -n "$dbase" ] && [ "$db" != "$dbase" ]
+then
+ echo "${INVT} ERROR: ${LOUD} Colliding -db '$db' and ENTREZ_DIRECT Db '$dbase' arguments${INIT}" >&2
+ exit 1
+fi
+
+if [ "$related" = true ]
+then
+ if [ -n "$db" ] && [ -n "$target" ] && [ "$db" != "$target" ]
+ then
+ echo "${INVT} ERROR: ${LOUD} -related -db '$db' incompatible with -target '$target'${INIT}" >&2
+ exit 1
+ elif [ -n "$dbase" ] && [ -n "$target" ] && [ "$dbase" != "$target" ]
+ then
+ echo "${INVT} ERROR: ${LOUD} -related and ENTREZ_DIRECT Db '$dbase' incompatible with -target '$target'${INIT}" >&2
+ exit 1
+ fi
+fi
+
# needHistory allows reuse of GenerateUidList
if [ -z "$ids$rest$qury$input" ]
=====================================
esearch
=====================================
@@ -1798,6 +1798,9 @@ then
nm=$( echo "$uids" | wc -l | tr -d ' ' )
fi
+ seconds_end=$(date "+%s")
+ seconds_elapsed=$((seconds_end - seconds_start))
+
echo "<ENTREZ_DIRECT>"
if [ -n "$dbase" ]
then
@@ -1809,6 +1812,19 @@ then
else
echo " <Count>0</Count>"
fi
+ if [ -n "$stp" ]
+ then
+ stp=$(( $stp + 1 ))
+ echo " <Step>${stp}</Step>"
+ fi
+ if [ -n "$err" ]
+ then
+ echo " <Error>${err}</Error>"
+ fi
+ if [ "$timer" = true ] && [ -n "$seconds_elapsed" ]
+ then
+ echo " <Elapsed>${seconds_elapsed}</Elapsed>"
+ fi
# instantiate UIDs within ENTREZ_DIRECT message
echo "$uids" |
@@ -1818,10 +1834,6 @@ then
echo " <Id>${uid}</Id>"
done
- if [ -n "$err" ]
- then
- echo " <Error>${err}</Error>"
- fi
echo "</ENTREZ_DIRECT>"
exit 0
@@ -1843,6 +1855,9 @@ then
nm=$( echo "$uids" | wc -l | tr -d ' ' )
fi
+ seconds_end=$(date "+%s")
+ seconds_elapsed=$((seconds_end - seconds_start))
+
echo "<ENTREZ_DIRECT>"
if [ -n "$dbase" ]
then
@@ -1854,6 +1869,19 @@ then
else
echo " <Count>0</Count>"
fi
+ if [ -n "$stp" ]
+ then
+ stp=$(( $stp + 1 ))
+ echo " <Step>${stp}</Step>"
+ fi
+ if [ -n "$err" ]
+ then
+ echo " <Error>${err}</Error>"
+ fi
+ if [ "$timer" = true ] && [ -n "$seconds_elapsed" ]
+ then
+ echo " <Elapsed>${seconds_elapsed}</Elapsed>"
+ fi
# instantiate UIDs within ENTREZ_DIRECT message
echo "$uids" |
@@ -1863,10 +1891,6 @@ then
echo " <Id>${uid}</Id>"
done
- if [ -n "$err" ]
- then
- echo " <Error>${err}</Error>"
- fi
echo "</ENTREZ_DIRECT>"
exit 0
@@ -1877,7 +1901,7 @@ then
num="0"
# count is accurate even for SOLR-based PubMed server
tranquil=true
- res=$( RunWithSearchArgs nquire -url "$base" esearch.fcgi -retmax "$retmax" -db "$dbase" )
+ res=$( RunWithSearchArgs nquire -url "$base" esearch.fcgi -retmax 0 -db "$dbase" )
if [ -n "$res" ]
then
res=$(
@@ -1901,32 +1925,15 @@ then
echo "<ENTREZ_DIRECT>"
echo " <Db>${dbase}</Db>"
echo " <Count>${num}</Count>"
- # instantiate PMIDs if count is under 10,000
- if [ "$num" -le 9999 ]
+ echo " <Query>${query}</Query>"
+ if [ -n "$stp" ]
then
- nwids=$(
- echo "$res" |
- xtract -pattern Id -element Id |
- sort -n | uniq -i
- )
- if [ -n "$nwids" ]
- then
- echo "$nwids" |
- grep '.' |
- while read uid
- do
- echo " <Id>${uid}</Id>"
- done
- nwnum=$( echo "$nwids" | wc -l | tr -d ' ' )
- if [ "$num" != "$nwnum" ]
- then
- echo " <Error>Num ${num} != New ${nwnum}</Error>"
- fi
- else
- echo " <Query>${query}</Query>"
- fi
- else
- echo " <Query>${query}</Query>"
+ stp=$(( $stp + 1 ))
+ echo " <Step>${stp}</Step>"
+ fi
+ if [ -n "$err" ]
+ then
+ echo " <Error>${err}</Error>"
fi
if [ "$quick" = true ] || [ "$quickx" = "Y" ]
then
=====================================
eutils/format.go
=====================================
@@ -523,6 +523,7 @@ func xmlFormatter(rcrd, prnt string, inp <-chan XMLToken, offset int, doXML bool
if customDoctype && doctype == "" {
doctype = name
}
+ case PROCESSTAG:
case NOTAG:
case ISCLOSED:
// now handled at end of calling function
=====================================
eutils/go.mod
=====================================
@@ -3,20 +3,20 @@ module eutils
go 1.19
require (
- github.com/fatih/color v1.13.0
+ github.com/fatih/color v1.14.1
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813
github.com/klauspost/cpuid v1.3.1
github.com/klauspost/pgzip v1.2.5
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/surgebase/porter2 v0.0.0-20150829210152-56e4718818e8
- golang.org/x/text v0.5.0
+ golang.org/x/text v0.8.0
)
require (
- github.com/klauspost/compress v1.15.13 // indirect
- github.com/mattn/go-colorable v0.1.9 // indirect
- github.com/mattn/go-isatty v0.0.14 // indirect
- github.com/stretchr/testify v1.8.1 // indirect
+ github.com/klauspost/compress v1.16.0 // indirect
+ github.com/mattn/go-colorable v0.1.13 // indirect
+ github.com/mattn/go-isatty v0.0.17 // indirect
+ github.com/stretchr/testify v1.8.2 // indirect
github.com/surge/glog v0.0.0-20141108051140-2578deb2b95c // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
+ golang.org/x/sys v0.5.0 // indirect
)
=====================================
eutils/go.sum
=====================================
@@ -1,21 +1,21 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
-github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
+github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
+github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ=
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM=
-github.com/klauspost/compress v1.15.13 h1:NFn1Wr8cfnenSJSA46lLq4wHCcBzKTSjnBIexDMMOV0=
-github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
+github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4=
+github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s=
github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4=
github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
-github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
-github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
-github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
-github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
+github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
+github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
+github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -25,19 +25,17 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
-github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/surge/glog v0.0.0-20141108051140-2578deb2b95c h1:cVA8Fd14+bmcDyVutgf976DrV9RzNO4SMzUQmfJDMrw=
github.com/surge/glog v0.0.0-20141108051140-2578deb2b95c/go.mod h1:W6gI0HQAbNyEO/62hesTBIbabSGJaEdlUApLw8UtuB0=
github.com/surgebase/porter2 v0.0.0-20150829210152-56e4718818e8 h1:5vXv18UxS9YuPlwenRHgGnJrRgE/XUjMQGJzggIar94=
github.com/surgebase/porter2 v0.0.0-20150829210152-56e4718818e8/go.mod h1:galqUK/f4MNkChzZE+tDTitV20g9grEqy3P5IHaVIk8=
-golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
-golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
-golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
+golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
=====================================
eutils/normal.go
=====================================
@@ -464,6 +464,7 @@ func NormalizeXML(rdr <-chan XMLBlock, db string) <-chan string {
buffer.WriteString("<!DOCTYPE ")
buffer.WriteString(doctype)
buffer.WriteString(">")
+ case PROCESSTAG:
case NOTAG:
case ISCLOSED:
// now handled at end of calling function
=====================================
eutils/utils.go
=====================================
@@ -44,7 +44,7 @@ import (
)
// EDirectVersion is the current EDirect release number
-const EDirectVersion = "19.0"
+const EDirectVersion = "19.2"
// ANSI escape codes for terminal color, highlight, and reverse
const (
=====================================
eutils/valid.go
=====================================
@@ -233,6 +233,7 @@ func ValidateXML(rdr <-chan XMLBlock, fnd string, html bool) int {
case CDATATAG, COMMENTTAG:
status = OTHER
case DOCTYPETAG:
+ case PROCESSTAG:
case NOTAG:
case ISCLOSED:
if level > 0 {
@@ -247,7 +248,9 @@ func ValidateXML(rdr <-chan XMLBlock, fnd string, html bool) int {
verifyLevel("", "", 0)
- if maxDepth > 30 {
+ // raised maxDepth test from 30 because of PMC nesting depth of 97 levels
+ // in oa_comm_xml.PMC009xxxxxx.baseline.2022-12-18.tar.gz release file
+ if maxDepth > 100 {
fmt.Fprintf(os.Stdout, "%s%8d\tMaximum nesting, %d levels\n", depthID, depthLine, maxDepth)
}
=====================================
eutils/xml.go
=====================================
@@ -1366,6 +1366,7 @@ const (
CDATATAG
COMMENTTAG
DOCTYPETAG
+ PROCESSTAG
OBJECTTAG
CONTAINERTAG
ISCLOSED
@@ -1877,6 +1878,54 @@ func parseXML(record, parent string, inp <-chan XMLBlock, tokens func(XMLToken),
// skip ?xml and ?processing instructions
idx++
ch = text[idx]
+ which = PROCESSTAG
+ skipTo = "?>"
+
+ if which != NOTAG && skipTo != "" {
+ whch := which
+ // xml or processing instruction block may contain internal angle brackets
+ found := strings.Index(text[idx:], skipTo)
+ if found < 0 {
+ // string stops in middle of xml or processing instruction
+ if inp != nil {
+ str := text[start:]
+ if HasFlankingSpace(str) {
+ str = strings.TrimSpace(str)
+ }
+
+ if countLines {
+ updateLineCount(txtlen)
+ }
+
+ // signal end of current block
+ record = ""
+
+ // leave which and skipTo values unchanged as another continuation signal
+ // send PROCESSTAG contents
+ return whch, NONE, str[:], "", 0
+ }
+
+ return ISCLOSED, NONE, "", "", idx
+ }
+ // adjust position past end of xml or processing instruction
+ if inp != nil {
+ idx += found
+ str := text[start:idx]
+ if HasFlankingSpace(str) {
+ str = strings.TrimSpace(str)
+ }
+ idx += len(skipTo)
+ // clear tracking variables
+ which = NOTAG
+ skipTo = ""
+ // send PROCESSTAG contents
+ return whch, NONE, str[:], "", idx
+ }
+
+ idx += found + len(skipTo)
+ return NOTAG, NONE, "", "", idx
+ }
+ // otherwise just skip to next right angle bracket
for ch != '>' {
idx++
ch = text[idx]
=====================================
eutils/xplore.go
=====================================
@@ -1229,6 +1229,10 @@ func ParseArguments(cmdargs []string, pttrn string) *Block {
status := UNSET
+ numIf := 0
+ numUnless := 0
+ lastCond := ""
+
// parse command strings into operation structure
for idx < max {
str := arguments[idx]
@@ -1263,7 +1267,29 @@ func ParseArguments(cmdargs []string, pttrn string) *Block {
case MATCH, AVOID:
elementColonValue = true
fallthrough
- case SELECT, IF, UNLESS, AND, OR:
+ case IF:
+ numIf++
+ if numIf > 1 || numUnless > 1 || numIf > 0 && numUnless > 0 {
+ fmt.Fprintf(os.Stderr, "\nERROR: Unexpected '-if %s' after '%s'\n", str, lastCond)
+ os.Exit(1)
+ }
+ lastCond = "-if " + str
+ op = &Operation{Type: status, Value: str}
+ cond = append(cond, op)
+ parseStep(op, elementColonValue)
+ status = UNSET
+ case UNLESS:
+ numUnless++
+ if numIf > 1 || numUnless > 1 || numIf > 0 && numUnless > 0 {
+ fmt.Fprintf(os.Stderr, "\nERROR: Unexpected '-unless %s' after '%s'\n", str, lastCond)
+ os.Exit(1)
+ }
+ lastCond = "-unless " + str
+ op = &Operation{Type: status, Value: str}
+ cond = append(cond, op)
+ parseStep(op, elementColonValue)
+ status = UNSET
+ case SELECT, AND, OR:
op = &Operation{Type: status, Value: str}
cond = append(cond, op)
parseStep(op, elementColonValue)
@@ -5837,6 +5863,9 @@ func ProcessINSD(args []string, isPipe, addDash, doIndex bool) []string {
"gene_synonym",
"gene",
"germline",
+ "GO_component",
+ "GO_function",
+ "GO_process",
"haplogroup",
"haplotype",
"host",
@@ -6201,9 +6230,9 @@ func ProcessINSD(args []string, isPipe, addDash, doIndex bool) []string {
ftargs = ftargs[1:]
if complete {
- acc = append(acc, "-unless", "INSDFeature_partial5", "-or", "INSDFeature_partial3")
+ acc = append(acc, "-branch", "INSDFeature", "-unless", "INSDFeature_partial5", "-or", "INSDFeature_partial3")
} else if partial {
- acc = append(acc, "-if", "INSDFeature_partial5", "-or", "INSDFeature_partial3")
+ acc = append(acc, "-branch", "INSDFeature", "-if", "INSDFeature_partial5", "-or", "INSDFeature_partial3")
}
if printAccn {
=====================================
gm2ranges
=====================================
@@ -0,0 +1,48 @@
+#!/usr/bin/env python3
+
+# Public domain notice for all NCBI EDirect scripts is located at:
+# https://www.ncbi.nlm.nih.gov/books/NBK179288/#chapter6.Public_Domain_Notice
+
+# cat smear.asn | blst2gm | gm2ranges | grep minus | cut -f 2- | fuse-ranges
+# minus 5599 5731 133
+# minus 5740 6520 781
+# minus 6609 7098 490
+# minus 9055 9679 625
+
+import sys
+
+def getRanges(zipped):
+ for start, span, strand in zipped:
+ if start == -1:
+ continue
+ stop = start + span - 1
+ if strand == "minus":
+ start, stop = stop, start
+ yield f'{start}..{stop}'
+
+def getStrand(col):
+ if "plus" in col and "minus" in col:
+ return "mixed"
+ elif "minus" in col:
+ return "minus"
+ return "plus"
+
+def doLine(cols):
+ zipped = zip(map(int, cols[2].split("|")),
+ map(int, cols[3].split("|")),
+ cols[4].split("|"))
+ ranges = list(getRanges(zipped))
+ num = str(len(ranges))
+ strand = getStrand(cols[4])
+ ivals = ",".join(ranges)
+ fields = [cols[0], cols[1], num, strand, ivals]
+ print("\t".join(fields))
+
+for line in sys.stdin:
+ line = line.rstrip()
+ if len(line) < 1:
+ continue
+ cols = line.split()
+ if len(cols) < 5:
+ continue
+ doLine(cols)
=====================================
help/tst-efetch.txt
=====================================
@@ -21,7 +21,7 @@ pcassay uilist 175 175
pcassay uimap 175 rad18
pcassay xml 175 Anticancer
pccompound properties 935 nickel
-pccompound synonyms 935 alloy
+pccompound synonyms 935 Niccolum
pccompound uilist 935 935
pccompound xml 935 Nickel
pcsubstance properties 3867 phosphocholine
=====================================
test-edirect
=====================================
@@ -273,14 +273,14 @@ PrintTimeAndTitle "Vitamin Biosynthesis - Quick"
PrintTimeAndTitle "BioSample-BioProject Link - Quick"
- esearch -timer -db biosample -query "package mims metagenome/environmental, water version 5 0 [PROP]" |
+ esearch -timer -db biosample -query "package mims metagenome/environmental, water version 6 0 [PROP]" |
efilter -query "ncbi [FILT] AND biosample sra [FILT]" |
elink -quick -target bioproject |
xtract -pattern ENTREZ_DIRECT -tab ", " -sfx " seconds" -element Elapsed -sfx " records" -element Count
PrintTimeAndTitle "BioSample-BioProject Link - Total"
- esearch -timer -db biosample -query "package mims metagenome/environmental, water version 5 0 [PROP]" |
+ esearch -timer -db biosample -query "package mims metagenome/environmental, water version 6 0 [PROP]" |
efilter -query "ncbi [FILT] AND biosample sra [FILT]" |
elink -chunk 400 -target bioproject -log |
xtract -pattern ENTREZ_DIRECT -tab ", " -sfx " seconds" -element Elapsed -sfx " records" -element Count
=====================================
transmute
=====================================
@@ -114,21 +114,14 @@ do
exit
;;
-j2p )
- binary=$( command -v python )
+ binary=$( command -v python3 )
if [ -x "$binary" ]
then
awk '{ gsub("}{", "}\n{"); print }' |
- python -m json.tool
+ python3 -m json.tool
else
- binary=$( command -v python3 )
- if [ -x "$binary" ]
- then
- awk '{ gsub("}{", "}\n{"); print }' |
- python3 -m json.tool
- else
- echo "ERROR: required python helper is not present" >&2
- exit 1
- fi
+ echo "ERROR: required python helper is not present" >&2
+ exit 1
fi
exit
;;
View it on GitLab: https://salsa.debian.org/med-team/ncbi-entrez-direct/-/compare/e0137fd0a02abc8474a92acc8737542c5e67d74c...d85fe0679e42b858179cda773ff1f86c649268e1
--
View it on GitLab: https://salsa.debian.org/med-team/ncbi-entrez-direct/-/compare/e0137fd0a02abc8474a92acc8737542c5e67d74c...d85fe0679e42b858179cda773ff1f86c649268e1
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230331/d1be6e43/attachment-0001.htm>
More information about the debian-med-commit
mailing list