Module: Entrez
- Defined in:
- lib/rbbt/sources/entrez.rb
Defined Under Namespace
Classes: Gene
Class Method Summary collapse
- .entrez2name(taxs, options = {}) ⇒ Object
- .entrez2native(taxs, options = {}) ⇒ Object
- .entrez2pubmed(taxs) ⇒ Object
Class Method Details
.entrez2name(taxs, options = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rbbt/sources/entrez.rb', line 37 def self.entrez2name(taxs, = {}) = Misc.add_defaults , :key_field => 1, :fields => [2], :persist => true, :merge => true taxs = [taxs] unless Array === taxs .merge! :grep => taxs.collect{|t| "^" + t.to_s}, :fixed_grep => false tsv = Rbbt.share.databases.entrez.gene_info.tsv :flat, tsv.key_field = "Entrez Gene ID" tsv.fields = ["Associated Gene Name"] tsv end |
.entrez2native(taxs, options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rbbt/sources/entrez.rb', line 25 def self.entrez2native(taxs, = {}) = Misc.add_defaults , :key_field => 1, :fields => [5], :persist => true, :merge => true taxs = [taxs] unless Array === taxs .merge! :grep => taxs.collect{|t| "^" + t.to_s}, :fixed_grep => false tsv = Rbbt.share.databases.entrez.gene_info.tsv :flat, tsv.key_field = "Entrez Gene ID" tsv.fields = ["Native ID"] tsv end |
.entrez2pubmed(taxs) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/rbbt/sources/entrez.rb', line 50 def self.entrez2pubmed(taxs) = {:key_field => 1, :fields => [2], :persist => true, :merge => true} taxs = [taxs] unless taxs.is_a?(Array) .merge! :grep => taxs.collect{|t| "^" + t.to_s}, :fixed_grep => false Rbbt.share.databases.entrez.gene2pubmed.tsv :flat, end |