pharmaobservatory 0.1.16 → 0.1.18

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.
@@ -0,0 +1,469 @@
1
+ =begin
2
+ #Pharma Observatory Public REST API
3
+
4
+ #Read-only REST API over the Pharma Observatory biomedical data platform. Reference: https://pharmaobservatory.com/api-reference
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PharmaObservatory
17
+ # One row of the company_market_collisions dataset: one row per company asset, competitor asset and MeSH indication: a live, owned Phase 3 or 4 asset of the company and one of another company in a shared indication, on drugs with no common target. A grouped request returns the group columns and the measures instead, as additional properties.
18
+ class CompanyMarketCollisionsRow
19
+ # Company level: the company the row is about; the entry key for the companies object type.
20
+ attr_accessor :company_id
21
+
22
+ # Display name of the company.
23
+ attr_accessor :company_name
24
+
25
+ # Group level: the company's current ultimate parent; a root's group is itself.
26
+ attr_accessor :group_id
27
+
28
+ # Display name of the group.
29
+ attr_accessor :group_name
30
+
31
+ # Molecule level: the company's asset, the resolved drug (a drug with two canonical ids is one asset).
32
+ attr_accessor :molecule_id
33
+
34
+ # The asset's display name, from the company's most-trialled record of it.
35
+ attr_accessor :molecule_name
36
+
37
+ # Company level: the company whose asset collides.
38
+ attr_accessor :competitor_company_id
39
+
40
+ # Display name of the competitor's company.
41
+ attr_accessor :competitor_company_name
42
+
43
+ # Group level: the competitor's current ultimate parent; a root's group is itself.
44
+ attr_accessor :competitor_group_id
45
+
46
+ # Display name of the competitor's group.
47
+ attr_accessor :competitor_group_name
48
+
49
+ # Molecule level: the competitor's asset, the resolved drug.
50
+ attr_accessor :competitor_molecule_id
51
+
52
+ # The competitor asset's display name.
53
+ attr_accessor :competitor_molecule_name
54
+
55
+ # The shared MeSH indication (a MeSH descriptor id): both assets are owned, live and Phase 3 or 4 in it.
56
+ attr_accessor :condition_ui
57
+
58
+ # The MeSH name of the shared indication.
59
+ attr_accessor :condition_name
60
+
61
+ # Gene symbols of the company drug's recorded targets. Never empty, and none is a target of the competitor drug.
62
+ attr_accessor :target_symbols
63
+
64
+ # Gene symbols of the competitor drug's recorded targets.
65
+ attr_accessor :competitor_target_symbols
66
+
67
+ # The less advanced of the two programs' furthest phase: 6 Phase 4, 5 Phase 3, 4 Phase 2/3, 3 Phase 2, 2 Phase 1/2, 1 Phase 1, 0 Early Phase 1, -1 phase not applicable.
68
+ attr_accessor :stage
69
+
70
+ # The later of the two programs' last trial start year.
71
+ attr_accessor :last_year
72
+
73
+ # Trials led by either company in which one drug is experimental and the other an active comparator.
74
+ attr_accessor :n_head_to_head_trials
75
+
76
+ # Why the company owns the drug. experimental_arm and regulatory_holder rest on evidence; inferred_lead is an inference (no arm data says otherwise).
77
+ attr_accessor :ownership_basis
78
+
79
+ # Why the competitor owns its drug, same vocabulary as ownership_basis.
80
+ attr_accessor :competitor_ownership_basis
81
+
82
+ # The rarity weight of the indication: the natural log of (companies holding a live, owned Phase 3+ asset with a recorded target) over (companies holding one in this indication).
83
+ attr_accessor :indication_idf
84
+
85
+ # The weight of the pair, 0.5 times indication_idf times factors for recency and a head-to-head trial. There is no stage factor, both programs are Phase 3 or 4.
86
+ attr_accessor :market_weight
87
+
88
+ # Attribute mapping from ruby-style variable name to JSON key.
89
+ def self.attribute_map
90
+ {
91
+ :'company_id' => :'company_id',
92
+ :'company_name' => :'company_name',
93
+ :'group_id' => :'group_id',
94
+ :'group_name' => :'group_name',
95
+ :'molecule_id' => :'molecule_id',
96
+ :'molecule_name' => :'molecule_name',
97
+ :'competitor_company_id' => :'competitor_company_id',
98
+ :'competitor_company_name' => :'competitor_company_name',
99
+ :'competitor_group_id' => :'competitor_group_id',
100
+ :'competitor_group_name' => :'competitor_group_name',
101
+ :'competitor_molecule_id' => :'competitor_molecule_id',
102
+ :'competitor_molecule_name' => :'competitor_molecule_name',
103
+ :'condition_ui' => :'condition_ui',
104
+ :'condition_name' => :'condition_name',
105
+ :'target_symbols' => :'target_symbols',
106
+ :'competitor_target_symbols' => :'competitor_target_symbols',
107
+ :'stage' => :'stage',
108
+ :'last_year' => :'last_year',
109
+ :'n_head_to_head_trials' => :'n_head_to_head_trials',
110
+ :'ownership_basis' => :'ownership_basis',
111
+ :'competitor_ownership_basis' => :'competitor_ownership_basis',
112
+ :'indication_idf' => :'indication_idf',
113
+ :'market_weight' => :'market_weight'
114
+ }
115
+ end
116
+
117
+ # Returns attribute mapping this model knows about
118
+ def self.acceptable_attribute_map
119
+ attribute_map
120
+ end
121
+
122
+ # Returns all the JSON keys this model knows about
123
+ def self.acceptable_attributes
124
+ acceptable_attribute_map.values
125
+ end
126
+
127
+ # Attribute type mapping.
128
+ def self.openapi_types
129
+ {
130
+ :'company_id' => :'String',
131
+ :'company_name' => :'String',
132
+ :'group_id' => :'String',
133
+ :'group_name' => :'String',
134
+ :'molecule_id' => :'String',
135
+ :'molecule_name' => :'String',
136
+ :'competitor_company_id' => :'String',
137
+ :'competitor_company_name' => :'String',
138
+ :'competitor_group_id' => :'String',
139
+ :'competitor_group_name' => :'String',
140
+ :'competitor_molecule_id' => :'String',
141
+ :'competitor_molecule_name' => :'String',
142
+ :'condition_ui' => :'String',
143
+ :'condition_name' => :'String',
144
+ :'target_symbols' => :'Array<String>',
145
+ :'competitor_target_symbols' => :'Array<String>',
146
+ :'stage' => :'Integer',
147
+ :'last_year' => :'Integer',
148
+ :'n_head_to_head_trials' => :'Integer',
149
+ :'ownership_basis' => :'String',
150
+ :'competitor_ownership_basis' => :'String',
151
+ :'indication_idf' => :'Float',
152
+ :'market_weight' => :'Float'
153
+ }
154
+ end
155
+
156
+ # List of attributes with nullable: true
157
+ def self.openapi_nullable
158
+ Set.new([
159
+ :'company_id',
160
+ :'company_name',
161
+ :'group_id',
162
+ :'group_name',
163
+ :'molecule_id',
164
+ :'molecule_name',
165
+ :'competitor_company_id',
166
+ :'competitor_company_name',
167
+ :'competitor_group_id',
168
+ :'competitor_group_name',
169
+ :'competitor_molecule_id',
170
+ :'competitor_molecule_name',
171
+ :'condition_ui',
172
+ :'condition_name',
173
+ :'target_symbols',
174
+ :'competitor_target_symbols',
175
+ :'stage',
176
+ :'last_year',
177
+ :'n_head_to_head_trials',
178
+ :'ownership_basis',
179
+ :'competitor_ownership_basis',
180
+ :'indication_idf',
181
+ :'market_weight'
182
+ ])
183
+ end
184
+
185
+ # Initializes the object
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ def initialize(attributes = {})
188
+ if (!attributes.is_a?(Hash))
189
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::CompanyMarketCollisionsRow` initialize method"
190
+ end
191
+
192
+ # check to see if the attribute exists and convert string to symbol for hash key
193
+ acceptable_attribute_map = self.class.acceptable_attribute_map
194
+ attributes = attributes.each_with_object({}) { |(k, v), h|
195
+ if (!acceptable_attribute_map.key?(k.to_sym))
196
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::CompanyMarketCollisionsRow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
197
+ end
198
+ h[k.to_sym] = v
199
+ }
200
+
201
+ if attributes.key?(:'company_id')
202
+ self.company_id = attributes[:'company_id']
203
+ end
204
+
205
+ if attributes.key?(:'company_name')
206
+ self.company_name = attributes[:'company_name']
207
+ end
208
+
209
+ if attributes.key?(:'group_id')
210
+ self.group_id = attributes[:'group_id']
211
+ end
212
+
213
+ if attributes.key?(:'group_name')
214
+ self.group_name = attributes[:'group_name']
215
+ end
216
+
217
+ if attributes.key?(:'molecule_id')
218
+ self.molecule_id = attributes[:'molecule_id']
219
+ end
220
+
221
+ if attributes.key?(:'molecule_name')
222
+ self.molecule_name = attributes[:'molecule_name']
223
+ end
224
+
225
+ if attributes.key?(:'competitor_company_id')
226
+ self.competitor_company_id = attributes[:'competitor_company_id']
227
+ end
228
+
229
+ if attributes.key?(:'competitor_company_name')
230
+ self.competitor_company_name = attributes[:'competitor_company_name']
231
+ end
232
+
233
+ if attributes.key?(:'competitor_group_id')
234
+ self.competitor_group_id = attributes[:'competitor_group_id']
235
+ end
236
+
237
+ if attributes.key?(:'competitor_group_name')
238
+ self.competitor_group_name = attributes[:'competitor_group_name']
239
+ end
240
+
241
+ if attributes.key?(:'competitor_molecule_id')
242
+ self.competitor_molecule_id = attributes[:'competitor_molecule_id']
243
+ end
244
+
245
+ if attributes.key?(:'competitor_molecule_name')
246
+ self.competitor_molecule_name = attributes[:'competitor_molecule_name']
247
+ end
248
+
249
+ if attributes.key?(:'condition_ui')
250
+ self.condition_ui = attributes[:'condition_ui']
251
+ end
252
+
253
+ if attributes.key?(:'condition_name')
254
+ self.condition_name = attributes[:'condition_name']
255
+ end
256
+
257
+ if attributes.key?(:'target_symbols')
258
+ if (value = attributes[:'target_symbols']).is_a?(Array)
259
+ self.target_symbols = value
260
+ end
261
+ end
262
+
263
+ if attributes.key?(:'competitor_target_symbols')
264
+ if (value = attributes[:'competitor_target_symbols']).is_a?(Array)
265
+ self.competitor_target_symbols = value
266
+ end
267
+ end
268
+
269
+ if attributes.key?(:'stage')
270
+ self.stage = attributes[:'stage']
271
+ end
272
+
273
+ if attributes.key?(:'last_year')
274
+ self.last_year = attributes[:'last_year']
275
+ end
276
+
277
+ if attributes.key?(:'n_head_to_head_trials')
278
+ self.n_head_to_head_trials = attributes[:'n_head_to_head_trials']
279
+ end
280
+
281
+ if attributes.key?(:'ownership_basis')
282
+ self.ownership_basis = attributes[:'ownership_basis']
283
+ end
284
+
285
+ if attributes.key?(:'competitor_ownership_basis')
286
+ self.competitor_ownership_basis = attributes[:'competitor_ownership_basis']
287
+ end
288
+
289
+ if attributes.key?(:'indication_idf')
290
+ self.indication_idf = attributes[:'indication_idf']
291
+ end
292
+
293
+ if attributes.key?(:'market_weight')
294
+ self.market_weight = attributes[:'market_weight']
295
+ end
296
+ end
297
+
298
+ # Show invalid properties with the reasons. Usually used together with valid?
299
+ # @return Array for valid properties with the reasons
300
+ def list_invalid_properties
301
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
302
+ invalid_properties = Array.new
303
+ invalid_properties
304
+ end
305
+
306
+ # Check to see if the all the properties in the model are valid
307
+ # @return true if the model is valid
308
+ def valid?
309
+ warn '[DEPRECATED] the `valid?` method is obsolete'
310
+ true
311
+ end
312
+
313
+ # Checks equality by comparing each attribute.
314
+ # @param [Object] Object to be compared
315
+ def ==(o)
316
+ return true if self.equal?(o)
317
+ self.class == o.class &&
318
+ company_id == o.company_id &&
319
+ company_name == o.company_name &&
320
+ group_id == o.group_id &&
321
+ group_name == o.group_name &&
322
+ molecule_id == o.molecule_id &&
323
+ molecule_name == o.molecule_name &&
324
+ competitor_company_id == o.competitor_company_id &&
325
+ competitor_company_name == o.competitor_company_name &&
326
+ competitor_group_id == o.competitor_group_id &&
327
+ competitor_group_name == o.competitor_group_name &&
328
+ competitor_molecule_id == o.competitor_molecule_id &&
329
+ competitor_molecule_name == o.competitor_molecule_name &&
330
+ condition_ui == o.condition_ui &&
331
+ condition_name == o.condition_name &&
332
+ target_symbols == o.target_symbols &&
333
+ competitor_target_symbols == o.competitor_target_symbols &&
334
+ stage == o.stage &&
335
+ last_year == o.last_year &&
336
+ n_head_to_head_trials == o.n_head_to_head_trials &&
337
+ ownership_basis == o.ownership_basis &&
338
+ competitor_ownership_basis == o.competitor_ownership_basis &&
339
+ indication_idf == o.indication_idf &&
340
+ market_weight == o.market_weight
341
+ end
342
+
343
+ # @see the `==` method
344
+ # @param [Object] Object to be compared
345
+ def eql?(o)
346
+ self == o
347
+ end
348
+
349
+ # Calculates hash code according to all attributes.
350
+ # @return [Integer] Hash code
351
+ def hash
352
+ [company_id, company_name, group_id, group_name, molecule_id, molecule_name, competitor_company_id, competitor_company_name, competitor_group_id, competitor_group_name, competitor_molecule_id, competitor_molecule_name, condition_ui, condition_name, target_symbols, competitor_target_symbols, stage, last_year, n_head_to_head_trials, ownership_basis, competitor_ownership_basis, indication_idf, market_weight].hash
353
+ end
354
+
355
+ # Builds the object from hash
356
+ # @param [Hash] attributes Model attributes in the form of hash
357
+ # @return [Object] Returns the model itself
358
+ def self.build_from_hash(attributes)
359
+ return nil unless attributes.is_a?(Hash)
360
+ attributes = attributes.transform_keys(&:to_sym)
361
+ transformed_hash = {}
362
+ openapi_types.each_pair do |key, type|
363
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
364
+ transformed_hash["#{key}"] = nil
365
+ elsif type =~ /\AArray<(.*)>/i
366
+ # check to ensure the input is an array given that the attribute
367
+ # is documented as an array but the input is not
368
+ if attributes[attribute_map[key]].is_a?(Array)
369
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
370
+ end
371
+ elsif !attributes[attribute_map[key]].nil?
372
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
373
+ end
374
+ end
375
+ new(transformed_hash)
376
+ end
377
+
378
+ # Deserializes the data based on type
379
+ # @param string type Data type
380
+ # @param string value Value to be deserialized
381
+ # @return [Object] Deserialized data
382
+ def self._deserialize(type, value)
383
+ case type.to_sym
384
+ when :Time
385
+ Time.parse(value)
386
+ when :Date
387
+ Date.parse(value)
388
+ when :String
389
+ value.to_s
390
+ when :Integer
391
+ value.to_i
392
+ when :Float
393
+ value.to_f
394
+ when :Boolean
395
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
396
+ true
397
+ else
398
+ false
399
+ end
400
+ when :Object
401
+ # generic object (usually a Hash), return directly
402
+ value
403
+ when /\AArray<(?<inner_type>.+)>\z/
404
+ inner_type = Regexp.last_match[:inner_type]
405
+ value.map { |v| _deserialize(inner_type, v) }
406
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
407
+ k_type = Regexp.last_match[:k_type]
408
+ v_type = Regexp.last_match[:v_type]
409
+ {}.tap do |hash|
410
+ value.each do |k, v|
411
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
412
+ end
413
+ end
414
+ else # model
415
+ # models (e.g. Pet) or oneOf
416
+ klass = PharmaObservatory.const_get(type)
417
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
418
+ end
419
+ end
420
+
421
+ # Returns the string representation of the object
422
+ # @return [String] String presentation of the object
423
+ def to_s
424
+ to_hash.to_s
425
+ end
426
+
427
+ # to_body is an alias to to_hash (backward compatibility)
428
+ # @return [Hash] Returns the object in the form of hash
429
+ def to_body
430
+ to_hash
431
+ end
432
+
433
+ # Returns the object in the form of hash
434
+ # @return [Hash] Returns the object in the form of hash
435
+ def to_hash
436
+ hash = {}
437
+ self.class.attribute_map.each_pair do |attr, param|
438
+ value = self.send(attr)
439
+ if value.nil?
440
+ is_nullable = self.class.openapi_nullable.include?(attr)
441
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
442
+ end
443
+
444
+ hash[param] = _to_hash(value)
445
+ end
446
+ hash
447
+ end
448
+
449
+ # Outputs non-array value in the form of hash
450
+ # For object, use to_hash. Otherwise, just return the value
451
+ # @param [Object] value Any valid value
452
+ # @return [Hash] Returns the value in the form of hash
453
+ def _to_hash(value)
454
+ if value.is_a?(Array)
455
+ value.compact.map { |v| _to_hash(v) }
456
+ elsif value.is_a?(Hash)
457
+ {}.tap do |hash|
458
+ value.each { |k, v| hash[k] = _to_hash(v) }
459
+ end
460
+ elsif value.respond_to? :to_hash
461
+ value.to_hash
462
+ else
463
+ value
464
+ end
465
+ end
466
+
467
+ end
468
+
469
+ end
@@ -34,10 +34,10 @@ module PharmaObservatory
34
34
  # The action type of the best-evidence mechanism (INHIBITOR, AGONIST and so on); null where the source gives none.
35
35
  attr_accessor :primary_action_type
36
36
 
37
- # The best evidence tier that links the drug to the target: curated_moa (an Open Targets curated mechanism edge), chembl_moa (a ChEMBL mechanism) or intervention_seed (a curated investigational asset).
37
+ # The best evidence tier that links the drug to the target: curated_app (a human decision recorded in the app ledger), curated_moa (an Open Targets curated mechanism edge), chembl_moa (a ChEMBL mechanism), intervention_seed (a curated investigational asset) or curated_agent (an agent decision recorded in the app ledger).
38
38
  attr_accessor :evidence_source
39
39
 
40
- # The rank of evidence_source, 1 for curated_moa, 2 for chembl_moa, 3 for intervention_seed.
40
+ # The rank of evidence_source, 0 for curated_app, 1 for curated_moa, 2 for chembl_moa, 3 for intervention_seed, 4 for curated_agent.
41
41
  attr_accessor :evidence_rank
42
42
 
43
43
  # Every evidence tier that links the drug to the target; more than one is a corroboration signal.
@@ -37,7 +37,7 @@ module PharmaObservatory
37
37
  # The action type of the drug's best-evidence mechanism on the target; null where the source gives none.
38
38
  attr_accessor :primary_action_type
39
39
 
40
- # The best evidence tier that links the drug to the target: curated_moa (an Open Targets curated mechanism edge), chembl_moa (a ChEMBL mechanism) or intervention_seed (a curated investigational asset).
40
+ # The best evidence tier that links the drug to the target: curated_app (a human decision recorded in the app ledger), curated_moa (an Open Targets curated mechanism edge), chembl_moa (a ChEMBL mechanism), intervention_seed (a curated investigational asset) or curated_agent (an agent decision recorded in the app ledger).
41
41
  attr_accessor :evidence_source
42
42
 
43
43
  # The condition as a MeSH descriptor id (D followed by digits), the id the conditions datasets use.
@@ -11,5 +11,5 @@ Generator version: 7.13.0
11
11
  =end
12
12
 
13
13
  module PharmaObservatory
14
- VERSION = '0.1.16'
14
+ VERSION = '0.1.18'
15
15
  end
@@ -104,6 +104,8 @@ require 'pharmaobservatory/models/company_funding_events_response'
104
104
  require 'pharmaobservatory/models/company_funding_events_row'
105
105
  require 'pharmaobservatory/models/company_funding_summary_response'
106
106
  require 'pharmaobservatory/models/company_funding_summary_row'
107
+ require 'pharmaobservatory/models/company_market_collisions_response'
108
+ require 'pharmaobservatory/models/company_market_collisions_row'
107
109
  require 'pharmaobservatory/models/company_members_response'
108
110
  require 'pharmaobservatory/models/company_members_row'
109
111
  require 'pharmaobservatory/models/company_peer_profile_response'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pharmaobservatory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scientist.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-06 00:00:00.000000000 Z
11
+ date: 2026-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -178,6 +178,8 @@ files:
178
178
  - docs/CompanyFundingEventsRow.md
179
179
  - docs/CompanyFundingSummaryResponse.md
180
180
  - docs/CompanyFundingSummaryRow.md
181
+ - docs/CompanyMarketCollisionsResponse.md
182
+ - docs/CompanyMarketCollisionsRow.md
181
183
  - docs/CompanyMembersResponse.md
182
184
  - docs/CompanyMembersRow.md
183
185
  - docs/CompanyPeerProfileResponse.md
@@ -701,6 +703,8 @@ files:
701
703
  - lib/pharmaobservatory/models/company_funding_events_row.rb
702
704
  - lib/pharmaobservatory/models/company_funding_summary_response.rb
703
705
  - lib/pharmaobservatory/models/company_funding_summary_row.rb
706
+ - lib/pharmaobservatory/models/company_market_collisions_response.rb
707
+ - lib/pharmaobservatory/models/company_market_collisions_row.rb
704
708
  - lib/pharmaobservatory/models/company_members_response.rb
705
709
  - lib/pharmaobservatory/models/company_members_row.rb
706
710
  - lib/pharmaobservatory/models/company_peer_profile_response.rb