Skip to content

Instantly share code, notes, and snippets.

@kescobo
Created January 27, 2020 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kescobo/676abebfd10cd44a33933ad8a828dba4 to your computer and use it in GitHub Desktop.
Save kescobo/676abebfd10cd44a33933ad8a828dba4 to your computer and use it in GitHub Desktop.
julia> using Pkg; Pkg.activate(tempdir())
Activating new environment at `/var/folders/nl/h0htjvx13dz9l4p42xzw7_8h0000gq/T/Project.toml`
(T) pkg> add BioServices
Updating registry at `~/.julia/registries/BioJuliaRegistry`
Updating git-repo `https://github.com/BioJulia/BioJuliaRegistry`
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Updating `/private/var/folders/nl/h0htjvx13dz9l4p42xzw7_8h0000gq/T/Project.toml`
[a0d4ced5] + BioServices v0.3.2
Updating `/private/var/folders/nl/h0htjvx13dz9l4p42xzw7_8h0000gq/T/Manifest.toml`
[no changes]
julia> using BioServices
[ Info: Precompiling BioServices [a0d4ced5-b29c-5395-b614-ca030a679c4b]
julia> request_str = [7683506, 21273794, 20502278, 12837696, 9671894, 10910540, 1726111, 12925463, 14977895, 8354293, 21126967, 11874162, 11196419, 19856865, 14711867, 11077942, 19369394, 10071840, 17653692, 24052503, 19828801, 22875049, 1756527, 21094951, 21392146, 1641273, 7562289, 8157019, 11149114, 19588439, 20526778, 21056307, 9988814, 15678510, 20071566, 16856062, 17921123, 11474660, 17728088, 19803911, 16510632, 10321674, 22654787, 304806, 9751753, 15818055, 22491902, 22414880, 17377412, 23920104, 9458929, 9175950, 16837240, 11339911, 12439489, 24368157, 21197428, 16251172, 18724063, 22009856, 11912289, 10070119, 17314118, 11529543, 12865310, 17686002, 9124602, 11406028, 12148961, 21093581, 21166684, 15131465, 12427391, 19571582, 20510913, 17095552, 16497715, 22243792, 17395122, 18987014, 20618699, 23889750, 17675357, 19282364, 1797514, 12839290, 10378403, 16446602, 18450898, 11285060, 17055193, 3777985, 11293640, 17401502, 15695923, 9470905, 12439523, 12827239, 16792994, 10709119, 17439630, 20192887, 11373920, 19338208, 18185082, 17143058, 20172976, 22958386, 16936265, 17468132, 21294065, 3292100, 6351537, 7694463, 10544751, 21212851, 7597092, 10765604, 23485951, 12756873, 21815258, 14759308, 23841577, 17900453, 18851856, 15956731, 12671173, 15538630, 21382466, 23772774, 15177670, 21801864, 18674658, 21656057, 20308837, 19718578, 12526770, 18166549, 23359489, 2238843, 20452493, 23666920, 19336370, 9065108, 15353504, 16263773, 17855451, 13009470, 17074544, 24335141, 16936247, 19099817, 21338666, 24288432, 11433084, 20570286, 24709930, 11673754, 22682000, 798269, 12904590, 16157128, 19521336, 16357110, 23972758, 11703405, 24439811, 18838246, 15809210, 20069051, 8040778, 22044007, 16679958, 23194157, 24124699, 12496176, 4717441, 18317236, 21447942, 23307787, 21975772, 21643846, 17368647, 11815549, 20234144, 1614456, 7643957, 20003277, 20495079, 15507966, 23942554, 1302425, 1773923, 15764963, 12478992, 9593950, 1349050, 12367822, 11158594, 12763109, 9002665, 19234164, 1403464, 15493717, 14671170, 16276336, 12915475, 12169829, 17449701, 8835397, 17667860, 15163335, 9183569, 22421261, 23828585, 17443204, 19144956, 20177288, 23651728, 2591339, 8238198, 10782394, 16938879, 24225293, 19515978, 19309286, 20419149, 10471825, 16580281, 11035337, 11861414, 23236705, 9160976, 118051, 21034609, 21701445, 17119993, 10469778, 24188066, 18754838, 17446182, 781206, 9595363, 8917583, 11520397, 15718365, 19446788, 14723749, 21883885, 15703196, 16652108, 20420200, 9240577, 2364907, 9357932, 10926289, 16510184, 17136231, 19106236, 23529685, 23295978, 15214004, 17127271, 19026292, 16982938, 16202930, 17703185, 17339775, 10909993, 16356438, 7538729, 10576642, 21960125, 12050275, 18568888, 16238543, 21659962, 22568870, 22676722, 8680517, 17711923, 15867044, 17703412, 15745646, 18276950, 15232008, 22355322, 23161670, 24923732, 8886630, 15733276, 22744848, 9528914, 12904319, 22426431, 17344923, 24518760, 3029767, 11935406, 17428554];
julia> EUtils.efetch(db = "pubmed", tool = "BioJulia", retmode = "xml", rettype = "null", id = request_str)
ERROR: UndefVarError: EUtils not defined
Stacktrace:
[1] top-level scope at REPL[5]:1
julia> BioServices.EUtils.efetch(db = "pubmed", tool = "BioJulia", retmode = "xml", rettype = "null", id = request_str)
HTTP.Messages.Response:
"""
HTTP/1.1 200 OK
Date: Mon, 27 Jan 2020 20:34:27 GMT
Server: Finatra
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Content-Security-Policy: upgrade-insecure-requests
X-RateLimit-Remaining: 2
NCBI-PHID: 322C7F7C6C463B05000039FD5AF0C701.1.1.m_5
Cache-Control: private
NCBI-SID: C4257453720DAD74_89A5SID
X-RateLimit-Limit: 3
Access-Control-Allow-Origin: *
Content-Type: text/xml; charset=UTF-8
Set-Cookie: ncbi_sid=C4257453720DAD74_89A5SID; domain=.nih.gov; path=/; expires=Wed, 27 Jan 2021 20:34:27 GMT
Vary: Accept-Encoding
X-UA-Compatible: IE=Edge
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
<?xml version="1.0" ?>
<!DOCTYPE PubmedArticleSet PUBLIC "-//NLM//DTD PubMedArticle, 1st January 2019//EN" "https://dtd.nlm.nih.gov/ncbi/pubmed/out/pubmed_190101.dtd">
<PubmedArticleSet>
<PubmedArticle>
<MedlineCitation Status="MEDLINE" Owner="NLM">
<PMID Version="1">7683506</PMID>
<DateCompleted>
<Year>1993</Year>
<Month>06</Month>
<Day>10</Day>
</DateCompleted>
<DateRevised>
<Year>2019</Year>
<Month>10</Month>
<Day>31</Day>
</DateRevised>
<Article PubModel="Print">
<Journal>
<ISSN IssnType="Print">1043-4666</ISSN>
<JournalIssue CitedMedium="Print">
<Volume>5</Volume>
<Issue>1</Issue>
<PubDate>
<Year>1993</Year>
<Month>Jan</Month>
</PubDate>
</JournalIssue>
<Titl
4201707-byte body
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment