-
Notifications
You must be signed in to change notification settings - Fork 8
/
README.html
825 lines (817 loc) · 52.7 KB
/
README.html
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
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
@font-face {
font-family: octicons-link;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkA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LgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff');
}
body {
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
color: #333;
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.6;
word-wrap: break-word;
}
a {
background-color: transparent;
}
a:active,
a:hover {
outline: 0;
}
strong {
font-weight: bold;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
img {
border: 0;
}
hr {
box-sizing: content-box;
height: 0;
}
pre {
overflow: auto;
}
code,
kbd,
pre {
font-family: monospace, monospace;
font-size: 1em;
}
input {
color: inherit;
font: inherit;
margin: 0;
}
html input[disabled] {
cursor: default;
}
input {
line-height: normal;
}
input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
* {
box-sizing: border-box;
}
input {
font: 13px / 1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
a {
color: #4078c0;
text-decoration: none;
}
a:hover,
a:active {
text-decoration: underline;
}
hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
hr:before {
display: table;
content: "";
}
hr:after {
display: table;
clear: both;
content: "";
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
h1 {
font-size: 30px;
}
h2 {
font-size: 21px;
}
h3 {
font-size: 16px;
}
h4 {
font-size: 14px;
}
h5 {
font-size: 12px;
}
h6 {
font-size: 11px;
}
blockquote {
margin: 0;
}
ul,
ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
ol ol,
ul ol {
list-style-type: lower-roman;
}
ul ul ol,
ul ol ol,
ol ul ol,
ol ol ol {
list-style-type: lower-alpha;
}
dd {
margin-left: 0;
}
code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.select::-ms-expand {
opacity: 0;
}
.octicon {
font: normal normal normal 16px/1 octicons-link;
display: inline-block;
text-decoration: none;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.octicon-link:before {
content: '\f05c';
}
.markdown-body:before {
display: table;
content: "";
}
.markdown-body:after {
display: table;
clear: both;
content: "";
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
a:not([href]) {
color: inherit;
text-decoration: none;
}
.anchor {
display: inline-block;
padding-right: 2px;
margin-left: -18px;
}
.anchor:focus {
outline: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
h1 .octicon-link,
h2 .octicon-link,
h3 .octicon-link,
h4 .octicon-link,
h5 .octicon-link,
h6 .octicon-link {
color: #000;
vertical-align: middle;
visibility: hidden;
}
h1:hover .anchor,
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
h5:hover .anchor,
h6:hover .anchor {
text-decoration: none;
}
h1:hover .anchor .octicon-link,
h2:hover .anchor .octicon-link,
h3:hover .anchor .octicon-link,
h4:hover .anchor .octicon-link,
h5:hover .anchor .octicon-link,
h6:hover .anchor .octicon-link {
visibility: visible;
}
h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
h1 .anchor {
line-height: 1;
}
h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
h2 .anchor {
line-height: 1;
}
h3 {
font-size: 1.5em;
line-height: 1.43;
}
h3 .anchor {
line-height: 1.2;
}
h4 {
font-size: 1.25em;
}
h4 .anchor {
line-height: 1.2;
}
h5 {
font-size: 1em;
}
h5 .anchor {
line-height: 1.1;
}
h6 {
font-size: 1em;
color: #777;
}
h6 .anchor {
line-height: 1.1;
}
p,
blockquote,
ul,
ol,
dl,
table,
pre {
margin-top: 0;
margin-bottom: 16px;
}
hr {
height: 4px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
}
ul,
ol {
padding-left: 2em;
}
ul ul,
ul ol,
ol ol,
ol ul {
margin-top: 0;
margin-bottom: 0;
}
li>p {
margin-top: 16px;
}
dl {
padding: 0;
}
dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
blockquote>:first-child {
margin-top: 0;
}
blockquote>:last-child {
margin-bottom: 0;
}
table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
table th {
font-weight: bold;
}
table th,
table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}
img {
max-width: 100%;
box-sizing: content-box;
background-color: #fff;
}
code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0,0,0,0.04);
border-radius: 3px;
}
code:before,
code:after {
letter-spacing: -0.2em;
content: "\00a0";
}
pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.highlight {
margin-bottom: 16px;
}
.highlight pre,
pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.highlight pre {
margin-bottom: 0;
word-break: normal;
}
pre {
word-wrap: normal;
}
pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
pre code:before,
pre code:after {
content: normal;
}
kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.pl-c {
color: #969896;
}
.pl-c1,
.pl-s .pl-v {
color: #0086b3;
}
.pl-e,
.pl-en {
color: #795da3;
}
.pl-s .pl-s1,
.pl-smi {
color: #333;
}
.pl-ent {
color: #63a35c;
}
.pl-k {
color: #a71d5d;
}
.pl-pds,
.pl-s,
.pl-s .pl-pse .pl-s1,
.pl-sr,
.pl-sr .pl-cce,
.pl-sr .pl-sra,
.pl-sr .pl-sre {
color: #183691;
}
.pl-v {
color: #ed6a43;
}
.pl-id {
color: #b52a1d;
}
.pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.pl-ml {
color: #693a17;
}
.pl-mh,
.pl-mh .pl-en,
.pl-ms {
color: #1d3e81;
font-weight: bold;
}
.pl-mq {
color: #008080;
}
.pl-mi {
color: #333;
font-style: italic;
}
.pl-mb {
color: #333;
font-weight: bold;
}
.pl-md {
background-color: #ffecec;
color: #bd2c00;
}
.pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.pl-mdr {
color: #795da3;
font-weight: bold;
}
.pl-mo {
color: #1d3e81;
}
kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.task-list-item {
list-style-type: none;
}
.task-list-item+.task-list-item {
margin-top: 3px;
}
.task-list-item input {
margin: 0 0.35em 0.25em -1.6em;
vertical-align: middle;
}
:checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4078c0;
}
.sourceLine {
display: inline-block;
}
code .kw { color: #000000; }
code .dt { color: #ed6a43; }
code .dv { color: #009999; }
code .bn { color: #009999; }
code .fl { color: #009999; }
code .ch { color: #009999; }
code .st { color: #183691; }
code .co { color: #969896; }
code .ot { color: #0086b3; }
code .al { color: #a61717; }
code .fu { color: #63a35c; }
code .er { color: #a61717; background-color: #e3d2d2; }
code .wa { color: #000000; }
code .cn { color: #008080; }
code .sc { color: #008080; }
code .vs { color: #183691; }
code .ss { color: #183691; }
code .im { color: #000000; }
code .va {color: #008080; }
code .cf { color: #000000; }
code .op { color: #000000; }
code .bu { color: #000000; }
code .ex { color: #000000; }
code .pp { color: #999999; }
code .at { color: #008080; }
code .do { color: #969896; }
code .an { color: #008080; }
code .cv { color: #008080; }
code .in { color: #008080; }
</style>
<style>
body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
padding-top: 0px;
}
</style>
</head>
<body>
<p><a href="https://travis-ci.org/ropensci/tidypmc"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5MCIgaGVpZ2h0PSIyMCI+PGxpbmVhckdyYWRpZW50IGlkPSJhIiB4Mj0iMCIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2JiYiIgc3RvcC1vcGFjaXR5PSIuMSIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1vcGFjaXR5PSIuMSIvPjwvbGluZWFyR3JhZGllbnQ+PHJlY3Qgcng9IjMiIHdpZHRoPSI5MCIgaGVpZ2h0PSIyMCIgZmlsbD0iIzU1NSIvPjxyZWN0IHJ4PSIzIiB4PSIzNyIgd2lkdGg9IjUzIiBoZWlnaHQ9IjIwIiBmaWxsPSIjNGMxIi8+PHBhdGggZmlsbD0iIzRjMSIgZD0iTTM3IDBoNHYyMGgtNHoiLz48cmVjdCByeD0iMyIgd2lkdGg9IjkwIiBoZWlnaHQ9IjIwIiBmaWxsPSJ1cmwoI2EpIi8+PGcgZmlsbD0iI2ZmZiIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9IkRlamFWdSBTYW5zLFZlcmRhbmEsR2VuZXZhLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTEiPjx0ZXh0IHg9IjE5LjUiIHk9IjE1IiBmaWxsPSIjMDEwMTAxIiBmaWxsLW9wYWNpdHk9Ii4zIj5idWlsZDwvdGV4dD48dGV4dCB4PSIxOS41IiB5PSIxNCI+YnVpbGQ8L3RleHQ+PHRleHQgeD0iNjIuNSIgeT0iMTUiIGZpbGw9IiMwMTAxMDEiIGZpbGwtb3BhY2l0eT0iLjMiPnBhc3Npbmc8L3RleHQ+PHRleHQgeD0iNjIuNSIgeT0iMTQiPnBhc3Npbmc8L3RleHQ+PC9nPjwvc3ZnPg==" alt="Build Status" /></a> <a href="https://codecov.io/github/ropensci/tidypmc?branch=master"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMTIiIGhlaWdodD0iMjAiPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJiIiB4Mj0iMCIgeTI9IjEwMCUiPgogICAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2JiYiIgc3RvcC1vcGFjaXR5PSIuMSIgLz4KICAgICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3Atb3BhY2l0eT0iLjEiIC8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPG1hc2sgaWQ9ImEiPgogICAgICAgIDxyZWN0IHdpZHRoPSIxMTIiIGhlaWdodD0iMjAiIHJ4PSIzIiBmaWxsPSIjZmZmIiAvPgogICAgPC9tYXNrPgogICAgPGcgbWFzaz0idXJsKCNhKSI+CiAgICAgICAgPHBhdGggZmlsbD0iIzU1NSIgZD0iTTAgMGg3NnYyMEgweiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjZjg4ZTI5IiBkPSJNNzYgMGgzNnYyMEg3NnoiIC8+CiAgICAgICAgPHBhdGggZmlsbD0idXJsKCNiKSIgZD0iTTAgMGgxMTJ2MjBI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GExMS40MDMgMTEuNDAzIDAgMCAxIDYuNjUxIDEuOTU3bC4wNTQuMDM2IDMuODYyLTIuMjM3LjA1LS4wM3YtLjA1NmMuMDA2LTYuMDgtMi4zODQtMTEuNzkzLTYuNzI5LTE2LjA4OUMzNC45MzIgMi4zNjEgMjkuMTYgMCAyMy4wMTMgMCIgZmlsbD0iI0YwMUY3QSIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8L3N2Zz4KPC9zdmc+" alt="Coverage status" /></a> <a href="https://cran.r-project.org/package=tidypmc"><img src="data:image/svg+xml; charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3NiIgaGVpZ2h0PSIyMCI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJiIiB4Mj0iMCIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjYmJiIiBzdG9wLW9wYWNpdHk9Ii4xIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3Atb3BhY2l0eT0iLjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxtYXNrIGlkPSJhIj4KICAgIDxyZWN0IHdpZHRoPSI3NiIgaGVpZ2h0PSIyMCIgcng9IjMiIGZpbGw9IiNmZmYiLz4KICA8L21hc2s+CiAgPGcgbWFzaz0idXJsKCNhKSI+CiAgICA8cGF0aCBmaWxsPSIjNTU1IiBkPSJNMCAwaDQzdjIwSDB6Ii8+CiAgICA8cGF0aCBmaWxsPSIjNGMxIiBkPSJNNDMgMGg1Mi41djIwSDQzeiIvPgogICAgPHBhdGggZmlsbD0idXJsKCNiKSIgZD0iTTAgMGg3NnYyMEgweiIvPgogIDwvZz4KICA8ZyBmaWxsPSIjZmZmIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIgogICAgIGZvbnQtZmFtaWx5PSJEZWphVnUgU2FucyxWZXJkYW5hLEdlbmV2YSxzYW5zLXNlcmlmIiBmb250LXNpemU9IjExIj4KICAgIDx0ZXh0IHg9IjIxLjUiIHk9IjE1IiBmaWxsPSIjMDEwMTAxIiBmaWxsLW9wYWNpdHk9Ii4zIj4KICAgICAgQ1JBTgogICAgPC90ZXh0PgogICAgPHRleHQgeD0iMjEuNSIgeT0iMTQiPgogICAgICBDUkFOCiAgICA8L3RleHQ+CiAgICA8dGV4dCB4PSI1OC41IiB5PSIxNSIgZmlsbD0iIzAxMDEwMSIgZmlsbC1vcGFjaXR5PSIuMyI+CiAgICAgIDEuNwogICAgPC90ZXh0PgogICAgPHRleHQgeD0iNTguNSIgeT0iMTQiPgogICAgICAxLjcKICAgIDwvdGV4dD4KICA8L2c+Cjwvc3ZnPg==" alt="CRAN_Status_Badge" /></a> <a href="https://CRAN.R-project.org/package=tidypmc"><img src="data:image/svg+xml; charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDkiIGhlaWdodD0iMjAiPgogIDxsaW5lYXJHcmFkaWVudCBpZD0iYiIgeDI9IjAiIHkyPSIxMDAlIj4KICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2JiYiIgc3RvcC1vcGFjaXR5PSIuMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLW9wYWNpdHk9Ii4xIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8bWFzayBpZD0iYSI+CiAgICA8cmVjdCB3aWR0aD0iMTQ5IiBoZWlnaHQ9IjIwIiByeD0iMyIgZmlsbD0iI2ZmZiIvPgogIDwvbWFzaz4KICA8ZyBtYXNrPSJ1cmwoI2EpIj48cGF0aCBmaWxsPSIjNTU1IiBkPSJNMCAwaDcwdjIwSDB6Ii8+CiAgICA8cGF0aCBmaWxsPSIjMDA3ZWM2IiBkPSJNNzAgMGg3OXYyMEg3MHoiLz4KICAgIDxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0wIDBoMTQ5djIwSDB6Ii8+CiAgPC9nPgogIDxnIGZpbGw9IiNmZmYiIHRleHQtYW5jaG9yPSJtaWRkbGUiCiAgICAgZm9udC1mYW1pbHk9IkRlamFWdSBTYW5zLFZlcmRhbmEsR2VuZXZhLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTEiPgogICAgPHRleHQgeD0iMzYiIHk9IjE1IiBmaWxsPSIjMDEwMTAxIiBmaWxsLW9wYWNpdHk9Ii4zIj4KICAgICAgZG93bmxvYWRzCiAgICA8L3RleHQ+CiAgICA8dGV4dCB4PSIzNiIgeT0iMTQiPgogICAgICBkb3dubG9hZHMKICAgIDwvdGV4dD4KICAgIDx0ZXh0IHg9IjEwOC41IiB5PSIxNSIgZmlsbD0iIzAxMDEwMSIgZmlsbC1vcGFjaXR5PSIuMyI+CiAgICAgIDI0L21vbnRoCiAgICA8L3RleHQ+CiAgICA8dGV4dCB4PSIxMDguNSIgeT0iMTQiPgogICAgICAyNC9tb250aAogICAgPC90ZXh0PgogIDwvZz4KPC9zdmc+" alt="Downloads" /></a> <a href="https://CRAN.R-project.org/package=tidypmc"><img src="data:image/svg+xml; charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDgiIGhlaWdodD0iMjAiPgogIDxsaW5lYXJHcmFkaWVudCBpZD0iYiIgeDI9IjAiIHkyPSIxMDAlIj4KICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2JiYiIgc3RvcC1vcGFjaXR5PSIuMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLW9wYWNpdHk9Ii4xIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8bWFzayBpZD0iYSI+CiAgICA8cmVjdCB3aWR0aD0iMTA4IiBoZWlnaHQ9IjIwIiByeD0iMyIgZmlsbD0iI2ZmZiIvPgogIDwvbWFzaz4KICA8ZyBtYXNrPSJ1cmwoI2EpIj48cGF0aCBmaWxsPSIjNTU1IiBkPSJNMCAwaDcwdjIwSDB6Ii8+CiAgICA8cGF0aCBmaWxsPSIjZmU3ZDM3IiBkPSJNNzAgMGgzOHYyMEg3MHoiLz4KICAgIDxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0wIDBoMTA4djIwSDB6Ii8+CiAgPC9nPgogIDxnIGZpbGw9IiNmZmYiIHRleHQtYW5jaG9yPSJtaWRkbGUiCiAgICAgZm9udC1mYW1pbHk9IkRlamFWdSBTYW5zLFZlcmRhbmEsR2VuZXZhLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTEiPgogICAgPHRleHQgeD0iMzYiIHk9IjE1IiBmaWxsPSIjMDEwMTAxIiBmaWxsLW9wYWNpdHk9Ii4zIj4KICAgICAgZG93bmxvYWRzCiAgICA8L3RleHQ+CiAgICA8dGV4dCB4PSIzNiIgeT0iMTQiPgogICAgICBkb3dubG9hZHMKICAgIDwvdGV4dD4KICAgIDx0ZXh0IHg9Ijg4IiB5PSIxNSIgZmlsbD0iIzAxMDEwMSIgZmlsbC1vcGFjaXR5PSIuMyI+CiAgICAgIDI0CiAgICA8L3RleHQ+CiAgICA8dGV4dCB4PSI4OCIgeT0iMTQiPgogICAgICAyNAogICAgPC90ZXh0PgogIDwvZz4KPC9zdmc+" alt="Total Downloads" /></a></p>
<h1 id="tidypmc">tidypmc</h1>
<p>The <a href="https://europepmc.org/downloads/openaccess">Open Access subset</a> of <a href="https://europepmc.org">Pubmed Central</a> (PMC) includes 2.5 million articles from biomedical and life sciences journals. The full text XML files are freely available for text mining from the <a href="https://europepmc.org/RestfulWebService">REST service</a> or <a href="https://europepmc.org/ftp/oa/">FTP site</a> but can be challenging to parse. For example, section tags are nested to arbitrary depths, formulas and tables may return incomprehensible text blobs and superscripted references are pasted at the end of words. The functions in the <code>tidypmc</code> package are intended to return readable text and maintain the document structure, so gene names and other terms can be associated with specific sections, paragraphs, sentences or table rows.</p>
<h2 id="installation">Installation</h2>
<p>Use <a href="https://github.com/r-lib/remotes">remotes</a> to install the package.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1">remotes<span class="op">::</span><span class="kw">install_github</span>(<span class="st">"ropensci/tidypmc"</span>)</a></code></pre></div>
<h2 id="load-xml">Load XML</h2>
<p>Download a single XML document like <a href="https://www.ebi.ac.uk/europepmc/webservices/rest/PMC2231364/fullTextXML">PMC2231364</a> from the <a href="https://europepmc.org/RestfulWebService">REST service</a> using the <code>pmc_xml</code> function.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw">library</span>(tidypmc)</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="kw">library</span>(tidyverse)</a>
<a class="sourceLine" id="cb2-3" data-line-number="3">doc <-<span class="st"> </span><span class="kw">pmc_xml</span>(<span class="st">"PMC2231364"</span>)</a>
<a class="sourceLine" id="cb2-4" data-line-number="4">doc</a>
<a class="sourceLine" id="cb2-5" data-line-number="5"><span class="co"># {xml_document}</span></a>
<a class="sourceLine" id="cb2-6" data-line-number="6"><span class="co"># <article article-type="research-article" xmlns:xlink="http://www.w3.org/1999/xlink"></span></a>
<a class="sourceLine" id="cb2-7" data-line-number="7"><span class="co"># [1] <front>\n <journal-meta>\n <journal-id journal-id-type="nlm-ta">BMC Microbiol</journal-id ...</span></a>
<a class="sourceLine" id="cb2-8" data-line-number="8"><span class="co"># [2] <body>\n <sec>\n <title>Background</title>\n <p><italic>Yersinia pestis </italic>is th ...</span></a>
<a class="sourceLine" id="cb2-9" data-line-number="9"><span class="co"># [3] <back>\n <ack>\n <sec>\n <title>Acknowledgements</title>\n <p>We thank Dr. Chen ...</span></a></code></pre></div>
<p>The <a href="https://github.com/ropensci/europepmc">europepmc</a> package includes additional functions to search PMC and download full text. Be sure to include the <code>OPEN_ACCESS</code> field in the search since these are the only articles with full text XML available.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw">library</span>(europepmc)</a>
<a class="sourceLine" id="cb3-2" data-line-number="2">yp <-<span class="st"> </span><span class="kw">epmc_search</span>(<span class="st">"title:(Yersinia pestis virulence) OPEN_ACCESS:Y"</span>)</a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="co"># 19 records found, returning 19</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="kw">select</span>(yp, pmcid, pubYear, title) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="st"> </span><span class="kw">print</span>(<span class="dt">n=</span><span class="dv">5</span>)</a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="co"># # A tibble: 19 x 3</span></a>
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="co"># pmcid pubYear title </span></a>
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># <chr> <chr> <chr> </span></a>
<a class="sourceLine" id="cb3-9" data-line-number="9"><span class="co"># 1 PMC5505154 2017 Crystal structure of Yersinia pestis virulence factor YfeA reveals two polyspe…</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># 2 PMC3521224 2012 Omics strategies for revealing Yersinia pestis virulence. </span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># 3 PMC2704395 2009 Involvement of the post-transcriptional regulator Hfq in Yersinia pestis virul…</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># 4 PMC2736372 2009 The NlpD lipoprotein is a novel Yersinia pestis virulence factor essential for…</span></a>
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># 5 PMC3109262 2011 A comprehensive study on the role of the Yersinia pestis virulence markers in …</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># # … with 14 more rows</span></a></code></pre></div>
<p>Save all 19 results to a list of XML documents using the <code>epmc_ftxt</code> or <code>pmc_xml</code> function.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1">docs <-<span class="st"> </span><span class="kw">map</span>(yp<span class="op">$</span>pmcid, epmc_ftxt)</a></code></pre></div>
<p>See the <a href="https://github.com/ropensci/tidypmc/blob/master/vignettes/pmcftp.md">PMC FTP vignette</a> for details on parsing the large XML files on the <a href="https://europepmc.org/ftp/oa/">FTP site</a> with 10,000 articles each.</p>
<h2 id="parse-xml">Parse XML</h2>
<p>The package includes five functions to parse the <code>xml_document</code>.</p>
<table>
<thead>
<tr class="header">
<th align="left">R function</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left"><code>pmc_text</code></td>
<td align="left">Split section paragraphs into sentences with full path to subsection titles</td>
</tr>
<tr class="even">
<td align="left"><code>pmc_caption</code></td>
<td align="left">Split figure, table and supplementary material captions into sentences</td>
</tr>
<tr class="odd">
<td align="left"><code>pmc_table</code></td>
<td align="left">Convert table nodes into a list of tibbles</td>
</tr>
<tr class="even">
<td align="left"><code>pmc_reference</code></td>
<td align="left">Format references cited into a tibble</td>
</tr>
<tr class="odd">
<td align="left"><code>pmc_metadata</code></td>
<td align="left">List journal and article metadata in front node</td>
</tr>
</tbody>
</table>
<p>The <code>pmc_text</code> function uses the <a href="https://lincolnmullen.com/software/tokenizers/">tokenizers</a> package to split section paragraphs into sentences. The function also removes any tables, figures or formulas that are nested within paragraph tags, replaces superscripted references with brackets, adds carets and underscores to other superscripts and subscripts and includes the full path to the subsection title.</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1">txt <-<span class="st"> </span><span class="kw">pmc_text</span>(doc)</a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="co"># Note: removing disp-formula nested in sec/p tag</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3">txt</a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="co"># # A tibble: 194 x 4</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="co"># section paragraph sentence text </span></a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co"># <chr> <int> <int> <chr> </span></a>
<a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># 1 Title 1 1 Comparative transcriptomics in Yersinia pestis: a global view of environment…</span></a>
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># 2 Abstract 1 1 Environmental modulation of gene expression in Yersinia pestis is critical f…</span></a>
<a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co"># 3 Abstract 1 2 Using cDNA microarray technology, we have analyzed the global gene expressio…</span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># 4 Abstract 2 1 To provide us with a comprehensive view of environmental modulation of globa…</span></a>
<a class="sourceLine" id="cb5-11" data-line-number="11"><span class="co"># 5 Abstract 2 2 Almost all known virulence genes of Y. pestis were differentially regulated …</span></a>
<a class="sourceLine" id="cb5-12" data-line-number="12"><span class="co"># 6 Abstract 2 3 Clustering enabled us to functionally classify co-expressed genes, including…</span></a>
<a class="sourceLine" id="cb5-13" data-line-number="13"><span class="co"># 7 Abstract 2 4 Collections of operons were predicted from the microarray data, and some of …</span></a>
<a class="sourceLine" id="cb5-14" data-line-number="14"><span class="co"># 8 Abstract 2 5 Several regulatory DNA motifs, probably recognized by the regulatory protein…</span></a>
<a class="sourceLine" id="cb5-15" data-line-number="15"><span class="co"># 9 Abstract 3 1 The comparative transcriptomics analysis we present here not only benefits o…</span></a>
<a class="sourceLine" id="cb5-16" data-line-number="16"><span class="co"># 10 Background 1 1 Yersinia pestis is the etiological agent of plague, alternatively growing in…</span></a>
<a class="sourceLine" id="cb5-17" data-line-number="17"><span class="co"># # … with 184 more rows</span></a>
<a class="sourceLine" id="cb5-18" data-line-number="18"><span class="kw">count</span>(txt, section, <span class="dt">sort=</span><span class="ot">TRUE</span>)</a>
<a class="sourceLine" id="cb5-19" data-line-number="19"><span class="co"># # A tibble: 21 x 2</span></a>
<a class="sourceLine" id="cb5-20" data-line-number="20"><span class="co"># section n</span></a>
<a class="sourceLine" id="cb5-21" data-line-number="21"><span class="co"># <chr> <int></span></a>
<a class="sourceLine" id="cb5-22" data-line-number="22"><span class="co"># 1 Results and Discussion; Clustering analysis and functional classification of co-expressed gene clust… 22</span></a>
<a class="sourceLine" id="cb5-23" data-line-number="23"><span class="co"># 2 Background 20</span></a>
<a class="sourceLine" id="cb5-24" data-line-number="24"><span class="co"># 3 Results and Discussion; Virulence genes in response to multiple environmental stresses 20</span></a>
<a class="sourceLine" id="cb5-25" data-line-number="25"><span class="co"># 4 Methods; Collection of microarray expression data 17</span></a>
<a class="sourceLine" id="cb5-26" data-line-number="26"><span class="co"># 5 Results and Discussion; Computational discovery of regulatory DNA motifs 16</span></a>
<a class="sourceLine" id="cb5-27" data-line-number="27"><span class="co"># 6 Methods; Gel mobility shift analysis of Fur binding 13</span></a>
<a class="sourceLine" id="cb5-28" data-line-number="28"><span class="co"># 7 Results and Discussion; Verification of predicted operons by RT-PCR 10</span></a>
<a class="sourceLine" id="cb5-29" data-line-number="29"><span class="co"># 8 Abstract 8</span></a>
<a class="sourceLine" id="cb5-30" data-line-number="30"><span class="co"># 9 Methods; Discovery of regulatory DNA motifs 8</span></a>
<a class="sourceLine" id="cb5-31" data-line-number="31"><span class="co"># 10 Methods; Clustering analysis 7</span></a>
<a class="sourceLine" id="cb5-32" data-line-number="32"><span class="co"># # … with 11 more rows</span></a></code></pre></div>
<p>Load the <a href="https://www.tidytextmining.com/">tidytext</a> package for further text processing.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw">library</span>(tidytext)</a>
<a class="sourceLine" id="cb6-2" data-line-number="2">x1 <-<span class="st"> </span><span class="kw">unnest_tokens</span>(txt, word, text) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="st"> </span><span class="kw">anti_join</span>(stop_words) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"><span class="st"> </span><span class="kw">filter</span>(<span class="op">!</span>word <span class="op">%in%</span><span class="st"> </span><span class="dv">1</span><span class="op">:</span><span class="dv">100</span>)</a>
<a class="sourceLine" id="cb6-5" data-line-number="5"><span class="co"># Joining, by = "word"</span></a>
<a class="sourceLine" id="cb6-6" data-line-number="6"><span class="kw">filter</span>(x1, <span class="kw">str_detect</span>(section, <span class="st">"^Results"</span>))</a>
<a class="sourceLine" id="cb6-7" data-line-number="7"><span class="co"># # A tibble: 1,269 x 4</span></a>
<a class="sourceLine" id="cb6-8" data-line-number="8"><span class="co"># section paragraph sentence word </span></a>
<a class="sourceLine" id="cb6-9" data-line-number="9"><span class="co"># <chr> <int> <int> <chr> </span></a>
<a class="sourceLine" id="cb6-10" data-line-number="10"><span class="co"># 1 Results and Discussion 1 1 comprehensive</span></a>
<a class="sourceLine" id="cb6-11" data-line-number="11"><span class="co"># 2 Results and Discussion 1 1 analysis </span></a>
<a class="sourceLine" id="cb6-12" data-line-number="12"><span class="co"># 3 Results and Discussion 1 1 sets </span></a>
<a class="sourceLine" id="cb6-13" data-line-number="13"><span class="co"># 4 Results and Discussion 1 1 microarray </span></a>
<a class="sourceLine" id="cb6-14" data-line-number="14"><span class="co"># 5 Results and Discussion 1 1 expression </span></a>
<a class="sourceLine" id="cb6-15" data-line-number="15"><span class="co"># 6 Results and Discussion 1 1 data </span></a>
<a class="sourceLine" id="cb6-16" data-line-number="16"><span class="co"># 7 Results and Discussion 1 1 dissect </span></a>
<a class="sourceLine" id="cb6-17" data-line-number="17"><span class="co"># 8 Results and Discussion 1 1 bacterial </span></a>
<a class="sourceLine" id="cb6-18" data-line-number="18"><span class="co"># 9 Results and Discussion 1 1 adaptation </span></a>
<a class="sourceLine" id="cb6-19" data-line-number="19"><span class="co"># 10 Results and Discussion 1 1 environments </span></a>
<a class="sourceLine" id="cb6-20" data-line-number="20"><span class="co"># # … with 1,259 more rows</span></a>
<a class="sourceLine" id="cb6-21" data-line-number="21"><span class="kw">filter</span>(x1, <span class="kw">str_detect</span>(section, <span class="st">"^Results"</span>)) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb6-22" data-line-number="22"><span class="st"> </span><span class="kw">count</span>(word, <span class="dt">sort =</span> <span class="ot">TRUE</span>)</a>
<a class="sourceLine" id="cb6-23" data-line-number="23"><span class="co"># # A tibble: 595 x 2</span></a>
<a class="sourceLine" id="cb6-24" data-line-number="24"><span class="co"># word n</span></a>
<a class="sourceLine" id="cb6-25" data-line-number="25"><span class="co"># <chr> <int></span></a>
<a class="sourceLine" id="cb6-26" data-line-number="26"><span class="co"># 1 genes 45</span></a>
<a class="sourceLine" id="cb6-27" data-line-number="27"><span class="co"># 2 cluster 24</span></a>
<a class="sourceLine" id="cb6-28" data-line-number="28"><span class="co"># 3 expression 21</span></a>
<a class="sourceLine" id="cb6-29" data-line-number="29"><span class="co"># 4 pestis 21</span></a>
<a class="sourceLine" id="cb6-30" data-line-number="30"><span class="co"># 5 data 19</span></a>
<a class="sourceLine" id="cb6-31" data-line-number="31"><span class="co"># 6 dna 15</span></a>
<a class="sourceLine" id="cb6-32" data-line-number="32"><span class="co"># 7 gene 15</span></a>
<a class="sourceLine" id="cb6-33" data-line-number="33"><span class="co"># 8 figure 13</span></a>
<a class="sourceLine" id="cb6-34" data-line-number="34"><span class="co"># 9 fur 12</span></a>
<a class="sourceLine" id="cb6-35" data-line-number="35"><span class="co"># 10 operons 12</span></a>
<a class="sourceLine" id="cb6-36" data-line-number="36"><span class="co"># # … with 585 more rows</span></a></code></pre></div>
<p>The <code>pmc_table</code> function formats tables by collapsing multiline headers, expanding rowspan and colspan attributes and adding subheadings into a new column.</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1">tbls <-<span class="st"> </span><span class="kw">pmc_table</span>(doc)</a>
<a class="sourceLine" id="cb7-2" data-line-number="2"><span class="co"># Parsing 4 tables</span></a>
<a class="sourceLine" id="cb7-3" data-line-number="3"><span class="co"># Adding footnotes to Table 1</span></a>
<a class="sourceLine" id="cb7-4" data-line-number="4"><span class="kw">map_int</span>(tbls, nrow)</a>
<a class="sourceLine" id="cb7-5" data-line-number="5"><span class="co"># Table 1 Table 2 Table 3 Table 4 </span></a>
<a class="sourceLine" id="cb7-6" data-line-number="6"><span class="co"># 39 23 4 34</span></a>
<a class="sourceLine" id="cb7-7" data-line-number="7">tbls[[<span class="dv">1</span>]]</a>
<a class="sourceLine" id="cb7-8" data-line-number="8"><span class="co"># # A tibble: 39 x 5</span></a>
<a class="sourceLine" id="cb7-9" data-line-number="9"><span class="co"># subheading `Potential operon (r va… `Gene ID` `Putative or predicted functi… `Reference (s)`</span></a>
<a class="sourceLine" id="cb7-10" data-line-number="10"><span class="co"># <chr> <chr> <chr> <chr> <chr> </span></a>
<a class="sourceLine" id="cb7-11" data-line-number="11"><span class="co"># 1 Iron uptake or heme sy… yfeABCD operon* (r > 0.… YPO2439-24… Transport/binding chelated ir… yfeABCD [54] </span></a>
<a class="sourceLine" id="cb7-12" data-line-number="12"><span class="co"># 2 Iron uptake or heme sy… hmuRSTUV operon (r > 0.… YPO0279-02… Transport/binding hemin hmuRSTUV [55] </span></a>
<a class="sourceLine" id="cb7-13" data-line-number="13"><span class="co"># 3 Iron uptake or heme sy… ysuJIHG* (r > 0.95) YPO1529-15… Iron uptake - </span></a>
<a class="sourceLine" id="cb7-14" data-line-number="14"><span class="co"># 4 Iron uptake or heme sy… sufABCDS* (r > 0.90) YPO2400-24… Iron-regulated Fe-S cluster a… - </span></a>
<a class="sourceLine" id="cb7-15" data-line-number="15"><span class="co"># 5 Iron uptake or heme sy… YPO1854-1856* (r > 0.97) YPO1854-18… Iron uptake or heme synthesis? - </span></a>
<a class="sourceLine" id="cb7-16" data-line-number="16"><span class="co"># 6 Sulfur metabolism tauABCD operon (r > 0.9… YPO0182-01… Transport/binding taurine tauABCD [56] </span></a>
<a class="sourceLine" id="cb7-17" data-line-number="17"><span class="co"># 7 Sulfur metabolism ssuEADCB operon (r > 0.… YPO3623-36… Sulphur metabolism ssu operon [57]</span></a>
<a class="sourceLine" id="cb7-18" data-line-number="18"><span class="co"># 8 Sulfur metabolism cys operon (r > 0.92) YPO3010-30… Cysteine synthesis - </span></a>
<a class="sourceLine" id="cb7-19" data-line-number="19"><span class="co"># 9 Sulfur metabolism YPO1317-1319 (r > 0.97) YPO1317-13… Sulfur metabolism? - </span></a>
<a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co"># 10 Sulfur metabolism YPO4109-4111 (r > 0.90) YPO4109-41… Sulfur metabolism? - </span></a>
<a class="sourceLine" id="cb7-21" data-line-number="21"><span class="co"># # … with 29 more rows</span></a></code></pre></div>
<p>Use <code>collapse_rows</code> to join column names and cell values in a semi-colon delimited string (and then search using functions in the next section).</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw">collapse_rows</span>(tbls, <span class="dt">na.string=</span><span class="st">"-"</span>)</a>
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="co"># # A tibble: 100 x 3</span></a>
<a class="sourceLine" id="cb8-3" data-line-number="3"><span class="co"># table row text </span></a>
<a class="sourceLine" id="cb8-4" data-line-number="4"><span class="co"># <chr> <int> <chr> </span></a>
<a class="sourceLine" id="cb8-5" data-line-number="5"><span class="co"># 1 Table 1 1 subheading=Iron uptake or heme synthesis; Potential operon (r value)=yfeABCD operon* (r > 0.…</span></a>
<a class="sourceLine" id="cb8-6" data-line-number="6"><span class="co"># 2 Table 1 2 subheading=Iron uptake or heme synthesis; Potential operon (r value)=hmuRSTUV operon (r > 0.…</span></a>
<a class="sourceLine" id="cb8-7" data-line-number="7"><span class="co"># 3 Table 1 3 subheading=Iron uptake or heme synthesis; Potential operon (r value)=ysuJIHG* (r > 0.95); Ge…</span></a>
<a class="sourceLine" id="cb8-8" data-line-number="8"><span class="co"># 4 Table 1 4 subheading=Iron uptake or heme synthesis; Potential operon (r value)=sufABCDS* (r > 0.90); G…</span></a>
<a class="sourceLine" id="cb8-9" data-line-number="9"><span class="co"># 5 Table 1 5 subheading=Iron uptake or heme synthesis; Potential operon (r value)=YPO1854-1856* (r > 0.97…</span></a>
<a class="sourceLine" id="cb8-10" data-line-number="10"><span class="co"># 6 Table 1 6 subheading=Sulfur metabolism; Potential operon (r value)=tauABCD operon (r > 0.90); Gene ID=…</span></a>
<a class="sourceLine" id="cb8-11" data-line-number="11"><span class="co"># 7 Table 1 7 subheading=Sulfur metabolism; Potential operon (r value)=ssuEADCB operon (r > 0.97); Gene ID…</span></a>
<a class="sourceLine" id="cb8-12" data-line-number="12"><span class="co"># 8 Table 1 8 subheading=Sulfur metabolism; Potential operon (r value)=cys operon (r > 0.92); Gene ID=YPO3…</span></a>
<a class="sourceLine" id="cb8-13" data-line-number="13"><span class="co"># 9 Table 1 9 subheading=Sulfur metabolism; Potential operon (r value)=YPO1317-1319 (r > 0.97); Gene ID=YP…</span></a>
<a class="sourceLine" id="cb8-14" data-line-number="14"><span class="co"># 10 Table 1 10 subheading=Sulfur metabolism; Potential operon (r value)=YPO4109-4111 (r > 0.90); Gene ID=YP…</span></a>
<a class="sourceLine" id="cb8-15" data-line-number="15"><span class="co"># # … with 90 more rows</span></a></code></pre></div>
<p>The other three <code>pmc</code> functions are described in the package <a href="https://github.com/ropensci/tidypmc/blob/master/vignettes/tidypmc.md">vignette</a>.</p>
<h2 id="searching-text">Searching text</h2>
<p>There are a few functions to search within the <code>pmc_text</code> or collapsed <code>pmc_table</code> output. <code>separate_text</code> uses the <a href="https://stringr.tidyverse.org/">stringr</a> package to extract any regular expression or vector of words.</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="kw">separate_text</span>(txt, <span class="st">"[ATCGN]{5,}"</span>)</a>
<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="co"># # A tibble: 9 x 5</span></a>
<a class="sourceLine" id="cb9-3" data-line-number="3"><span class="co"># match section paragraph sentence text </span></a>
<a class="sourceLine" id="cb9-4" data-line-number="4"><span class="co"># <chr> <chr> <int> <int> <chr> </span></a>
<a class="sourceLine" id="cb9-5" data-line-number="5"><span class="co"># 1 ACGCAATCGTT… Results and Discussion; Comput… 2 3 A 16 basepair (bp) box (5'-ACGCAATCGTTTTCNT…</span></a>
<a class="sourceLine" id="cb9-6" data-line-number="6"><span class="co"># 2 AAACGTTTNCGT Results and Discussion; Comput… 2 4 It is very similar to the E. coli PurR box …</span></a>
<a class="sourceLine" id="cb9-7" data-line-number="7"><span class="co"># 3 TGATAATGATT… Results and Discussion; Comput… 2 5 A 21 bp box (5'-TGATAATGATTATCATTATCA-3') w…</span></a>
<a class="sourceLine" id="cb9-8" data-line-number="8"><span class="co"># 4 GATAATGATAA… Results and Discussion; Comput… 2 6 It is a 10-1-10 inverted repeat that resemb…</span></a>
<a class="sourceLine" id="cb9-9" data-line-number="9"><span class="co"># 5 TGANNNNNNTC… Results and Discussion; Comput… 2 7 A 15 bp box (5'-TGANNNNNNTCAA-3') was found…</span></a>
<a class="sourceLine" id="cb9-10" data-line-number="10"><span class="co"># 6 TTGATN Results and Discussion; Comput… 2 8 It is a part of the E. coli Fnr box (5'-AAW…</span></a>
<a class="sourceLine" id="cb9-11" data-line-number="11"><span class="co"># 7 NATCAA Results and Discussion; Comput… 2 8 It is a part of the E. coli Fnr box (5'-AAW…</span></a>
<a class="sourceLine" id="cb9-12" data-line-number="12"><span class="co"># 8 GTTAATTAA Results and Discussion; Comput… 3 4 The ArcA regulator can recognize a relative…</span></a>
<a class="sourceLine" id="cb9-13" data-line-number="13"><span class="co"># 9 GTTAATTAATGT Results and Discussion; Comput… 3 5 An ArcA-box-like sequence (5'-GTTAATTAATGT-…</span></a></code></pre></div>
<p>A few wrappers search pre-defined patterns and add an extra step to expand matched ranges. <code>separate_refs</code> matches references within brackets using <code>\\[[0-9, -]+\\]</code> and expands ranges like <code>[7-9]</code>.</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="kw">separate_refs</span>(txt)</a>
<a class="sourceLine" id="cb10-2" data-line-number="2"><span class="co"># # A tibble: 93 x 6</span></a>
<a class="sourceLine" id="cb10-3" data-line-number="3"><span class="co"># id match section paragraph sentence text </span></a>
<a class="sourceLine" id="cb10-4" data-line-number="4"><span class="co"># <dbl> <chr> <chr> <int> <int> <chr> </span></a>
<a class="sourceLine" id="cb10-5" data-line-number="5"><span class="co"># 1 1 [1] Backgrou… 1 1 Yersinia pestis is the etiological agent of plague, alternatively…</span></a>
<a class="sourceLine" id="cb10-6" data-line-number="6"><span class="co"># 2 2 [2] Backgrou… 1 3 To produce a transmissible infection, Y. pestis colonizes the fle…</span></a>
<a class="sourceLine" id="cb10-7" data-line-number="7"><span class="co"># 3 3 [3] Backgrou… 1 9 However, a few bacilli are taken up by tissue macrophages, provid…</span></a>
<a class="sourceLine" id="cb10-8" data-line-number="8"><span class="co"># 4 4 [4,5] Backgrou… 1 10 Residence in this niche also facilitates the bacteria's resistanc…</span></a>
<a class="sourceLine" id="cb10-9" data-line-number="9"><span class="co"># 5 5 [4,5] Backgrou… 1 10 Residence in this niche also facilitates the bacteria's resistanc…</span></a>
<a class="sourceLine" id="cb10-10" data-line-number="10"><span class="co"># 6 6 [6] Backgrou… 2 1 A DNA microarray is able to determine simultaneous changes in all…</span></a>
<a class="sourceLine" id="cb10-11" data-line-number="11"><span class="co"># 7 7 [7-9] Backgrou… 2 2 We and others have measured the gene expression profiles of Y. pe…</span></a>
<a class="sourceLine" id="cb10-12" data-line-number="12"><span class="co"># 8 8 [7-9] Backgrou… 2 2 We and others have measured the gene expression profiles of Y. pe…</span></a>
<a class="sourceLine" id="cb10-13" data-line-number="13"><span class="co"># 9 9 [7-9] Backgrou… 2 2 We and others have measured the gene expression profiles of Y. pe…</span></a>
<a class="sourceLine" id="cb10-14" data-line-number="14"><span class="co"># 10 10 [10] Backgrou… 2 2 We and others have measured the gene expression profiles of Y. pe…</span></a>
<a class="sourceLine" id="cb10-15" data-line-number="15"><span class="co"># # … with 83 more rows</span></a></code></pre></div>
<p><code>separate_genes</code> will find microbial genes like tauD (with a capitalized 4th letter) and expand operons like <code>tauABCD</code> into four genes. <code>separate_tags</code> will find and expand locus tag ranges below.</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="kw">collapse_rows</span>(tbls, <span class="dt">na=</span><span class="st">"-"</span>) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="st"> </span><span class="kw">separate_tags</span>(<span class="st">"YPO"</span>) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb11-3" data-line-number="3"><span class="st"> </span><span class="kw">filter</span>(id <span class="op">==</span><span class="st"> "YPO1855"</span>)</a>
<a class="sourceLine" id="cb11-4" data-line-number="4"><span class="co"># # A tibble: 3 x 5</span></a>
<a class="sourceLine" id="cb11-5" data-line-number="5"><span class="co"># id match table row text </span></a>
<a class="sourceLine" id="cb11-6" data-line-number="6"><span class="co"># <chr> <chr> <chr> <int> <chr> </span></a>
<a class="sourceLine" id="cb11-7" data-line-number="7"><span class="co"># 1 YPO1855 YPO1854-1856 Table… 5 subheading=Iron uptake or heme synthesis; Potential operon (r value)=YPO1…</span></a>
<a class="sourceLine" id="cb11-8" data-line-number="8"><span class="co"># 2 YPO1855 YPO1854-1856 Table… 21 subheading=Category C: Hypothetical; Gene ID=YPO1854-1856; Description=Pu…</span></a>
<a class="sourceLine" id="cb11-9" data-line-number="9"><span class="co"># 3 YPO1855 YPO1854-YPO… Table… 2 Cluster=Cluster II; Genes or operons for motif discovery=hmuRSTUV, YPO068…</span></a></code></pre></div>
<p>See the <a href="https://github.com/ropensci/tidypmc/blob/master/vignettes/tidypmc.md">vignette</a> for more details including code to parse XML documents using the <a href="https://github.com/r-lib/xml2">xml2</a> package. The <a href="https://github.com/ropensci/tidypmc/blob/master/vignettes/pmcftp.md">PMC FTP vignette</a> has details on parsing XML files at the Europe PMC <a href="https://europepmc.org/ftp/oa/">FTP site</a>.</p>
<h3 id="community-guidelines">Community Guidelines</h3>
<p>This project is released with a <a href="CONDUCT.md">Contributor Code of Conduct</a>. By participating in this project you agree to abide by its terms. Feedback, bug reports, and feature requests are welcome <a href="https://github.com/ropensci/tidypmc/issues">here</a>.</p>
</body>
</html>