module Bio::NCBI::REST::ESearch::Methods
Search database entries by given keywords using E-Utils (esearch).
sequences = gene + genome + nucleotide + protein + popset + snp nucleotide = nuccore + nucest + nucgss
pubmed protein nucleotide nuccore nucgss nucest structure genome books cancerchromosomes cdd gap domains gene genomeprj gensat geo gds homologene journals mesh ncbisearch nlmcatalog omia omim pmc popset probe proteinclusters pcassay pccompound pcsubstance snp taxonomy toolkit unigene unists
Usage¶ ↑
Bio::NCBI::REST::ESearch.search("nucleotide", "tardigrada") Bio::NCBI::REST::ESearch.count("nucleotide", "tardigrada") Bio::NCBI::REST::ESearch.nucleotide("tardigrada") Bio::NCBI::REST::ESearch.popset("aldh2") Bio::NCBI::REST::ESearch.taxonomy("tardigrada") Bio::NCBI::REST::ESearch.pubmed("tardigrada", "reldate" => 365) Bio::NCBI::REST::ESearch.pubmed("mammoth mitochondrial genome") Bio::NCBI::REST::ESearch.pmc("Indonesian coelacanth genome Latimeria menadoensis") Bio::NCBI::REST::ESearch.journal("bmc bioinformatics") ncbi = Bio::NCBI::REST::ESearch.new ncbi.search("nucleotide", "tardigrada") ncbi.count("nucleotide", "tardigrada") ncbi.nucleotide("tardigrada") ncbi.popset("aldh2") ncbi.taxonomy("tardigrada") ncbi.pubmed("tardigrada", "reldate" => 365) ncbi.pubmed("mammoth mitochondrial genome") ncbi.pmc("Indonesian coelacanth genome Latimeria menadoensis") ncbi.journal("bmc bioinformatics")
Arguments:
-
term: search keywords (required)
-
limit: maximum number of entries to be returned (0 for unlimited)
-
hash: hash of E-Utils option
- Returns
-
array of entry IDs or a number of results
Public Instance Methods
count(“nucleotide”, “tardigrada”) count(“pubmed”, “tardigrada”) count(“journals”, “bmc”)
# File lib/bio/io/ncbirest.rb 475 def count(db, term, hash = {}) 476 opts = { "db" => db } 477 opts.update(hash) 478 Bio::NCBI::REST.esearch_count(term, opts) 479 end
alias for “nucest”
# File lib/bio/io/ncbirest.rb 498 def est(*args) 499 self.search("nucest", *args) 500 end
alias for “nucgss”
# File lib/bio/io/ncbirest.rb 503 def gss(*args) 504 self.search("nucgss", *args) 505 end
alias for journals
# File lib/bio/io/ncbirest.rb 493 def journal(*args) 494 self.search("journals", *args) 495 end
nucleotide(“tardigrada”) nucleotide(“tardigrada”, 0) pubmed(“tardigrada”) pubmed(“tardigrada”, 5) pubmed(“tardigrada”, “reldate” => 365) pubmed(“tardigrada”, 5, “reldate” => 365) pubmed(“tardigrada”, {“reldate” => 365}, 5)
# File lib/bio/io/ncbirest.rb 488 def method_missing(*args) 489 self.search(*args) 490 end
search(“nucleotide”, “tardigrada”) search(“nucleotide”, “tardigrada”, 0) # unlimited search(“pubmed”, “tardigrada”) search(“pubmed”, “tardigrada”, 5) # first five search(“pubmed”, “tardigrada”, “reldate” => 365) # within a year search(“pubmed”, “tardigrada”, 5, “reldate” => 365) # combination search(“pubmed”, “tardigrada”, {“reldate” => 365}, 5) # combination 2 search(“journals”, “bmc”, 10)
# File lib/bio/io/ncbirest.rb 456 def search(db, term, *args) 457 limit = 100 458 hash = {} 459 args.each do |arg| 460 case arg 461 when Hash 462 hash.update(arg) 463 else 464 limit = arg.to_i 465 end 466 end 467 opts = { "db" => db } 468 opts.update(hash) 469 Bio::NCBI::REST.esearch(term, opts, limit) 470 end