bio-chembl 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/README.md +122 -10
  2. data/VERSION +1 -1
  3. data/bio-chembl.gemspec +1 -1
  4. metadata +13 -2
data/README.md CHANGED
@@ -4,31 +4,142 @@
4
4
 
5
5
  [ChEMBL REST Web Service API](https://www.ebi.ac.uk/chembldb/ws) client, parser and container classes.
6
6
 
7
- REST API Client
7
+ REST API address
8
8
 
9
9
  ```ruby
10
- # Show a web service URI
11
- BioChEMBL::REST::ChEMBL_URI.compound("CHEMBL1")
10
+ BioChEMBL::REST::ChEMBL_URI.status
11
+ #=> "http://www.ebi.ac.uk/chemblws/status/"
12
+ BioChEMBL::REST::ChEMBL_URI.compounds("CHEMBL1")
13
+ #=> "http://www.ebi.ac.uk/chemblws/compounds/CHEMBL1"
14
+ BioChEMBL::REST::ChEMBL_URI.targets("CHEMBL2477")
15
+ #=> "http://www.ebi.ac.uk/chemblws/targets/CHEMBL2477"
16
+ BioChEMBL::REST::ChEMBL_URI.assays("CHEMBL1217643")
17
+ #=> "http://www.ebi.ac.uk/chemblws/assays/CHEMBL1217643"
18
+ ```
12
19
 
13
- # GET the XML data of the ChEMBL ID CHEMBL1
20
+ Get data in XML
21
+ ```ruby
14
22
  api = BioChEMBL::REST.new
15
- api.compound("CHEMBL1")
23
+ compound = api.compounds("CHEMBL1")
24
+ targst = api.targets("CHEMBL2477")
25
+ assay = api.assays("CHEMBL1217643")
16
26
  ```
17
-
18
- Parser and container
19
-
27
+ Check the server status
28
+ ```ruby
29
+ BioChEMBL::REST.up? #=> true/false
30
+ ```
31
+ REST API client, parser and container: BioChEMBL::Compound
20
32
  ```ruby
21
33
  cpd = BioChEMBL::Compound.find("CHEMBL1")
22
34
  cpd.chemblId #=> "CHEMBL1"
23
35
  cpd.slimes
24
36
 
25
- ba = cpd.bioactivities
26
-
37
+ smiles = "CC(=O)CC(C1=C(O)c2ccccc2OC1=O)c3ccccc3"
38
+ cpds = BioChEMBL::Compound.find_all_by_smiles(smiles)
39
+ cpds = BioChEMBL::Compound.find_all_by_substructure(smiles)
40
+ cpds = BioChEMBL::Compound.find_all_by_similarity(smiles + "/70")
41
+
42
+ cpd.bioactivities[0].parent_compound.chemblId #=> "CHEMBL1"
43
+
44
+ xml = BioChEMBL::REST.new.compounds("CHEMBL1")
45
+ cpd = BioChEMBL::Compound.parse_xml(xml)
46
+ ```
47
+ REST API client, parser and container: BioChEMBL::Target
48
+ ```ruby
49
+ target = BioChEMBL::Target.find("CHEMBL1785")
50
+ target.chemblId #=> "CHEMBL1785"
51
+ target.targetType #=> "PROTEIN"
52
+ target.geneNames #=> "EDNRB; ETRB"
53
+
54
+ BioChEMBL.to_array(target.geneNames) #=> ["EDNRB", "ETRB"]
55
+ synonyms = BioChEMBL.to_array(target.synonyms)
56
+ synosyms[0] #=> "Endothelin B receptor"
57
+
58
+ target = BioChEMBL::Target.find_by_uniprot("Q13936")
59
+
60
+ target.bioactivities[0].target.chemblId #=> "CHEMBL1785"
61
+
62
+ xml = BioChEMBL::REST.new.targets("CHEMBL1785")
63
+ target = BioChEMBL::Target.parse_xml(xml)
64
+ ```
65
+ REST API client, parser and container: BioChEMBL::Assay
66
+ ```ruby
27
67
  assay = BioChEMBL::Assay.find("CHEMBL1217643")
68
+ assay.chemblId #=> "CHEMBL1217643"
69
+
70
+ assay.bioactivities[0].assay.chemblId #=> "CHEMBL1217643"
71
+ assay.bioactivities[0].target
72
+ assay.bioactivities[0].parent_compound
73
+
74
+ xml = BioChEMBL::REST.new.assays("CHEMBL1217643")
75
+ assay = BioChEMBL::Assay.parse_xml(xml)
76
+ ```
77
+
78
+ Parser and container: BioChEMBL::Bioactivity
79
+ ```ruby
80
+ cpd.bioactivities[0].parent_compound.chemblId
81
+ target.bioactivities[0].target.chemblId
82
+ assay.bioactivities[0].assay.chemblId
28
83
  assay.bioactivities[0].target
29
84
  assay.bioactivities[0].parent_compound
30
85
  ```
31
86
 
87
+ Getting Started with Ruby
88
+ ```ruby
89
+ require 'bio-chembl'
90
+ # 1. Use UniProt accession to get target details
91
+ puts "
92
+ # =========================================================
93
+ # 1. Use UniProt accession to get target details
94
+ # =========================================================
95
+ "
96
+
97
+ accession = "Q00534"
98
+ target = BioChEMBL::Target.find_by_uniprot(accession)
99
+
100
+ puts "Target description: #{target.description}"
101
+ puts "Target CHEMBLID: #{target.chemblId}"
102
+
103
+
104
+ # 2. Get all bioactivties for target CHEMBL_ID
105
+ puts "
106
+ # =========================================================
107
+ # 2. Get all bioactivties for target CHEMBL_ID
108
+ # =========================================================
109
+ "
110
+
111
+ bioactivities = target.bioactivities
112
+
113
+ puts "Bioactivity count: #{bioactivities.size}"
114
+ puts "Bioactivity count (IC50's): #{bioactivities.find_all {|x| x.bioactivity__type =~ /IC50/}.size}"
115
+
116
+
117
+ # 3. Get compounds with high binding affinity (IC50 < 100)
118
+ puts "
119
+ # =========================================================
120
+ # 3. Get compounds with high binding affinity (IC50 < 100)
121
+ # =========================================================
122
+ "
123
+
124
+ bioactivities.find_all {|x| x.bioactivity__type =~ /IC50/ and x.value.to_i < 100 }.each do |ba|
125
+ compound = ba.parent_compound
126
+ print "Compound CHEMBLID: #{compound.chemblId}"
127
+ puts " #{compound.smiles}"
128
+ end
129
+
130
+ # 4. Get assay details for Ki actvity types
131
+ puts "
132
+ # =========================================================
133
+ # 4. Get assay details for Ki actvity types
134
+ # =========================================================
135
+ "
136
+
137
+ bioactivities.find_all {|x| x.bioactivity__type =~ /Ki/i }.each do |ba|
138
+ assay = ba.assay
139
+ print "Assay CHEMBLID: #{assay.chemblId}"
140
+ puts " #{assay.assayDescription}"
141
+ end
142
+ ```
32
143
  Note: this software is under active development!
33
144
 
34
145
  ## Installation
@@ -57,6 +168,7 @@ The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
57
168
 
58
169
  ## Todo list
59
170
 
171
+ * BioChEMBL::Compound#image method to get the image in png.
60
172
  * BioChEMBL::Target.find_by_refesq method.
61
173
  * JSON output support (parser and address).
62
174
  * ChEMBL RDF support.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bio-chembl}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mitsuteru Nakao"]
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-chembl
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 31
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 1
9
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Mitsuteru Nakao
@@ -25,6 +26,7 @@ dependencies:
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 3
28
30
  segments:
29
31
  - 0
30
32
  version: "0"
@@ -38,6 +40,7 @@ dependencies:
38
40
  requirements:
39
41
  - - ~>
40
42
  - !ruby/object:Gem::Version
43
+ hash: 31
41
44
  segments:
42
45
  - 3
43
46
  - 12
@@ -52,6 +55,7 @@ dependencies:
52
55
  requirements:
53
56
  - - ">="
54
57
  - !ruby/object:Gem::Version
58
+ hash: 23
55
59
  segments:
56
60
  - 1
57
61
  - 0
@@ -67,6 +71,7 @@ dependencies:
67
71
  requirements:
68
72
  - - ~>
69
73
  - !ruby/object:Gem::Version
74
+ hash: 49
70
75
  segments:
71
76
  - 1
72
77
  - 8
@@ -82,6 +87,7 @@ dependencies:
82
87
  requirements:
83
88
  - - ">="
84
89
  - !ruby/object:Gem::Version
90
+ hash: 3
85
91
  segments:
86
92
  - 1
87
93
  - 4
@@ -97,6 +103,7 @@ dependencies:
97
103
  requirements:
98
104
  - - ~>
99
105
  - !ruby/object:Gem::Version
106
+ hash: 31
100
107
  segments:
101
108
  - 3
102
109
  - 12
@@ -111,6 +118,7 @@ dependencies:
111
118
  requirements:
112
119
  - - ">="
113
120
  - !ruby/object:Gem::Version
121
+ hash: 3
114
122
  segments:
115
123
  - 0
116
124
  version: "0"
@@ -124,6 +132,7 @@ dependencies:
124
132
  requirements:
125
133
  - - ~>
126
134
  - !ruby/object:Gem::Version
135
+ hash: 9
127
136
  segments:
128
137
  - 1
129
138
  - 5
@@ -188,6 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
197
  requirements:
189
198
  - - ">="
190
199
  - !ruby/object:Gem::Version
200
+ hash: 3
191
201
  segments:
192
202
  - 0
193
203
  version: "0"
@@ -196,6 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
206
  requirements:
197
207
  - - ">="
198
208
  - !ruby/object:Gem::Version
209
+ hash: 3
199
210
  segments:
200
211
  - 0
201
212
  version: "0"