pharmaobservatory 0.1.15 → 0.1.17

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.
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module PharmaObservatory
17
- # One row of the company_competitors dataset: one row per ordered company pair: a company and one of the top 25 companies of each competitor_class by asset collision. A grouped request returns the group columns and the measures instead, as additional properties.
17
+ # One row of the company_competitors dataset: one row per industry company and competitor, at the root level (the competitor's ultimate parent, top 25 by asset collision) and at the member level (a company under a kept root that itself collides, top 25 per root). A grouped request returns the group columns and the measures instead, as additional properties.
18
18
  class CompanyCompetitorsRow
19
19
  # Company level: the company the row is about; the entry key for the companies object type.
20
20
  attr_accessor :company_id
@@ -28,7 +28,10 @@ module PharmaObservatory
28
28
  # Display name of the group.
29
29
  attr_accessor :group_name
30
30
 
31
- # Company level: the competing company.
31
+ # root: the competitor's ultimate parent company, with its score, counts and evidence recomputed over the union of its members' colliding assets (the best weight per target family and per indication across members, distinct asset pairs and distinct trials, never a sum of member scores). member: a company under that root that itself collides, scored on its own assets. Filter on one level; the two do not add.
32
+ attr_accessor :row_level
33
+
34
+ # Company level: the competing company. At row_level root this is the root company; at member it is the member company itself.
32
35
  attr_accessor :competitor_company_id
33
36
 
34
37
  # Display name of the competitor's company.
@@ -40,19 +43,28 @@ module PharmaObservatory
40
43
  # Display name of the competitor's group.
41
44
  attr_accessor :competitor_group_name
42
45
 
43
- # The competitor's class: industry, or non_industry (not classed as industry by the sponsor-class rule: academic, hospital, government, nonprofit, and any record the rule does not reach). competitor_rank restarts at 1 within each class, so filter or sort on this column first.
46
+ # The ultimate parent company of the competitor, the ladder company's `coalesce(ultimate_parent_company_id, company_id)` (one root per company, never the multi-root group fan-out). Equal to competitor_company_id at row_level root, and the root a member row sits under.
47
+ attr_accessor :competitor_root_id
48
+
49
+ # The competitor's class: always industry since the not-classed-as-industry group left Competitors; the column is kept so a query written against it keeps working. competitor_rank is 1-based within the class.
44
50
  attr_accessor :competitor_class
45
51
 
46
52
  # How many companies of this competitor_class had at least one asset collision with the company before the top 25 were kept. The same value on every row of one company and class.
47
53
  attr_accessor :n_class_candidates
48
54
 
49
- # The competitor's rank within its competitor_class for the company by competitor_score (1 is the highest).
55
+ # The rank of the competitor ROOT within its competitor_class for the company by competitor_score (1 is the highest). The same on a root row and on each of its member rows.
50
56
  attr_accessor :competitor_rank
51
57
 
58
+ # 0 on a root row; 1 and up on the member rows of that root, by the member's own competitor_score. Order by competitor_rank then member_rank to list each root followed by its members.
59
+ attr_accessor :member_rank
60
+
61
+ # Member companies of this root that collide with the company, before the member cut. The same on a root row and its member rows.
62
+ attr_accessor :n_members
63
+
52
64
  # The weighted share of the company's live target families that the competitor's live assets collide with, 0 to 100, rounded to four places. Each colliding family counts its best collision weight (rarity of the family across companies, times factors for same action, a shared indication, the least advanced stage, recency and a head-to-head trial), capped at the family's rarity weight; the sum is divided by the rarity weights of ALL the company's families.
53
65
  attr_accessor :competitor_score
54
66
 
55
- # Asset pairs (a drug of the company, a drug of the competitor) that act on a common target.
67
+ # Asset pairs (a drug of the company, a drug of the competitor) that act on a common target; 0 when the competitor is listed only for a same-market pair (see n_market_collisions).
56
68
  attr_accessor :n_collisions
57
69
 
58
70
  # Target families of the company's live assets that the competitor collides with.
@@ -64,15 +76,33 @@ module PharmaObservatory
64
76
  # Asset pairs whose drugs act on the shared target with the same action type.
65
77
  attr_accessor :n_same_action
66
78
 
67
- # Asset pairs whose programs share at least one disease area.
79
+ # Asset pairs whose programs share at least one disease area. Every listed pair does, so it equals n_collisions.
68
80
  attr_accessor :n_shared_indication_pairs
69
81
 
70
82
  # Distinct trials led by either company in which one drug of a pair is experimental and the other an active comparator.
71
83
  attr_accessor :n_head_to_head_trials
72
84
 
85
+ # The most advanced pair's stage, where a pair's stage is the less advanced of its 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. A tie-break key after the score.
86
+ attr_accessor :best_stage
87
+
88
+ # The latest trial start year over the company pair's programs (the maximum over its asset pairs of the later of the two programs' last start year). A tie-break key after the score; null when no program has a start year.
89
+ attr_accessor :last_year
90
+
73
91
  # Up to 3 strongest asset pairs as text: \"drug A / drug B: target family, stage, N shared indications\". The stage is the less advanced of the two programs. An ownership_basis of inferred_lead on the underlying pair (see company_asset_collisions) is an inference.
74
92
  attr_accessor :top_collisions
75
93
 
94
+ # Asset pairs (a Phase 3+ drug of the company, a Phase 3+ drug of the competitor) that share a MeSH indication on drugs with no common target; the pairs are the company_market_collisions dataset.
95
+ attr_accessor :n_market_collisions
96
+
97
+ # Distinct shared Phase 3+ indications of the pair, counted after a shared indication is replaced by a more specific one that the same asset pair also shares.
98
+ attr_accessor :n_market_indications
99
+
100
+ # The company's own Phase 3+ indications; with its target families, the denominator of competitor_score. 0 when it holds no Phase 3+ program.
101
+ attr_accessor :n_subject_markets
102
+
103
+ # Up to 3 strongest same-market asset pairs as text: \"drug A / drug B: indication, same market, different target (SYMBOLS vs SYMBOLS), stage\". An empty list when none. Kept apart from top_collisions, which is target evidence only.
104
+ attr_accessor :top_market_collisions
105
+
76
106
  # Distinct trials on which the company and the competitor are both named as sponsors, counted over their subtrees; 0 when none. A consortium trial (more than 25 sponsor companies) is left out.
77
107
  attr_accessor :n_cosponsored_trials
78
108
 
@@ -83,13 +113,17 @@ module PharmaObservatory
83
113
  :'company_name' => :'company_name',
84
114
  :'group_id' => :'group_id',
85
115
  :'group_name' => :'group_name',
116
+ :'row_level' => :'row_level',
86
117
  :'competitor_company_id' => :'competitor_company_id',
87
118
  :'competitor_company_name' => :'competitor_company_name',
88
119
  :'competitor_group_id' => :'competitor_group_id',
89
120
  :'competitor_group_name' => :'competitor_group_name',
121
+ :'competitor_root_id' => :'competitor_root_id',
90
122
  :'competitor_class' => :'competitor_class',
91
123
  :'n_class_candidates' => :'n_class_candidates',
92
124
  :'competitor_rank' => :'competitor_rank',
125
+ :'member_rank' => :'member_rank',
126
+ :'n_members' => :'n_members',
93
127
  :'competitor_score' => :'competitor_score',
94
128
  :'n_collisions' => :'n_collisions',
95
129
  :'n_colliding_families' => :'n_colliding_families',
@@ -97,7 +131,13 @@ module PharmaObservatory
97
131
  :'n_same_action' => :'n_same_action',
98
132
  :'n_shared_indication_pairs' => :'n_shared_indication_pairs',
99
133
  :'n_head_to_head_trials' => :'n_head_to_head_trials',
134
+ :'best_stage' => :'best_stage',
135
+ :'last_year' => :'last_year',
100
136
  :'top_collisions' => :'top_collisions',
137
+ :'n_market_collisions' => :'n_market_collisions',
138
+ :'n_market_indications' => :'n_market_indications',
139
+ :'n_subject_markets' => :'n_subject_markets',
140
+ :'top_market_collisions' => :'top_market_collisions',
101
141
  :'n_cosponsored_trials' => :'n_cosponsored_trials'
102
142
  }
103
143
  end
@@ -119,13 +159,17 @@ module PharmaObservatory
119
159
  :'company_name' => :'String',
120
160
  :'group_id' => :'String',
121
161
  :'group_name' => :'String',
162
+ :'row_level' => :'String',
122
163
  :'competitor_company_id' => :'String',
123
164
  :'competitor_company_name' => :'String',
124
165
  :'competitor_group_id' => :'String',
125
166
  :'competitor_group_name' => :'String',
167
+ :'competitor_root_id' => :'String',
126
168
  :'competitor_class' => :'String',
127
169
  :'n_class_candidates' => :'Integer',
128
170
  :'competitor_rank' => :'Integer',
171
+ :'member_rank' => :'Integer',
172
+ :'n_members' => :'Integer',
129
173
  :'competitor_score' => :'Float',
130
174
  :'n_collisions' => :'Integer',
131
175
  :'n_colliding_families' => :'Integer',
@@ -133,7 +177,13 @@ module PharmaObservatory
133
177
  :'n_same_action' => :'Integer',
134
178
  :'n_shared_indication_pairs' => :'Integer',
135
179
  :'n_head_to_head_trials' => :'Integer',
180
+ :'best_stage' => :'Integer',
181
+ :'last_year' => :'Integer',
136
182
  :'top_collisions' => :'Array<String>',
183
+ :'n_market_collisions' => :'Integer',
184
+ :'n_market_indications' => :'Integer',
185
+ :'n_subject_markets' => :'Integer',
186
+ :'top_market_collisions' => :'Array<String>',
137
187
  :'n_cosponsored_trials' => :'Integer'
138
188
  }
139
189
  end
@@ -145,13 +195,17 @@ module PharmaObservatory
145
195
  :'company_name',
146
196
  :'group_id',
147
197
  :'group_name',
198
+ :'row_level',
148
199
  :'competitor_company_id',
149
200
  :'competitor_company_name',
150
201
  :'competitor_group_id',
151
202
  :'competitor_group_name',
203
+ :'competitor_root_id',
152
204
  :'competitor_class',
153
205
  :'n_class_candidates',
154
206
  :'competitor_rank',
207
+ :'member_rank',
208
+ :'n_members',
155
209
  :'competitor_score',
156
210
  :'n_collisions',
157
211
  :'n_colliding_families',
@@ -159,7 +213,13 @@ module PharmaObservatory
159
213
  :'n_same_action',
160
214
  :'n_shared_indication_pairs',
161
215
  :'n_head_to_head_trials',
216
+ :'best_stage',
217
+ :'last_year',
162
218
  :'top_collisions',
219
+ :'n_market_collisions',
220
+ :'n_market_indications',
221
+ :'n_subject_markets',
222
+ :'top_market_collisions',
163
223
  :'n_cosponsored_trials'
164
224
  ])
165
225
  end
@@ -196,6 +256,10 @@ module PharmaObservatory
196
256
  self.group_name = attributes[:'group_name']
197
257
  end
198
258
 
259
+ if attributes.key?(:'row_level')
260
+ self.row_level = attributes[:'row_level']
261
+ end
262
+
199
263
  if attributes.key?(:'competitor_company_id')
200
264
  self.competitor_company_id = attributes[:'competitor_company_id']
201
265
  end
@@ -212,6 +276,10 @@ module PharmaObservatory
212
276
  self.competitor_group_name = attributes[:'competitor_group_name']
213
277
  end
214
278
 
279
+ if attributes.key?(:'competitor_root_id')
280
+ self.competitor_root_id = attributes[:'competitor_root_id']
281
+ end
282
+
215
283
  if attributes.key?(:'competitor_class')
216
284
  self.competitor_class = attributes[:'competitor_class']
217
285
  end
@@ -224,6 +292,14 @@ module PharmaObservatory
224
292
  self.competitor_rank = attributes[:'competitor_rank']
225
293
  end
226
294
 
295
+ if attributes.key?(:'member_rank')
296
+ self.member_rank = attributes[:'member_rank']
297
+ end
298
+
299
+ if attributes.key?(:'n_members')
300
+ self.n_members = attributes[:'n_members']
301
+ end
302
+
227
303
  if attributes.key?(:'competitor_score')
228
304
  self.competitor_score = attributes[:'competitor_score']
229
305
  end
@@ -252,12 +328,38 @@ module PharmaObservatory
252
328
  self.n_head_to_head_trials = attributes[:'n_head_to_head_trials']
253
329
  end
254
330
 
331
+ if attributes.key?(:'best_stage')
332
+ self.best_stage = attributes[:'best_stage']
333
+ end
334
+
335
+ if attributes.key?(:'last_year')
336
+ self.last_year = attributes[:'last_year']
337
+ end
338
+
255
339
  if attributes.key?(:'top_collisions')
256
340
  if (value = attributes[:'top_collisions']).is_a?(Array)
257
341
  self.top_collisions = value
258
342
  end
259
343
  end
260
344
 
345
+ if attributes.key?(:'n_market_collisions')
346
+ self.n_market_collisions = attributes[:'n_market_collisions']
347
+ end
348
+
349
+ if attributes.key?(:'n_market_indications')
350
+ self.n_market_indications = attributes[:'n_market_indications']
351
+ end
352
+
353
+ if attributes.key?(:'n_subject_markets')
354
+ self.n_subject_markets = attributes[:'n_subject_markets']
355
+ end
356
+
357
+ if attributes.key?(:'top_market_collisions')
358
+ if (value = attributes[:'top_market_collisions']).is_a?(Array)
359
+ self.top_market_collisions = value
360
+ end
361
+ end
362
+
261
363
  if attributes.key?(:'n_cosponsored_trials')
262
364
  self.n_cosponsored_trials = attributes[:'n_cosponsored_trials']
263
365
  end
@@ -287,13 +389,17 @@ module PharmaObservatory
287
389
  company_name == o.company_name &&
288
390
  group_id == o.group_id &&
289
391
  group_name == o.group_name &&
392
+ row_level == o.row_level &&
290
393
  competitor_company_id == o.competitor_company_id &&
291
394
  competitor_company_name == o.competitor_company_name &&
292
395
  competitor_group_id == o.competitor_group_id &&
293
396
  competitor_group_name == o.competitor_group_name &&
397
+ competitor_root_id == o.competitor_root_id &&
294
398
  competitor_class == o.competitor_class &&
295
399
  n_class_candidates == o.n_class_candidates &&
296
400
  competitor_rank == o.competitor_rank &&
401
+ member_rank == o.member_rank &&
402
+ n_members == o.n_members &&
297
403
  competitor_score == o.competitor_score &&
298
404
  n_collisions == o.n_collisions &&
299
405
  n_colliding_families == o.n_colliding_families &&
@@ -301,7 +407,13 @@ module PharmaObservatory
301
407
  n_same_action == o.n_same_action &&
302
408
  n_shared_indication_pairs == o.n_shared_indication_pairs &&
303
409
  n_head_to_head_trials == o.n_head_to_head_trials &&
410
+ best_stage == o.best_stage &&
411
+ last_year == o.last_year &&
304
412
  top_collisions == o.top_collisions &&
413
+ n_market_collisions == o.n_market_collisions &&
414
+ n_market_indications == o.n_market_indications &&
415
+ n_subject_markets == o.n_subject_markets &&
416
+ top_market_collisions == o.top_market_collisions &&
305
417
  n_cosponsored_trials == o.n_cosponsored_trials
306
418
  end
307
419
 
@@ -314,7 +426,7 @@ module PharmaObservatory
314
426
  # Calculates hash code according to all attributes.
315
427
  # @return [Integer] Hash code
316
428
  def hash
317
- [company_id, company_name, group_id, group_name, competitor_company_id, competitor_company_name, competitor_group_id, competitor_group_name, competitor_class, n_class_candidates, competitor_rank, competitor_score, n_collisions, n_colliding_families, n_subject_families, n_same_action, n_shared_indication_pairs, n_head_to_head_trials, top_collisions, n_cosponsored_trials].hash
429
+ [company_id, company_name, group_id, group_name, row_level, competitor_company_id, competitor_company_name, competitor_group_id, competitor_group_name, competitor_root_id, competitor_class, n_class_candidates, competitor_rank, member_rank, n_members, competitor_score, n_collisions, n_colliding_families, n_subject_families, n_same_action, n_shared_indication_pairs, n_head_to_head_trials, best_stage, last_year, top_collisions, n_market_collisions, n_market_indications, n_subject_markets, top_market_collisions, n_cosponsored_trials].hash
318
430
  end
319
431
 
320
432
  # Builds the object from hash