entrez 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +16 -6
- data/lib/entrez.rb +10 -2
- data/lib/entrez/version.rb +1 -1
- data/spec/entrez_spec.rb +5 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -23,10 +23,10 @@ See 'Email & Tool' section below for setup.
|
|
23
23
|
|
24
24
|
args:
|
25
25
|
* database
|
26
|
-
* params hash
|
26
|
+
* params hash (optional)
|
27
27
|
|
28
28
|
Entrez.EFetch('snp', id: 123, retmode: :xml)
|
29
|
-
#=> makes request to http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=snp&id=9268480&retmode=xml
|
29
|
+
#=> makes request to http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=snp&id=9268480&retmode=xml.
|
30
30
|
#=> returns XML document with SNP rs9268480 data.
|
31
31
|
|
32
32
|
ESummary takes the same arguments.
|
@@ -36,13 +36,23 @@ ESummary takes the same arguments.
|
|
36
36
|
args:
|
37
37
|
* database
|
38
38
|
* term hash
|
39
|
-
* params hash
|
39
|
+
* params hash (optional)
|
40
40
|
|
41
41
|
Entrez.ESearch('genomeprj', {WORD: 'hapmap', SEQS: 'inprogress'}, retmode: :xml)
|
42
|
-
#=> makes request to http://http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=genomeprj&term=hapmap[WORD]+AND+inprogress[SEQS]&retmode=xml
|
43
|
-
#=> returns XML document with list of Ids of genome projects that match the searc term criteria
|
42
|
+
#=> makes request to http://http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=genomeprj&term=hapmap[WORD]+AND+inprogress[SEQS]&retmode=xml.
|
43
|
+
#=> returns XML document with list of Ids of genome projects that match the searc term criteria.
|
44
44
|
#=> i.e. genome projects that have 'hapmap' in the description and whose sequencing status is 'inprogress'.
|
45
45
|
|
46
|
+
=== EInfo
|
47
|
+
|
48
|
+
args:
|
49
|
+
* database
|
50
|
+
* params hash (optional)
|
51
|
+
|
52
|
+
Entrez.EInfo('gene', retmode: :xml)
|
53
|
+
#=> makes request to http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi?db=gene.
|
54
|
+
#=> returns XML document with list of searchable fields for gene database.
|
55
|
+
|
46
56
|
== Email & Tool
|
47
57
|
|
48
58
|
NCBI asks that you supply the tool you are using and your email.
|
@@ -63,7 +73,7 @@ The amount of delay time is no more than what is necessary to make the next requ
|
|
63
73
|
* ESummary
|
64
74
|
* ESearch
|
65
75
|
|
66
|
-
Not yet implemented:
|
76
|
+
Not yet implemented: EPost, ELink, EGQuery, ESpell.
|
67
77
|
|
68
78
|
== Compatibility
|
69
79
|
|
data/lib/entrez.rb
CHANGED
@@ -10,19 +10,27 @@ class Entrez
|
|
10
10
|
|
11
11
|
class << self
|
12
12
|
|
13
|
+
# E.g. Entrez.EFetch('snp', id: 123, retmode: :xml)
|
13
14
|
def EFetch(db, params = {})
|
14
15
|
perform '/efetch.fcgi', db, params
|
15
16
|
end
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
# E.g. Entrez.EInfo('gene', retmode: :xml)
|
19
|
+
def EInfo(db, params = {})
|
20
|
+
perform '/einfo.fcgi', db, params
|
19
21
|
end
|
20
22
|
|
23
|
+
# E.g. Entrez.ESearch('genomeprj', {WORD: 'hapmap', SEQS: 'inprogress'}, retmode: :xml)
|
21
24
|
def ESearch(db, search_terms = {}, params = {})
|
22
25
|
params[:term] = convert_search_term_hash(search_terms)
|
23
26
|
perform '/esearch.fcgi', db, params
|
24
27
|
end
|
25
28
|
|
29
|
+
# E.g. Entrez.ESummary('snp', id: 123, retmode: :xml)
|
30
|
+
def ESummary(db, params = {})
|
31
|
+
perform '/esummary.fcgi', db, params
|
32
|
+
end
|
33
|
+
|
26
34
|
def perform(utility_path, db, params = {})
|
27
35
|
respect_query_limit
|
28
36
|
request_times << Time.now.to_f
|
data/lib/entrez/version.rb
CHANGED
data/spec/entrez_spec.rb
CHANGED
@@ -22,6 +22,11 @@ describe Entrez do
|
|
22
22
|
response.body.should include('28911')
|
23
23
|
end
|
24
24
|
|
25
|
+
it '#EInfo retrieves results' do
|
26
|
+
response = Entrez.EInfo('snp', retmode: :xml)
|
27
|
+
response.body.should include('<Name>RS</Name>')
|
28
|
+
end
|
29
|
+
|
25
30
|
it 'should respect query limit' do
|
26
31
|
requests = proc { 4.times { Entrez.EFetch('taxonomy', id: 9606) } }
|
27
32
|
requests.should take_longer_than(1.0)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: entrez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.5.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jared Ning
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-28 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|