-
Notifications
You must be signed in to change notification settings - Fork 1
/
extract_info_v7.xsl
4219 lines (3989 loc) · 218 KB
/
extract_info_v7.xsl
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
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:VRPTx="http://pdbml.pdb.org/schema/pdbx-validation-v4.xsd"
xmlns:ext="http://exslt.org/common" exclude-result-prefixes="ext">
<xsl:include href="url-encode.xsl"/>
<xsl:param name="pdbml_ext_file" required="yes"/>
<xsl:variable name="ext_datablock" select="document($pdbml_ext_file)/VRPTx:datablock"/>
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:variable name="pdb_id"><xsl:value-of select="/wwPDB-validation-information/Entry/@pdbid"/></xsl:variable>
<xsl:variable name="entry_id"><xsl:value-of select="$ext_datablock/VRPTx:entryCategory/VRPTx:entry/@id"/></xsl:variable>
<xsl:variable name="datablock_name"><xsl:value-of select="concat($entry_id,'-validation-alt')"/></xsl:variable>
<!-- experimental method -->
<xsl:variable name="exptl_method"><xsl:value-of select="$ext_datablock/VRPTx:exptlCategory/VRPTx:exptl/@method"/></xsl:variable>
<xsl:variable name="x-ray"><xsl:value-of select="contains($exptl_method,'DIFFRACTION') and not(contains($exptl_method,'NEUTRON'))"/></xsl:variable>
<xsl:variable name="nmr"><xsl:value-of select="contains($exptl_method,'NMR')"/></xsl:variable>
<xsl:variable name="em"><xsl:value-of select="$exptl_method='ELECTRON MICROSCOPY'"/></xsl:variable>
<xsl:variable name="other"><xsl:value-of select="$x-ray='false' and $nmr='false' and $em='false'"/></xsl:variable>
<!-- percentile conditions id -->
<xsl:variable name="last_cond_abs_rna">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@absolute-percentile-RNAsuiteness">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_rel_rna">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@relative-percentile-RNAsuiteness"><xsl:value-of select="$last_cond_abs_rna+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_abs_rna"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_abs_clash">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@absolute-percentile-clashscore"><xsl:value-of select="$last_cond_rel_rna+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_rel_rna"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_rel_clash">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@relative-percentile-clashscore"><xsl:value-of select="$last_cond_abs_clash+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_abs_clash"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_abs_rama">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@absolute-percentile-percent-rama-outliers"><xsl:value-of select="$last_cond_rel_clash+1"/></xsl:when>
<xsl:when test="/wwPDB-validation-information/ModelledEntityInstance[@absolute_rama_percentile and @absolute_rama_percentile!='NotAvailable']"><xsl:value-of select="$last_cond_rel_clash+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_rel_clash"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_rel_rama">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@relative-percentile-percent-rama-outliers"><xsl:value-of select="$last_cond_abs_rama+1"/></xsl:when>
<xsl:when test="/wwPDB-validation-information/ModelledEntityInstance[@relative_rama_percentile and @relative_rama_percentile!='NotAvailable']"><xsl:value-of select="$last_cond_abs_rama+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_abs_rama"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_abs_rota">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@absolute-percentile-percent-rota-outliers"><xsl:value-of select="$last_cond_rel_rama+1"/></xsl:when>
<xsl:when test="/wwPDB-validation-information/ModelledEntityInstance[@absolute_sidechain_percentile and @absolute_sidechain_percentile!='NotAvailable']"><xsl:value-of select="$last_cond_rel_rama+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_rel_rama"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_rel_rota">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@relative-percentile-percent-rota-outliers"><xsl:value-of select="$last_cond_abs_rota+1"/></xsl:when>
<xsl:when test="/wwPDB-validation-information/ModelledEntityInstance[@relative_sidechain_percentile and @relative_sidechain_percentile!='NotAvailable']"><xsl:value-of select="$last_cond_abs_rota+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_abs_rota"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_abs_rfree">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@absolute-percentile-DCC_Rfree"><xsl:value-of select="$last_cond_rel_rota+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_rel_rota"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_rel_rfree">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@relative-percentile-DCC_Rfree"><xsl:value-of select="$last_cond_abs_rfree+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_abs_rfree"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_abs_rsrz">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@absolute-percentile-percent-RSRZ-outliers"><xsl:value-of select="$last_cond_rel_rfree+1"/></xsl:when>
<xsl:when test="/wwPDB-validation-information/ModelledEntityInstance[@absolute_RSRZ_percentile and @absolute_RSRZ_percentile!='NotAvailable']"><xsl:value-of select="$last_cond_rel_rfree+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_rel_rfree"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="last_cond_rel_rsrz">
<xsl:choose>
<xsl:when test="/wwPDB-validation-information/Entry/@relative-percentile-percent-RSRZ-outliers"><xsl:value-of select="$last_cond_abs_rsrz+1"/></xsl:when>
<xsl:when test="/wwPDB-validation-information/ModelledEntityInstance[@relative_RSRZ_percentile and @relative_RSRZ_percentile!='NotAvailable']"><xsl:value-of select="$last_cond_abs_rsrz+1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$last_cond_abs_rsrz"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nmr_models">
<xsl:value-of select="/wwPDB-validation-information/Entry/@nmrclust_number_of_models"/>
</xsl:variable>
<xsl:variable name="count_programs">
<xsl:value-of select="count(/wwPDB-validation-information/programs/program)"/>
</xsl:variable>
<xsl:variable name="count_pdbx_validate_rmsd_angle">
<xsl:value-of select="count($ext_datablock/VRPTx:pdbx_validate_rmsd_angleCategory/VRPTx:pdbx_validate_rmsd_angle)"/>
</xsl:variable>
<xsl:variable name="count_pdbx_validate_rmsd_bond">
<xsl:value-of select="count($ext_datablock/VRPTx:pdbx_validate_rmsd_bondCategory/VRPTx:pdbx_validate_rmsd_bond)"/>
</xsl:variable>
<xsl:variable name="count_pdbx_validate_close_contact">
<xsl:value-of select="count($ext_datablock/VRPTx:pdbx_validate_close_contactCategory/VRPTx:pdbx_validate_close_contact)"/>
</xsl:variable>
<xsl:variable name="count_pdbx_validate_symm_contact">
<xsl:value-of select="count($ext_datablock/VRPTx:pdbx_validate_symm_contactCategory/VRPTx:pdbx_validate_symm_contact)"/>
</xsl:variable>
<xsl:variable name="count_angle_outlier">
<xsl:value-of select="count(/wwPDB-validation-information/ModelledSubgroup/angle-outlier)"/>
</xsl:variable>
<xsl:variable name="count_bond_outlier">
<xsl:value-of select="count(/wwPDB-validation-information/ModelledSubgroup/bond-outlier)"/>
</xsl:variable>
<!-- DCC version -->
<xsl:variable name="dcc_version">
<xsl:value-of select="/wwPDB-validation-information/programs/program[@name='dcc']/@version"/>
</xsl:variable>
<!-- Level 1 -->
<xsl:template match="/">
<xsl:if test="$entry_id!=$pdb_id">
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xsl:value-of select="$pdb_id"/>).
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<VRPTx:datablock datablockName="{$datablock_name}" xsi:schemaLocation="http://pdbml.pdb.org/schema/pdbx-validation-v4.xsd pdbx-validation-v4.xsd">
<VRPTx:entryCategory>
<VRPTx:entry id="{$entry_id}"/>
</VRPTx:entryCategory>
<xsl:apply-templates select="wwPDB-validation-information/*"/>
</VRPTx:datablock>
</xsl:template>
<!-- Level 2 -->
<xsl:template match="Entry">
<xsl:if test="chemical_shift_list">
<xsl:if test="chemical_shift_list/missing_nmrstar_tag">
<VRPTx:pdbx_missing_nmr_star_itemCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_missing_nmr_star_item">
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_missing_nmr_star_itemCategory>
</xsl:if>
<VRPTx:pdbx_nmr_assigned_chem_shift_listCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_nmr_assigned_chem_shift_list">
<xsl:with-param name="id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_assigned_chem_shift_listCategory>
<xsl:if test="chemical_shift_list/random_coil_index">
<VRPTx:pdbx_nmr_chem_shift_annotationCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_nmr_chem_shift_annotation">
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_annotationCategory>
</xsl:if>
<xsl:choose>
<xsl:when test="chemical_shift_list/assignment_completeness_well_defined">
<VRPTx:pdbx_nmr_chem_shift_completenessCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_nmr_chem_shift_completeness_well_defined">
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_completenessCategory>
</xsl:when>
<xsl:otherwise>
<xsl:if test="chemical_shift_list/assignment_completeness_full_length">
<VRPTx:pdbx_nmr_chem_shift_completenessCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_nmr_chem_shift_completeness_full_length">
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_completenessCategory>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="chemical_shift_list/referencing_offset">
<VRPTx:pdbx_nmr_chem_shift_re_offsetCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_nmr_chem_shift_re_offset">
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_re_offsetCategory>
</xsl:if>
<xsl:if test="chemical_shift_list/unmapped_chemical_shift">
<VRPTx:pdbx_nmr_unmapped_chem_shiftCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_nmr_unmapped_chem_shift">
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_unmapped_chem_shiftCategory>
</xsl:if>
<xsl:if test="chemical_shift_list/unparsed_chemical_shift">
<VRPTx:pdbx_nmr_unparsed_chem_shiftCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_nmr_unparsed_chem_shift">
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_unparsed_chem_shiftCategory>
</xsl:if>
<xsl:if test="chemical_shift_list/chemical_shift_outlier">
<VRPTx:pdbx_validate_nmr_chem_shiftCategory>
<xsl:for-each select="chemical_shift_list">
<xsl:call-template name="pdbx_validate_nmr_chem_shift">
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_validate_nmr_chem_shiftCategory>
</xsl:if>
</xsl:if>
<xsl:call-template name="pdbx_percentile_list"/>
<xsl:if test="@absolute-percentile-RNAsuiteness or @relative-percentile-RNAsuiteness or @absolute-percentile-clashscore or @relative-percentile-clashscore or @absolute-percentile-percent-rama-outliers or @relative-percentile-percent-rama-outliers or @absolute-percentile-percent-rota-outliers or @relative-percentile-percent-rota-outliers or @absolute-percentile-DCC_Rfree or @relative-percentile-DCC_Rfree or @absolute-percentile-percent-RSRZ-outliers or @relative-percentile-percent-RSRZ-outliers">
<xsl:call-template name="pdbx_percentile_view"/>
</xsl:if>
<xsl:if test="@absolute-percentile-RNAsuiteness or @relative-percentile-RNAsuiteness or @absolute-percentile-clashscore or @relative-percentile-clashscore or @absolute-percentile-percent-rama-outliers or /wwPDB-validation-information/ModelledEntityInstance/@absolute_rama_percentile or @relative-percentile-percent-rama-outliers or /wwPDB-validation-information/ModelledEntityInstance/@relative_rama_percentile or @absolute-percentile-percent-rota-outliers or /wwPDB-validation-information/ModelledEntityInstance/@absolute_sidechain_percentile or @relative-percentile-percent-rota-outliers or /wwPDB-validation-information/ModelledEntityInstance/@relative_sidechain_percentile or @absolute-percentile-DCC_Rfree or @relative-percentile-DCC_Rfree or @absolute-percentile-percent-RSRZ-outliers or /wwPDB-validation-information/ModelledEntityInstance/@absolute_RSRZ_percentile or @relative-percentile-percent-RSRZ-outliers or /wwPDB-validation-information/ModelledEntityInstance/@absolute_RSRZ_percentile">
<xsl:call-template name="pdbx_percentile_conditions"/>
</xsl:if>
<xsl:if test="(../ModelledEntityInstance/@absolute_RSRZ_percentile and ../ModelledEntityInstance/@absolute_RSRZ_percentile!='NotAvailable') or (../ModelledEntityInstance/@relative_RSRZ_percentile and ../ModelledEntityInstance/@relative_RSRZ_percentile!='NotAvailable') or (../ModelledEntityInstance/@absolute_rama_percentile and ../ModelledEntityInstance/@absolute_rama_percentile!='NotAvailable') or (../ModelledEntityInstance/@relative_rama_percentile and ../ModelledEntityInstance/@relative_rama_percentile!='NotAvailable') or (../ModelledEntityInstance/@absolute_sidechain_percentile and ../ModelledEntityInstance/@absolute_sidechain_percentile!='NotAvailable') or (../ModelledEntityInstance/@relative_sidechain_percentile and ../ModelledEntityInstance/@relative_sidechain_percentile!='NotAvailable')">
<VRPTx:pdbx_percentile_entity_viewCategory>
<xsl:for-each select="../ModelledEntityInstance">
<xsl:call-template name="pdbx_percentile_entity_view"/>
</xsl:for-each>
</VRPTx:pdbx_percentile_entity_viewCategory>
</xsl:if>
<xsl:call-template name="pdbx_dcc_density"/>
<xsl:call-template name="pdbx_dcc_density_corr"/>
<xsl:call-template name="pdbx_dcc_geometry"/>
<xsl:if test="../ModelledEntityInstance/@angles_rmsz or ../ModelledEntityInstance/@bonds_rmsz">
<VRPTx:pdbx_dcc_entity_geometryCategory>
<xsl:for-each select="../ModelledEntityInstance">
<xsl:call-template name="pdbx_dcc_entity_geometry"/>
</xsl:for-each>
</VRPTx:pdbx_dcc_entity_geometryCategory>
</xsl:if>
<xsl:call-template name="pdbx_dcc_map_overall"/>
<!-- EM validation: Entry, ModelledEntityInstance -->
<xsl:if test="$em='true'">
<xsl:if test="@emdb_id">
<VRPTx:em_adminCategory>
<VRPTx:em_admin>
<xsl:attribute name="entry_id"><xsl:value-of select="@emdb_id"/></xsl:attribute>
<xsl:if test="@EMDB-deposition-date and @EMDB-deposition-date!='unknown'">
<xsl:element name="VRPTx:deposition_date"><xsl:value-of select="@EMDB-deposition-date"/></xsl:element>
</xsl:if>
</VRPTx:em_admin>
</VRPTx:em_adminCategory>
</xsl:if>
<xsl:if test="../ModelledEntityInstance/@average_residue_inclusion">
<VRPTx:pdbx_em_validate_map_model_entityCategory>
<xsl:for-each select="../ModelledEntityInstance">
<xsl:call-template name="pdbx_em_validate_map_model_entity"/>
</xsl:for-each>
</VRPTx:pdbx_em_validate_map_model_entityCategory>
</xsl:if>
<xsl:call-template name="pdbx_em_validate_map_model_overall"/>
</xsl:if>
<xsl:if test="../ModelledSubgroup/@rsr or ../ModelledSubgroup/@rsrz or ../ModelledSubgroup/@rscc">
<VRPTx:pdbx_dcc_mapCategory>
<xsl:for-each select="../ModelledSubgroup">
<xsl:call-template name="pdbx_dcc_map"/>
</xsl:for-each>
</VRPTx:pdbx_dcc_mapCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/@mogul_angles_rmsz or ../ModelledSubgroup/@mogul_bonds_rmsz">
<VRPTx:pdbx_dcc_mon_geometryCategory>
<xsl:for-each select="../ModelledSubgroup">
<xsl:call-template name="pdbx_dcc_mon_geometry"/>
</xsl:for-each>
</VRPTx:pdbx_dcc_mon_geometryCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/@phi or ../ModelledSubgroup/@psi or ../ModelledSubgroup/@rama or ../ModelledSubgroup/@rota">
<VRPTx:struct_mon_protCategory>
<xsl:for-each select="../ModelledSubgroup">
<xsl:call-template name="struct_mon_prot"/>
</xsl:for-each>
</VRPTx:struct_mon_protCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/@RNApucker or ../ModelledSubgroup/@RNAsuite or ../ModelledSubgroup/@RNAscore">
<VRPTx:struct_mon_nuclCategory>
<xsl:for-each select="../ModelledSubgroup">
<xsl:call-template name="struct_mon_nucl"/>
</xsl:for-each>
</VRPTx:struct_mon_nuclCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/angle-outlier or ../ModelledSubgroup/mog-angle-outlier">
<VRPTx:pdbx_validate_rmsd_angleCategory>
<xsl:for-each select="../ModelledSubgroup/angle-outlier">
<xsl:call-template name="append_angle_outlier_to_pdbx_validate_rmsd_angle"/>
</xsl:for-each>
<xsl:for-each select="../ModelledSubgroup/mog-angle-outlier">
<xsl:call-template name="append_mog_angle_outlier_to_pdbx_validate_rmsd_angle"/>
</xsl:for-each>
</VRPTx:pdbx_validate_rmsd_angleCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/bond-outlier or ../ModelledSubgroup/mog-bond-outlier">
<VRPTx:pdbx_validate_rmsd_bondCategory>
<xsl:for-each select="../ModelledSubgroup/bond-outlier">
<xsl:call-template name="append_bond_outlier_to_pdbx_validate_rmsd_bond"/>
</xsl:for-each>
<xsl:for-each select="../ModelledSubgroup/mog-bond-outlier">
<xsl:call-template name="append_mog_bond_outlier_to_pdbx_validate_rmsd_bond"/>
</xsl:for-each>
</VRPTx:pdbx_validate_rmsd_bondCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/clash[not(@cid=../preceding::ModelledSubgroup/clash/@cid) and not(@cid=preceding::clash/@cid)]">
<VRPTx:pdbx_validate_close_contactCategory>
<xsl:for-each select="../ModelledSubgroup/clash[not(@cid=../preceding::ModelledSubgroup/clash/@cid) and not(@cid=preceding::clash/@cid)]">
<xsl:call-template name="append_clash_to_pdbx_validate_close_contact"/>
</xsl:for-each>
</VRPTx:pdbx_validate_close_contactCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/symm-clash">
<VRPTx:pdbx_validate_symm_contactCategory>
<xsl:for-each select="../ModelledSubgroup/symm-clash[not(@scid=../preceding::ModelledSubgroup/symm-clash/@scid) and not(@scid=preceding::symm-clash/@scid)]">
<xsl:call-template name="append_symm_clash_to_pdbx_validate_symm_contact"/>
</xsl:for-each>
</VRPTx:pdbx_validate_symm_contactCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/mog-ring-outlier">
<VRPTx:pdbx_validate_rmsd_ringCategory>
<xsl:for-each select="../ModelledSubgroup/mog-ring-outlier">
<xsl:call-template name="pdbx_validate_rmsd_ring"/>
</xsl:for-each>
</VRPTx:pdbx_validate_rmsd_ringCategory>
<VRPTx:pdbx_validate_rmsd_rings_atomCategory>
<xsl:for-each select="../ModelledSubgroup/mog-ring-outlier">
<xsl:call-template name="pdbx_validate_rmsd_rings_atom"/>
</xsl:for-each>
</VRPTx:pdbx_validate_rmsd_rings_atomCategory>
</xsl:if>
<xsl:if test="../ModelledSubgroup/mog-torsion-outlier">
<VRPTx:pdbx_validate_rmsd_torsionCategory>
<xsl:for-each select="../ModelledSubgroup/mog-torsion-outlier">
<xsl:call-template name="pdbx_validate_rmsd_torsion"/>
</xsl:for-each>
</VRPTx:pdbx_validate_rmsd_torsionCategory>
<VRPTx:pdbx_validate_rmsd_torsions_atomCategory>
<xsl:for-each select="../ModelledSubgroup/mog-torsion-outlier">
<xsl:call-template name="pdbx_validate_rmsd_torsions_atom"/>
</xsl:for-each>
</VRPTx:pdbx_validate_rmsd_torsions_atomCategory>
</xsl:if>
<xsl:if test="$nmr='true'">
<xsl:if test="@nmrclust_version">
<VRPTx:pdbx_struct_nmr_ens_clustCategory>
<VRPTx:pdbx_struct_nmr_ens_clust entry_id="{$entry_id}">
<xsl:if test="@nmrclust_number_of_clusters">
<xsl:element name="VRPTx:clusters_total_number"><xsl:value-of select="@nmrclust_number_of_clusters"/></xsl:element>
</xsl:if>
<xsl:choose>
<xsl:when test="@nmrclust_number_of_models">
<xsl:element name="VRPTx:conformers_total_number"><xsl:value-of select="@nmrclust_number_of_models"/></xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="VRPTx:conformers_total_number"><xsl:value-of select="$ext_datablock/VRPTx:pdbx_nmr_ensembleCategory/VRPTx:pdbx_nmr_ensemble/VRPTx:conformers_submitted_total_number"/></xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="@nmrclust_number_of_outliers">
<xsl:element name="VRPTx:outliers_total_number"><xsl:value-of select="@nmrclust_number_of_outliers"/></xsl:element>
</xsl:if>
<xsl:if test="@nmrclust_error and @nmrclust_error!='success'">
<xsl:element name="VRPTx:error"><xsl:value-of select="@nmrclust_error"/></xsl:element>
</xsl:if>
</VRPTx:pdbx_struct_nmr_ens_clust>
</VRPTx:pdbx_struct_nmr_ens_clustCategory>
<xsl:if test="../Model">
<VRPTx:pdbx_struct_nmr_ens_clust_genCategory>
<xsl:for-each select="../Model">
<xsl:call-template name="pdbx_struct_nmr_ens_clust_gen"/>
</xsl:for-each>
</VRPTx:pdbx_struct_nmr_ens_clust_genCategory>
</xsl:if>
</xsl:if>
<xsl:if test="@cyrange_version">
<xsl:if test="../cyrange_domain">
<VRPTx:pdbx_struct_nmr_ens_domCategory>
<xsl:for-each select="../cyrange_domain">
<xsl:call-template name="pdbx_struct_nmr_ens_dom"/>
</xsl:for-each>
</VRPTx:pdbx_struct_nmr_ens_domCategory>
<VRPTx:pdbx_struct_nmr_ens_dom_limCategory>
<xsl:for-each select="../cyrange_domain">
<xsl:call-template name="pdbx_struct_nmr_ens_dom_lim"/>
</xsl:for-each>
</VRPTx:pdbx_struct_nmr_ens_dom_limCategory>
</xsl:if>
</xsl:if>
</xsl:if>
<!-- EM validation: ModelledSubgroup -->
<xsl:if test="$em='true'">
<xsl:if test="../ModelledSubgroup/@residue_inclusion">
<VRPTx:pdbx_em_validate_map_modelCategory>
<xsl:for-each select="../ModelledSubgroup">
<xsl:call-template name="pdbx_em_validate_map_model"/>
</xsl:for-each>
</VRPTx:pdbx_em_validate_map_modelCategory>
</xsl:if>
</xsl:if>
</xsl:template>
<!--
<xsl:template match="Model">
</xsl:template>
<xsl:template match="cyrange_domain">
</xsl:template>
<xsl:template match="ModelledSubgroup">
</xsl:template>
-->
<!-- EM validation: EM_validation -->
<xsl:template match="EM_validation">
<xsl:apply-templates select="node()"/>
</xsl:template>
<xsl:template match="map_value_distribution">
<VRPTx:pdbx_em_density_distributionCategory>
<VRPTx:pdbx_em_density_distribution id="1">
<VRPTx:map_value_title><xsl:value-of select="@xTitle"/></VRPTx:map_value_title>
<VRPTx:voxel_count_title><xsl:value-of select="@yTitle"/></VRPTx:voxel_count_title>
<xsl:if test="@yScale">
<VRPTx:voxel_count_scale><xsl:value-of select="@yScale"/></VRPTx:voxel_count_scale>
</xsl:if>
</VRPTx:pdbx_em_density_distribution>
</VRPTx:pdbx_em_density_distributionCategory>
<VRPTx:pdbx_em_density_distribution_markerCategory>
<xsl:for-each select="coordinate">
<xsl:sort select="number(@x)" data-type="number"/>
<VRPTx:pdbx_em_density_distribution_marker plot_id="1" ordinal="{position()}">
<VRPTx:map_value><xsl:value-of select="number(@x)"/></VRPTx:map_value>
<VRPTx:voxel_count><xsl:value-of select="number(@y)"/></VRPTx:voxel_count>
</VRPTx:pdbx_em_density_distribution_marker>
</xsl:for-each>
</VRPTx:pdbx_em_density_distribution_markerCategory>
</xsl:template>
<xsl:template match="volume_estimate">
<VRPTx:pdbx_em_volume_estimateCategory>
<VRPTx:pdbx_em_volume_estimate id="1">
<VRPTx:contour_level_title><xsl:value-of select="@xTitle"/></VRPTx:contour_level_title>
<VRPTx:enclosed_volume_title><xsl:value-of select="@yTitle"/></VRPTx:enclosed_volume_title>
<xsl:if test="@yUnit">
<VRPTx:enclosed_volume_unit><xsl:value-of select="@yUnit"/></VRPTx:enclosed_volume_unit>
</xsl:if>
</VRPTx:pdbx_em_volume_estimate>
</VRPTx:pdbx_em_volume_estimateCategory>
<VRPTx:pdbx_em_volume_estimate_markerCategory>
<xsl:for-each select="coordinate">
<xsl:sort select="number(@x)" data-type="number"/>
<VRPTx:pdbx_em_volume_estimate_marker plot_id="1" ordinal="{position()}">
<VRPTx:contour_level><xsl:value-of select="number(@x)"/></VRPTx:contour_level>
<VRPTx:enclosed_volume><xsl:value-of select="format-number(number(@y),'0.##########')"/></VRPTx:enclosed_volume>
</VRPTx:pdbx_em_volume_estimate_marker>
</xsl:for-each>
</VRPTx:pdbx_em_volume_estimate_markerCategory>
</xsl:template>
<xsl:template match="rotationally_averaged_power_spectrum">
<VRPTx:pdbx_em_rapsCategory>
<VRPTx:pdbx_em_raps id="1">
<VRPTx:spatial_frequency_title><xsl:value-of select="@xTitle"/></VRPTx:spatial_frequency_title>
<VRPTx:power_title><xsl:value-of select="@yTitle"/></VRPTx:power_title>
<xsl:if test="@xUnit">
<VRPTx:spatial_frequency_unit><xsl:value-of select="@xUnit"/></VRPTx:spatial_frequency_unit>
</xsl:if>
<xsl:if test="@yScale">
<VRPTx:power_scale><xsl:value-of select="@yScale"/></VRPTx:power_scale>
</xsl:if>
</VRPTx:pdbx_em_raps>
</VRPTx:pdbx_em_rapsCategory>
<VRPTx:pdbx_em_raps_markerCategory>
<xsl:for-each select="coordinate">
<xsl:sort select="number(@x)" data-type="number"/>
<VRPTx:pdbx_em_raps_marker plot_id="1" ordinal="{position()}">
<VRPTx:spatial_frequency><xsl:value-of select="number(@x)"/></VRPTx:spatial_frequency>
<VRPTx:power><xsl:value-of select="format-number(number(@y),'0.##########')"/></VRPTx:power>
</VRPTx:pdbx_em_raps_marker>
</xsl:for-each>
</VRPTx:pdbx_em_raps_markerCategory>
</xsl:template>
<xsl:template match="raw_map_rotationally_averaged_power_spectrum">
<VRPTx:pdbx_em_raw_rapsCategory>
<VRPTx:pdbx_em_raw_raps id="1">
<VRPTx:spatial_frequency_title><xsl:value-of select="@xTitle"/></VRPTx:spatial_frequency_title>
<VRPTx:power_title><xsl:value-of select="@yTitle"/></VRPTx:power_title>
<xsl:if test="@xUnit">
<VRPTx:spatial_frequency_unit><xsl:value-of select="@xUnit"/></VRPTx:spatial_frequency_unit>
</xsl:if>
<xsl:if test="@yScale">
<VRPTx:power_scale><xsl:value-of select="@yScale"/></VRPTx:power_scale>
</xsl:if>
</VRPTx:pdbx_em_raw_raps>
</VRPTx:pdbx_em_raw_rapsCategory>
<VRPTx:pdbx_em_raw_raps_markerCategory>
<xsl:for-each select="coordinate">
<xsl:sort select="number(@x)" data-type="number"/>
<VRPTx:pdbx_em_raw_raps_marker plot_id="1" ordinal="{position()}">
<VRPTx:spatial_frequency><xsl:value-of select="number(@x)"/></VRPTx:spatial_frequency>
<VRPTx:power><xsl:value-of select="format-number(number(@y),'0.##########')"/></VRPTx:power>
</VRPTx:pdbx_em_raw_raps_marker>
</xsl:for-each>
</VRPTx:pdbx_em_raw_raps_markerCategory>
</xsl:template>
<xsl:template match="fsc">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="resolution_intersections">
<xsl:variable name="spatial_frequency_unit"><xsl:value-of select="@spatial_frequency_unit"/></xsl:variable>
<xsl:variable name="resolution_unit"><xsl:value-of select="@resolution_unit"/></xsl:variable>
<VRPTx:pdbx_em_fsc_resolutionCategory>
<xsl:for-each select="intersection">
<VRPTx:pdbx_em_fsc_resolution>
<xsl:variable name="fsc_curve"><xsl:value-of select="@curve"/></xsl:variable>
<xsl:variable name="fsc_cutoff_curve">
<xsl:choose>
<xsl:when test="@type='threesig'"><xsl:value-of select="concat(@curve,'_threesigma')"/></xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(@curve,'_',@type)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="source"><xsl:value-of select="$fsc_curve"/></xsl:attribute>
<xsl:choose>
<xsl:when test="@type='0.143' or @type='0.333' or @type='0.5'"><xsl:attribute name="criterion"><xsl:value-of select="@type"/></xsl:attribute></xsl:when>
<xsl:when test="@type='halfbit'"><xsl:attribute name="criterion">half-bit</xsl:attribute></xsl:when>
<xsl:when test="@type='onebit'"><xsl:attribute name="criterion">one-bit</xsl:attribute></xsl:when>
<xsl:when test="contains(@type,'threesig')"><xsl:attribute name="criterion">3sigma</xsl:attribute></xsl:when>
<xsl:otherwise>
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Criteria for FSC resolution estimation, <xsl:value-of select="@type"/>, is not listed in XSLT code.
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<VRPTx:correlation_coef><xsl:value-of select="@correlation"/></VRPTx:correlation_coef>
<VRPTx:spatial_frequency><xsl:value-of select="@spatial_frequency"/></VRPTx:spatial_frequency>
<VRPTx:resolution><xsl:value-of select="@resolution"/></VRPTx:resolution>
<VRPTx:spatial_frequency_unit><xsl:value-of select="$spatial_frequency_unit"/></VRPTx:spatial_frequency_unit>
<VRPTx:resolution_unit><xsl:value-of select="$resolution_unit"/></VRPTx:resolution_unit>
<VRPTx:fsc_curve_id>
<xsl:for-each select="../../fsc_curves/fsc_curve">
<xsl:if test="@Title=$fsc_curve or @curve_name=$fsc_curve">
<xsl:value-of select="position()"/>
</xsl:if>
</xsl:for-each>
</VRPTx:fsc_curve_id>
<VRPTx:fsc_cutoff_curve_id>
<xsl:for-each select="../../fsc_indicator_curves/fsc_indicator_curve">
<xsl:if test="@Title=$fsc_cutoff_curve or @curve_name=$fsc_cutoff_curve">
<xsl:value-of select="position()"/>
</xsl:if>
</xsl:for-each>
</VRPTx:fsc_cutoff_curve_id>
</VRPTx:pdbx_em_fsc_resolution>
</xsl:for-each>
</VRPTx:pdbx_em_fsc_resolutionCategory>
</xsl:template>
<xsl:template match="fsc_curves">
<VRPTx:pdbx_em_fsc_curveCategory>
<xsl:for-each select="fsc_curve">
<VRPTx:pdbx_em_fsc_curve>
<xsl:attribute name="id"><xsl:value-of select="position()"/></xsl:attribute>
<VRPTx:title><xsl:value-of select="@Title"/></VRPTx:title>
<xsl:if test="@curve_name">
<VRPTx:name><xsl:value-of select="@curve_name"/></VRPTx:name>
</xsl:if>
<xsl:if test="@type">
<VRPTx:type><xsl:value-of select="@type"/></VRPTx:type>
</xsl:if>
<VRPTx:spatial_frequency_title><xsl:value-of select="@xTitle"/></VRPTx:spatial_frequency_title>
<VRPTx:correlation_coef_title><xsl:value-of select="@yTitle"/></VRPTx:correlation_coef_title>
<VRPTx:spatial_frequency_unit><xsl:value-of select="@xUnit"/></VRPTx:spatial_frequency_unit>
</VRPTx:pdbx_em_fsc_curve>
</xsl:for-each>
</VRPTx:pdbx_em_fsc_curveCategory>
<VRPTx:pdbx_em_fsc_curve_markerCategory>
<xsl:for-each select="fsc_curve">
<xsl:variable name="plot_id"><xsl:value-of select="position()"/></xsl:variable>
<xsl:for-each select="coordinate">
<xsl:sort select="number(@x)" data-type="number"/>
<VRPTx:pdbx_em_fsc_curve_marker plot_id="{$plot_id}" ordinal="{position()}">
<VRPTx:spatial_frequency><xsl:value-of select="number(@x)"/></VRPTx:spatial_frequency>
<VRPTx:correlation_coef><xsl:value-of select="format-number(number(@y),'0.##########')"/></VRPTx:correlation_coef>
</VRPTx:pdbx_em_fsc_curve_marker>
</xsl:for-each>
</xsl:for-each>
</VRPTx:pdbx_em_fsc_curve_markerCategory>
</xsl:template>
<xsl:template match="fsc_indicator_curves">
<VRPTx:pdbx_em_fsc_cutoff_curveCategory>
<xsl:for-each select="fsc_indicator_curve">
<VRPTx:pdbx_em_fsc_cutoff_curve>
<xsl:attribute name="id"><xsl:value-of select="position()"/></xsl:attribute>
<xsl:variable name="source">
<xsl:choose>
<xsl:when test="contains(@Title,'calculated_fsc') or @data_curve='calculated_fsc'">calculated_fsc</xsl:when>
<xsl:when test="contains(@Title,'author_provided_fsc') or @data_curve='author_provided_fsc'">author_provided_fsc</xsl:when>
<xsl:otherwise>
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Source for FSC curve, <xsl:value-of select="@Title"/>, is not listed in XSLT code.
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="criterion">
<xsl:choose>
<xsl:when test="contains(@Title,'0.143') or @type='0.143'">0.143</xsl:when>
<xsl:when test="contains(@Title,'0.333') or @type='0.333'">0.333</xsl:when>
<xsl:when test="contains(@Title,'0.5') or @type='0.5'">0.5</xsl:when>
<xsl:when test="contains(@Title,'halfbit') or @type='halfbit'">half-bit</xsl:when>
<xsl:when test="contains(@Title,'onebit') or @type='onebit'">one-bit</xsl:when>
<xsl:when test="contains(@Title,'threesigma') or @type='threesigma'">3sigma</xsl:when>
<xsl:otherwise>
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Criteria for FSC curve, <xsl:value-of select="@Title"/>, is not listed in XSLT code.
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="@data_curve">
<VRPTx:title><xsl:value-of select="@Title"/></VRPTx:title>
<VRPTx:name><xsl:value-of select="@curve_name"/></VRPTx:name>
<VRPTx:type><xsl:value-of select="@type"/></VRPTx:type>
<VRPTx:target_name><xsl:value-of select="@data_curve"/></VRPTx:target_name>
</xsl:when>
<xsl:otherwise>
<VRPTx:title><xsl:value-of select="concat($source,'_',$criterion)"/></VRPTx:title>
</xsl:otherwise>
</xsl:choose>
<VRPTx:spatial_frequency_title><xsl:value-of select="@xTitle"/></VRPTx:spatial_frequency_title>
<VRPTx:correlation_coef_title><xsl:value-of select="@yTitle"/></VRPTx:correlation_coef_title>
<VRPTx:spatial_frequency_unit><xsl:value-of select="@xUnit"/></VRPTx:spatial_frequency_unit>
</VRPTx:pdbx_em_fsc_cutoff_curve>
</xsl:for-each>
</VRPTx:pdbx_em_fsc_cutoff_curveCategory>
<VRPTx:pdbx_em_fsc_cutoff_curve_markerCategory>
<xsl:for-each select="fsc_indicator_curve">
<xsl:variable name="plot_id"><xsl:value-of select="position()"/></xsl:variable>
<xsl:variable name="criterion">
<xsl:choose>
<xsl:when test="contains(@Title,'0.143') or @type='0.143'">0.143</xsl:when>
<xsl:when test="contains(@Title,'0.333') or @type='0.333'">0.333</xsl:when>
<xsl:when test="contains(@Title,'0.5') or @type='0.5'">0.5</xsl:when>
<xsl:when test="contains(@Title,'halfbit') or @type='halfbit'">half-bit</xsl:when>
<xsl:when test="contains(@Title,'onebit') or @type='onebit'">one-bit</xsl:when>
<xsl:when test="contains(@Title,'threesigma') or @type='threesigma'">3sigma</xsl:when>
<xsl:otherwise>
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Criteria for FSC offset curve, <xsl:value-of select="@Title"/>, is not listed in XSLT code.
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$criterion='half-bit' or $criterion='one-bit' or $criterion='3sigma'">
<xsl:for-each select="coordinate">
<xsl:sort select="number(@x)" data-type="number"/>
<VRPTx:pdbx_em_fsc_cutoff_curve_marker plot_id="{$plot_id}" ordinal="{position()}">
<VRPTx:spatial_frequency><xsl:value-of select="number(@x)"/></VRPTx:spatial_frequency>
<VRPTx:correlation_coef><xsl:value-of select="format-number(number(@y),'0.##########')"/></VRPTx:correlation_coef>
</VRPTx:pdbx_em_fsc_cutoff_curve_marker>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<VRPTx:pdbx_em_fsc_cutoff_curve_marker plot_id="{$plot_id}" ordinal="1">
<VRPTx:correlation_coef><xsl:value-of select="$criterion"/></VRPTx:correlation_coef>
</VRPTx:pdbx_em_fsc_cutoff_curve_marker>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</VRPTx:pdbx_em_fsc_cutoff_curve_markerCategory>
</xsl:template>
<xsl:template match="atom_inclusion">
<VRPTx:pdbx_em_atom_inclusionCategory>
<xsl:for-each select="*">
<VRPTx:pdbx_em_atom_inclusion>
<xsl:attribute name="id"><xsl:value-of select="position()"/></xsl:attribute>
<xsl:choose>
<xsl:when test="name()='all_atoms'">
<VRPTx:atom_type>all non-hydrogen atoms</VRPTx:atom_type>
</xsl:when>
<xsl:when test="name()='backbone'">
<VRPTx:atom_type>backbone atoms</VRPTx:atom_type>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Atom type of atom inclusion plot, <xsl:value-of select="name()"/>, is not listed in XSLT code.
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<VRPTx:contour_level_title><xsl:value-of select="@xTitle"/></VRPTx:contour_level_title>
<VRPTx:atom_inclusion_title><xsl:value-of select="@yTitle"/></VRPTx:atom_inclusion_title>
</VRPTx:pdbx_em_atom_inclusion>
</xsl:for-each>
</VRPTx:pdbx_em_atom_inclusionCategory>
<VRPTx:pdbx_em_atom_inclusion_markerCategory>
<xsl:for-each select="*">
<xsl:variable name="plot_id"><xsl:value-of select="position()"/></xsl:variable>
<xsl:for-each select="coordinate">
<xsl:sort select="number(@x)" data-type="number"/>
<VRPTx:pdbx_em_atom_inclusion_marker plot_id="{$plot_id}" ordinal="{position()}">
<VRPTx:contour_level><xsl:value-of select="number(@x)"/></VRPTx:contour_level>
<VRPTx:atom_inclusion><xsl:value-of select="format-number(number(@y),'0.##########')"/></VRPTx:atom_inclusion>
</VRPTx:pdbx_em_atom_inclusion_marker>
</xsl:for-each>
</xsl:for-each>
</VRPTx:pdbx_em_atom_inclusion_markerCategory>
</xsl:template>
<!-- NMR restraint validation: NMR_restraints_analysis -->
<xsl:template match="NMR_restraints_analysis">
<xsl:apply-templates select="node()"/>
</xsl:template>
<xsl:template match="conformationally_restricting_restraints">
<VRPTx:pdbx_nmr_restraint_listCategory>
<xsl:if test="../../distance_restraints_analysis">
<VRPTx:pdbx_nmr_restraint_list id="1" type="distance"/>
<xsl:for-each select="../../distance_restraints_analysis/violated_distance_restraints/violated_distance_restraint[not(preceding-sibling::violated_distance_restraint/@rlist_id=@rlist_id)]/@rlist_id">
<xsl:sort select="."/>
<xsl:variable name="list_id"><xsl:value-of select="."/></xsl:variable>
<xsl:if test="$list_id!='1'">
<VRPTx:pdbx_nmr_restraint_list id="{$list_id}" type="distance"/>
</xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="../../dihedralangle_restraints_analysis">
<VRPTx:pdbx_nmr_restraint_list id="1" type="dihedral_angle"/>
<xsl:for-each select="../../dihedralangle_restraints_analysis/violated_dihedralangle_restraints/violated_dihedralangle_restraint[not(preceding-sibling::violated_dihedralangle_restraint/@rlist_id=@rlist_id)]/@rlist_id">
<xsl:sort select="."/>
<xsl:variable name="list_id"><xsl:value-of select="."/></xsl:variable>
<xsl:if test="$list_id!='1'">
<VRPTx:pdbx_nmr_restraint_list id="{$list_id}" type="dihedral_angle"/>
</xsl:if>
</xsl:for-each>
</xsl:if>
</VRPTx:pdbx_nmr_restraint_listCategory>
<VRPTx:pdbx_nmr_restraint_summaryCategory>
<VRPTx:pdbx_nmr_restraint_summary entry_id="{$entry_id}">
<xsl:for-each select="restraint_summary">
<xsl:choose>
<xsl:when test="@description='Total distance restraints'">
<VRPTx:distance_restraints_total><xsl:value-of select="@value"/></VRPTx:distance_restraints_total>
</xsl:when>
<xsl:when test="@description='Intra-residue (|i-j|=0)'">
<VRPTx:intraresidue_total_count><xsl:value-of select="@value"/></VRPTx:intraresidue_total_count>
</xsl:when>
<xsl:when test="@description='Inter-chain'">
<VRPTx:interchain_total_count><xsl:value-of select="@value"/></VRPTx:interchain_total_count>
</xsl:when>
<xsl:when test="@description='Sequential (|i-j|=1)'">
<VRPTx:sequential_total_count><xsl:value-of select="@value"/></VRPTx:sequential_total_count>
</xsl:when>
<xsl:when test="@description='Medium range (|i-j|>1 and |i-j|<5)'">
<VRPTx:medium_range_total_count><xsl:value-of select="@value"/></VRPTx:medium_range_total_count>
</xsl:when>
<xsl:when test="@description='Long range (|i-j|>=5)' or @description='Long range (|i-j|$\geq$5)'"> <!-- v005 -->
<VRPTx:long_range_total_count><xsl:value-of select="@value"/></VRPTx:long_range_total_count>
</xsl:when>
<xsl:when test="@description='Total dihedral-angle restraints'">
<VRPTx:dihedral_angle_restraints_total><xsl:value-of select="@value"/></VRPTx:dihedral_angle_restraints_total>
</xsl:when>
<xsl:when test="@description='Total hydrogen bond restraints'">
<VRPTx:hydrogen_bond_restraints_total><xsl:value-of select="@value"/></VRPTx:hydrogen_bond_restraints_total>
</xsl:when>
<xsl:when test="@description='Total disulfide bond restraints'">
<VRPTx:disulfide_bond_restraints_total><xsl:value-of select="@value"/></VRPTx:disulfide_bond_restraints_total>
</xsl:when>
<xsl:when test="@description='Number of unmapped restraints'">
<VRPTx:unmapped_restraints_total><xsl:value-of select="@value"/></VRPTx:unmapped_restraints_total>
</xsl:when>
<xsl:when test="@description='Number of restraints per residue'">
<VRPTx:restraints_per_residue><xsl:value-of select="@value"/></VRPTx:restraints_per_residue>
</xsl:when>
<xsl:when test="@description='Number of long range restraints per residue'">
<VRPTx:long_range_restraints_per_residue><xsl:value-of select="@value"/></VRPTx:long_range_restraints_per_residue>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Restraint summary, <xsl:value-of select="@description"/>, is not listed in XSLT code.
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</VRPTx:pdbx_nmr_restraint_summary>
</VRPTx:pdbx_nmr_restraint_summaryCategory>
<xsl:if test="../residual_distance_violations or ../residual_angle_violations">
<VRPTx:pdbx_nmr_restraint_violationCategory>
<xsl:for-each select="../residual_distance_violations/residual_distance_violation">
<VRPTx:pdbx_nmr_restraint_violation type="distance" ordinal="{position()}">
<xsl:choose>
<xsl:when test="@bins='0.1-0.2'">
<VRPTx:limit_bin_max>0.2</VRPTx:limit_bin_max>
<VRPTx:limit_bin_min>0.1</VRPTx:limit_bin_min>
</xsl:when>
<xsl:when test="@bins='0.2-0.5'">
<VRPTx:limit_bin_max>0.5</VRPTx:limit_bin_max>
<VRPTx:limit_bin_min>0.2</VRPTx:limit_bin_min>
</xsl:when>
<xsl:when test="@bins='>0.5'">
<VRPTx:limit_bin_min>0.5</VRPTx:limit_bin_min>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Restraint residual violation bins, <xsl:value-of select="@bins"/>, is not listed in XSLT code.
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<VRPTx:maximum_violation_in_bin><xsl:value-of select="@max_violation"/></VRPTx:maximum_violation_in_bin>
<VRPTx:bin_units>A</VRPTx:bin_units>
<VRPTx:violations_per_model><xsl:value-of select="@violations_per_model"/></VRPTx:violations_per_model>
</VRPTx:pdbx_nmr_restraint_violation>
</xsl:for-each>
<xsl:for-each select="../residual_angle_violations/residual_angle_violation">
<VRPTx:pdbx_nmr_restraint_violation type="dihedral_angle" ordinal="{position()}">
<xsl:choose>
<xsl:when test="@bins='1.0-10.0'">
<VRPTx:limit_bin_max>10.0</VRPTx:limit_bin_max>
<VRPTx:limit_bin_min>1.0</VRPTx:limit_bin_min>
</xsl:when>
<xsl:when test="@bins='10.0-20.0'">
<VRPTx:limit_bin_max>20.0</VRPTx:limit_bin_max>
<VRPTx:limit_bin_min>10.0</VRPTx:limit_bin_min>
</xsl:when>
<xsl:when test="@bins='>20.0'">
<VRPTx:limit_bin_min>20.0</VRPTx:limit_bin_min>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="error_handler">
<xsl:with-param name="terminate">yes</xsl:with-param>
<xsl:with-param name="error_message">
Restraint residual violation bins, <xsl:value-of select="@bins"/>, is not listed in XSLT code.
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<VRPTx:maximum_violation_in_bin><xsl:value-of select="@max_violation"/></VRPTx:maximum_violation_in_bin>
<VRPTx:bin_units>degrees</VRPTx:bin_units>
<VRPTx:violations_per_model><xsl:value-of select="@violations_per_model"/></VRPTx:violations_per_model>
</VRPTx:pdbx_nmr_restraint_violation>
</xsl:for-each>
</VRPTx:pdbx_nmr_restraint_violationCategory>
</xsl:if>
</xsl:template>
<!-- NMR restraint validation: distance_restraints_analysis -->
<xsl:template match="distance_restraints_analysis">
<xsl:apply-templates select="node()"/>
</xsl:template>
<xsl:template match="distance_violations_summary">
<VRPTx:pdbx_nmr_distance_violation_summaryCategory>
<xsl:for-each select="distance_violation_summary">
<VRPTx:pdbx_nmr_distance_violation_summary>
<xsl:choose>
<xsl:when test="@restraint_sub_type"> <!-- v5.01 or later -->
<xsl:choose>
<xsl:when test="@restraint_type='Intra-residue'">
<xsl:attribute name="type">intraresidue</xsl:attribute>
</xsl:when>
<xsl:when test="@restraint_type='Sequential'">
<xsl:attribute name="type">sequential</xsl:attribute>
</xsl:when>