-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslides.html
More file actions
executable file
·740 lines (649 loc) · 27.5 KB
/
slides.html
File metadata and controls
executable file
·740 lines (649 loc) · 27.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title></title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
<meta name="controlVis" content="hidden" />
<!-- style sheet links -->
<script src="ui/minimal/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/minimal/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/minimal/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/minimal/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/minimal/opera.css"
type="text/css" media="projection" id="operaFix" />
<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">
</div>
<div id="footer">
<h2>OpenVivo Ltd, All rights reserved.</h2>
</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<!-- Definitions of interpreted text roles (classes) for S5/HTML data. -->
<!-- This data file has been placed in the public domain. -->
<!-- Colours
======= -->
<!-- Text Sizes
========== -->
<!-- Display in Slides (Presentation Mode) Only
========================================== -->
<!-- Display in Outline Mode Only
============================ -->
<!-- Display in Print Only
===================== -->
<!-- Display in Handout Mode Only
============================ -->
<!-- Incremental Display
=================== -->
<!-- This data file has been placed in the public domain. -->
<!-- Derived from the Unicode character mappings available from
<http://www.w3.org/2003/entities/xml/>.
Processed by unicode2rstsubs.py, part of Docutils:
<http://docutils.sourceforge.net>. -->
</div>
<div class="slide" id="python-pharmaceuticals-and-drug-discovery">
<h1>Python, Pharmaceuticals and Drug Discovery</h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Authors:</th><td class="field-body">Emlyn Clay</td>
</tr>
<tr class="field"><th class="field-name">Organization:</th><td class="field-body">OpenVivo Ltd.</td>
</tr>
<tr class="field"><th class="field-name">Contact:</th><td class="field-body"><a class="reference external" href="mailto:emlyn.clay@openvivo.com">emlyn.clay@openvivo.com</a></td>
</tr>
<tr class="field"><th class="field-name">Date:</th><td class="field-body">23rd February 2014</td>
</tr>
</tbody>
</table>
</div>
<div class="slide" id="pharmaceuticals-in-the-uk">
<h1>Pharmaceuticals in the UK</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Annual trade surplus of ~£5 billion <a class="footnote-reference" href="#id4" id="id1">[1]</a></li>
<li>Approximately 1/3 of the UK's R&D spend <a class="footnote-reference" href="#id5" id="id2">[2]</a></li>
<li>Jobs are mostly scientific and engineering based.</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.ons.gov.uk/ons/dcp171778_287868.pdf"><img alt="pie chart of the distribution of pharmaceutical jobs" src="images/pie_chart_pharmaceutical_jobs.gif" /></a>
</div>
</div>
<div class="slide" id="objectives">
<h1>Objectives</h1>
<ul class="incremental simple">
<li>Introduce preclinical-clinical drug discovery</li>
<li>Demonstrate computational aspects of preclinical-clinical problems</li>
<li>Make a case for Python and it's scientific stack</li>
</ul>
</div>
<div class="section slide" id="preclinical-drug-discovery">
<h1>Preclinical Drug Discovery</h1>
</div>
<div class="slide" id="preclinical-testing-focuses-on">
<h1>Preclinical testing focuses on</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Testing the drug in cells and mammals</li>
<li><em>Efficacy</em> - does the drug work</li>
<li><em>Toxicity</em> - does the drug have <em>acceptable</em> adverse effects</li>
<li>"Dosis Sola Facit Venenum"</li>
<li>... "Only the dose determines the poison"</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://en.wikipedia.org/wiki/File:Wistar_rat.jpg"><img alt="A wistar rat" src="images/wistar_rat.jpg" /></a>
</div>
</div>
<div class="slide" id="pharmaceutical-use-cases-for-python">
<h1>Pharmaceutical use cases for Python</h1>
<ul class="incremental simple">
<li>Processing and classification of biosignals; ECG, Blood Pressure</li>
<li>Statistical analysis of clinical datasets</li>
<li>Documentation according to regulated ontologies</li>
</ul>
</div>
<div class="section slide" id="ecg-analysis">
<h1>ECG analysis</h1>
</div>
<div class="slide" id="the-case-of-rpl554">
<h1>The case of RPL554</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>RPL554, a novel PDE3/4 inhibitor</li>
<li>Demonstrated hERG blockade</li>
<li>Inwardly Rectifying Potassium Current (I<sub>Kr</sub>)</li>
<li>Blockade of I<sub>Kr</sub> prolongs Q-peak to T-peak interval of the ECG</li>
<li>Prolonged QTc can lead to Torsades de pointes</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.ons.gov.uk/ons/dcp171778_287868.pdf"><img alt="pie chart of the distribution of pharmaceutical jobs" src="images/rpl554.png" /></a>
</div>
</div>
<div class="slide" id="ecg-the-electrocardiogram">
<h1>ECG, the ElectroCardioGram</h1>
<img alt="ECG signal" src="images/ecg_signal.png" />
</div>
<div class="slide" id="a-single-ecg">
<h1>A single ECG</h1>
<a class="reference external image-reference" href="http://en.wikipedia.org/wiki/File:SinusRhythmLabels.svg"><img alt="ECG" src="images/ecg.png" /></a>
</div>
<div class="slide" id="the-ecg-and-the-cardiac-cycle">
<h1>The ECG and the cardiac cycle</h1>
<a class="reference external image-reference" href="http://en.wikipedia.org/wiki/File:ECG_principle_slow.gif"><img alt="ECG prinicple" src="images/ecg_principle_slow.gif" /></a>
</div>
<div class="slide" id="analyzing-the-ecg-read-the-data">
<h1>Analyzing the ECG: Read the data</h1>
<pre class="code python literal-block">
<span class="comment"># imports</span>
<span class="keyword namespace">import</span> <span class="name namespace">vrp</span><span class="operator">,</span> <span class="name namespace">h5py</span> <span class="keyword namespace">as</span> <span class="name namespace">hdf</span><span class="operator">,</span> <span class="name namespace">numpy</span> <span class="keyword namespace">as</span> <span class="name namespace">np</span><span class="operator">,</span> <span class="name namespace">scipy</span> <span class="keyword namespace">as</span> <span class="name namespace">sp</span>
<span class="comment"># read data in</span>
<span class="name">data</span> <span class="operator">=</span> <span class="name">hdf</span><span class="operator">.</span><span class="name">File</span><span class="punctuation">(</span><span class="literal string">'ecg_2s.hdf5'</span><span class="punctuation">,</span> <span class="literal string">'r'</span><span class="punctuation">)</span>
<span class="name">ecg</span> <span class="operator">=</span> <span class="name">data</span><span class="operator">.</span><span class="name">get</span><span class="punctuation">(</span><span class="literal string">'gp_ecg'</span><span class="punctuation">)</span>
<span class="name">sampling</span> <span class="operator">=</span> <span class="name">ecg</span><span class="operator">.</span><span class="name">attrs</span><span class="operator">.</span><span class="name">get</span><span class="punctuation">(</span><span class="literal string">'sampling_frequency'</span><span class="punctuation">)</span>
<span class="comment"># smoothing</span>
</pre>
</div>
<div class="slide" id="analyzing-the-ecg-find-the-r-peak">
<h1>Analyzing the ECG: Find the R-peak</h1>
<p>Scans the signal, when the threshold is met follow until we go under
the threshold, quadratically interpolate the peak width and the np.max
is the peak.</p>
<pre class="code python literal-block">
<span class="comment"># parameters</span>
<span class="name">minheight</span> <span class="operator">=</span> <span class="name">np</span><span class="operator">.</span><span class="name">percentile</span><span class="punctuation">(</span><span class="name">ecg</span><span class="punctuation">,</span> <span class="literal number float">0.9</span><span class="punctuation">)</span>
<span class="name">minwidth</span> <span class="operator">=</span> <span class="name">sampling</span> <span class="operator">*</span> <span class="punctuation">(</span><span class="literal number integer">1</span> <span class="operator">/</span> <span class="literal number float">0.0015</span><span class="punctuation">)</span> <span class="comment"># R-peak is about 15ms</span>
<span class="comment"># find R-peak using a translation of findpeak.m</span>
<span class="name">findpeaks</span> <span class="operator">=</span> <span class="name">vrp</span><span class="operator">.</span><span class="name">ecg</span><span class="operator">.</span><span class="name">findpeaks</span>
<span class="name">peaks</span><span class="punctuation">,</span> <span class="name">locs</span> <span class="operator">=</span> <span class="name">findpeaks</span><span class="punctuation">(</span><span class="name">ecg</span><span class="punctuation">,</span> <span class="name">minheight</span><span class="punctuation">,</span> <span class="name">minwidth</span><span class="punctuation">)</span>
<span class="name">beat</span> <span class="operator">=</span> <span class="name builtin">zip</span><span class="punctuation">(</span><span class="name">peaks</span><span class="punctuation">,</span> <span class="name">locs</span><span class="punctuation">)</span>
</pre>
</div>
<div class="slide" id="analyzing-the-ecg-find-the-q-peak-and-t-peak">
<h1>Analyzing the ECG: Find the Q-peak and T-peak</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>With each beat, slice backward to find the local minima, Q-peak</li>
<li>Slice forward, find the local maxima T-peak</li>
<li>Least Mean Square (LMS) regression from T-peak to T-end</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://en.wikipedia.org/wiki/File:SinusRhythmLabels.svg"><img alt="ECG" src="images/ecg.png" style="width: 500px;" /></a>
</div>
</div>
<div class="slide" id="analyzing-the-ecg-correct-the-qt-for-heart-rate">
<h1>Analyzing the ECG: Correct the QT for heart rate</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>QT increases curvilinearly with heart rate (HR)</li>
<li>Traditional correction methods approximate to <span class="formula"><i>QTc</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><i>QT</i></span><span class="ignored">)/(</span><span class="denominator"><span class="sqrt"><sup class="root">2</sup><span class="radical">√</span><span class="ignored">(</span><span class="root"><i>RR</i></span><span class="ignored">)</span></span></span><span class="ignored">)</span></span></span>
</li>
<li>Individual regression of HR for each trial is best</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.cardiovascular-sciences.org/wp-content/uploads/2013/07/6b.png"><img alt="QT correction factors" src="images/qt_correction_factors.png" style="width: 500px;" /></a>
</div>
</div>
<div class="slide" id="how-does-python-help-you-analyse-the-ecg">
<h1>How does Python help you analyse the ECG?</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>No more difficult than MATLAB</li>
<li>Most commercial ECG analysis tool have poor scripting</li>
<li>Poor end-to-end workflows</li>
<li>Breakout of domain specific tools</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://en.wikipedia.org/wiki/File:SinusRhythmLabels.svg"><img alt="ECG" src="images/ecg.png" style="width: 500px;" /></a>
</div>
</div>
<div class="section slide" id="statistical-analysis-of-clinical-datasets">
<h1>Statistical analysis of clinical datasets</h1>
</div>
<div class="slide" id="clinical-datasets">
<h1>Clinical datasets</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Larg-ish Set of Records; 200Mb Phase 1, 1Gb Phase 2,</li>
<li>Shape 8-20 cols by ~30,000 rows</li>
<li>Pivot on ~100 different axes and report</li>
<li>abbr Evrywhr</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.veronapharma.com"><img alt="Power pivot icon" src="images/clinical_dataset.png" style="width: 500px;" /></a>
</div>
</div>
<div class="slide" id="pivoting-clinical-datasets">
<h1>Pivoting Clinical Datasets</h1>
<div class="compare-left container">
<ul class="incremental">
<li><dl class="first docutils">
<dt>Originally I rolled my own</dt>
<dd><ul class="first last simple">
<li>Subclass recarray,</li>
<li>Use np.unique,</li>
<li>"Stack" the data, a.k.a, build a tree</li>
</ul>
</dd>
</dl>
</li>
<li><p class="first">Now, I use Pandas</p>
</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.veronapharma.com"><img alt="Clinical dataset" src="images/clinical_dataset.png" style="width: 500px;" /></a>
</div>
</div>
<div class="slide" id="id3">
<h1>Pivoting Clinical Datasets</h1>
<pre class="code python literal-block">
<span class="keyword namespace">import</span> <span class="name namespace">pandas</span> <span class="keyword namespace">as</span> <span class="name namespace">pd</span>
<span class="name">df</span> <span class="operator">=</span> <span class="operator">...</span> <span class="comment"># import data from excel, sql</span>
<span class="comment"># pivot the whole dataset</span>
<span class="name">results</span> <span class="operator">=</span> <span class="name">pd</span><span class="operator">.</span><span class="name">pivot_table</span><span class="punctuation">(</span><span class="name">df</span><span class="punctuation">,</span> <span class="name">cols</span><span class="operator">=</span><span class="punctuation">[</span><span class="literal string">'Parameter'</span><span class="punctuation">],</span> <span class="name">rows</span><span class="operator">=</span><span class="punctuation">[</span><span class="literal string">'Subject'</span><span class="punctuation">,</span> <span class="literal string">'Activity'</span><span class="punctuation">],</span> <span class="name">values</span><span class="operator">=</span><span class="literal string">'Value'</span><span class="punctuation">)</span>
<span class="comment"># group by, in stages</span>
<span class="name">by_subject</span> <span class="operator">=</span> <span class="name">df</span><span class="operator">.</span><span class="name">groupby</span><span class="punctuation">(</span><span class="literal string">'subject'</span><span class="punctuation">);</span>
<span class="keyword">for</span> <span class="name">name</span><span class="punctuation">,</span> <span class="name">group</span> <span class="operator word">in</span> <span class="name">by_subject</span><span class="punctuation">:</span>
<span class="comment"># calculate parameter,</span>
<span class="comment"># e.g. regression heart rate vs dose</span>
</pre>
</div>
<div class="slide" id="abbr-evrywhr">
<h1>abbr Evrywhr</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Abbreviations a.k.a Clinical Ontologies</li>
<li>"Explicit is better than implicit."</li>
<li>Dictionary map our ontologies to theirs</li>
<li>__repr__ method to print description</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.full-proof.co.uk/Blog/wp-content/uploads/2012/03/44852_8e1ede809fe796b3baee1a58609e8583.jpg"><img alt="Image of abbreviations" src="images/abbreviations.jpg" style="width: 500px;" /></a>
</div>
</div>
<div class="slide" id="how-does-python-help-you-analyse-clinical-data">
<h1>How does Python help you analyse clinical data?</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Clinical datasets are a little too large for Excel</li>
<li>Full-fledged programming, REPL and easy syntax</li>
<li>Limits the sprawl of Excel spreadsheets</li>
<li><tt class="docutils literal">scikits.statsmodels</tt> integrates with pandas</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.veronapharma.com"><img alt="Image of abbreviations" src="images/clinical_dataset.png" /></a>
</div>
</div>
<div class="section slide" id="documentation-according-to-regulated-ontologies">
<h1>Documentation according to regulated ontologies</h1>
</div>
<div class="slide" id="converting-our-documents-to-sphinx">
<h1>Converting our documents to Sphinx</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Convert Word to HTML</li>
<li>Clean HTML elements</li>
<li>Pandoc to ReST</li>
<li>Generate a TOC</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.import-this.de/media/cache/img/podcasts/import-this/episodes/sphinx_img_episode_lg.png"><img alt="Sphinx Logo" src="images/sphinx_logo.png" /></a>
</div>
</div>
<div class="slide" id="sphinx-rolename">
<h1>Sphinx: Rolename</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Regulatory submissions must use the <strong>Common Technical Document</strong> format</li>
<li>Rolename per variable of the eCTD</li>
<li>Build process for submission</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://upload.wikimedia.org/wikipedia/commons/c/c2/CTD-img004.gif"><img alt="CTD triangle" src="images/CTD_triangle.gif" /></a>
</div>
</div>
<div class="slide" id="sphinx-features-for-pharma">
<h1>Sphinx: Features for Pharma</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Convert to Latex > PDF, HTML</li>
<li>Searchable, hyperlinked.</li>
<li>Rolename to add in regulatory parameters</li>
<li>Directives to control repetitive macro content</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.import-this.de/media/cache/img/podcasts/import-this/episodes/sphinx_img_episode_lg.png"><img alt="Sphinx Logo" src="images/sphinx_logo.png" /></a>
</div>
</div>
<div class="section slide" id="what-s-holding-python-back-in-drug-discovery">
<h1>What's holding Python back in Drug Discovery?</h1>
</div>
<div class="slide" id="inertia-regulation-and-having-someone-to-blame">
<h1>Inertia, regulation and having someone to blame</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Culturally slow to change</li>
<li>Use Office, Use Sharepoint</li>
<li>Regulated companies want regulated solutions</li>
<li>Liability and legal conformity</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://www.stmary.ws/highschool/physics/home/notes/dynamics/friction/imgE2.gif"><img alt="Friction" src="images/friction_motion.gif" /></a>
</div>
</div>
<div class="slide" id="possible-solutions">
<h1>Possible solutions</h1>
<div class="compare-left container">
<ul class="incremental simple">
<li>Social engineering</li>
<li>Target biotech then target Big Pharma</li>
<li>Python Certified®</li>
<li>A legal entity to insure the code - PSF? Continuum?</li>
</ul>
</div>
<div class="compare-right container">
<a class="reference external image-reference" href="http://i-codedesign.com/wp-content/uploads/2012/04/solutionsicon.jpg"><img alt="Solutions Icon" src="images/solutions.jpg" /></a>
</div>
</div>
<div class="section slide" id="questions">
<h1>Questions?</h1>
<!-- Replacements -->
<!-- Footnotes -->
<table class="docutils footnote" frame="void" id="id4" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>HM Revenue and Customs, UK Trade Info 2012, February 2013</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id5" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id2">[2]</a></td><td>ONS, Business Enterprise Research and Development 2010, November 2012</td></tr>
</tbody>
</table>
</div>
</div>
</body>
</html>