Skip to content

Commit

Permalink
Performance improvement of extract_info.xsl
Browse files Browse the repository at this point in the history
  • Loading branch information
yokochi47 committed Jul 27, 2023
1 parent e83a7af commit 9d93ded
Show file tree
Hide file tree
Showing 83 changed files with 11,960 additions and 7,709 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ File path | Document

## Release notes

- **Jul 25, 2023**: Release v4.4.25
- **Jul 27, 2023**: Release v4.4.25
- Update wwPDB Validation Information Dictionary to 4.375.
- Performance improvement of extract_info.xsl (XSLT 2.0 -> 1.0, though SAXON is required)

- **Jul 24, 2023**: Release v4.4.24
- Update wwPDB Validation Information Dictionary to 4.374.
Expand Down
2 changes: 2 additions & 0 deletions scripts/extract_info_worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ do

gunzip -c $pdbml_ext_file.gz > $pdbml_ext_file || exit 1

#xsltproc -o $info_alt_file --stringparam pdbml_ext_file ../$pdbml_ext_file $EXT_INFO_XSL $info_file 2> $err_file && rm -f $err_file $info_file $pdbml_ext_file || ( rm -f $info_file $info_alt_file $pdbml_ext_file ; cat $err_file ; exit 1 )
java -jar $SAXON -s:$info_file -xsl:$EXT_INFO_XSL -o:$info_alt_file pdbml_ext_file=../$pdbml_ext_file 2> $err_file && rm -f $err_file $info_file $pdbml_ext_file || ( rm -f $info_file $info_alt_file $pdbml_ext_file ; cat $err_file ; exit 1 )

xml_pretty $info_alt_file
Expand Down Expand Up @@ -159,6 +160,7 @@ do

gunzip -c $pdbml_ext_file.gz > $pdbml_ext_file || exit 1

#xsltproc -o $info_alt_file --stringparam pdbml_ext_file ../$pdbml_ext_file $EXT_INFO_XSL $info_file 2> $err_file && rm -f $err_file $info_file $pdbml_ext_file || ( rm -f $info_file $info_alt_file $pdbml_ext_file ; cat $err_file ; exit 1 )
java -jar $SAXON -s:$info_file -xsl:$EXT_INFO_XSL -o:$info_alt_file pdbml_ext_file=../$pdbml_ext_file 2> $err_file && rm -f $err_file $info_file $pdbml_ext_file || ( rm -f $info_file $info_alt_file $pdbml_ext_file ; cat $err_file ; exit 1 )

xml_pretty $info_alt_file
Expand Down
18 changes: 9 additions & 9 deletions stylesheet/append_xsd.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ VRPT PDBML Schema translated from wwPDB Validation Information Dictionary v4.375
<xsl:if test="$name!='datablockType'">
<xsd:complexType name="{$name}">
<xsl:call-template name="category_type">
<xsl:with-param name="category"><xsl:value-of select="$name"/></xsl:with-param>
<xsl:with-param name="category" select="$name"/>
</xsl:call-template>
</xsd:complexType>
</xsl:if>
Expand Down Expand Up @@ -76,16 +76,16 @@ VRPT PDBML Schema translated from wwPDB Validation Information Dictionary v4.375
<xsd:all>
<xsl:for-each select="xsd:complexType[1]/xsd:all[1]/xsd:element">
<xsl:call-template name="data_item">
<xsl:with-param name="category"><xsl:value-of select="$category"/></xsl:with-param>
<xsl:with-param name="item"><xsl:value-of select="@name"/></xsl:with-param>
<xsl:with-param name="category" select="$category"/>
<xsl:with-param name="item" select="@name"/>
</xsl:call-template>
</xsl:for-each>
</xsd:all>
</xsl:if>
<xsl:for-each select="xsd:complexType[1]/xsd:attribute">
<xsl:call-template name="key_item">
<xsl:with-param name="category"><xsl:value-of select="$category"/></xsl:with-param>
<xsl:with-param name="item"><xsl:value-of select="@name"/></xsl:with-param>
<xsl:with-param name="category" select="$category"/>
<xsl:with-param name="item" select="@name"/>
</xsl:call-template>
</xsl:for-each>
</xsd:complexType>
Expand Down Expand Up @@ -123,8 +123,8 @@ VRPT PDBML Schema translated from wwPDB Validation Information Dictionary v4.375
</xsd:annotation>
</xsl:for-each>
<xsl:call-template name="fuse_copy">
<xsl:with-param name="category"><xsl:value-of select="replace($category,'Type$','')"/></xsl:with-param>
<xsl:with-param name="item"><xsl:value-of select="$item"/></xsl:with-param>
<xsl:with-param name="category" select="replace($category,'Type$','')"/>
<xsl:with-param name="item" select="$item"/>
</xsl:call-template>
</xsd:element>
</xsl:template>
Expand All @@ -150,8 +150,8 @@ VRPT PDBML Schema translated from wwPDB Validation Information Dictionary v4.375
</xsd:annotation>
</xsl:for-each>
<xsl:call-template name="fuse_copy">
<xsl:with-param name="category"><xsl:value-of select="replace($category,'Type$','')"/></xsl:with-param>
<xsl:with-param name="item"><xsl:value-of select="$item"/></xsl:with-param>
<xsl:with-param name="category" select="replace($category,'Type$','')"/>
<xsl:with-param name="item" select="$item"/>
</xsl:call-template>
</xsd:attribute>
</xsl:template>
Expand Down
2 changes: 1 addition & 1 deletion stylesheet/extract_info.xsl
22 changes: 11 additions & 11 deletions stylesheet/extract_info_v1.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_missing_nmr_star_itemCategory>
Expand All @@ -199,7 +199,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_assigned_chem_shift_listCategory>
Expand All @@ -208,7 +208,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_annotationCategory>
Expand All @@ -219,7 +219,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_completenessCategory>
Expand All @@ -229,7 +229,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_completenessCategory>
Expand All @@ -241,7 +241,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_re_offsetCategory>
Expand All @@ -251,7 +251,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_unmapped_chem_shiftCategory>
Expand All @@ -261,7 +261,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_unparsed_chem_shiftCategory>
Expand All @@ -271,7 +271,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_validate_nmr_chem_shiftCategory>
Expand Down Expand Up @@ -3325,7 +3325,7 @@ xsd:decimal
<xsl:element name="VRPTx:auth_atom_id_1"><xsl:value-of select="@atom0"/></xsl:element>
<xsl:element name="VRPTx:auth_atom_id_2"><xsl:value-of select="@atom1"/></xsl:element>
<xsl:element name="VRPTx:auth_atom_id_3"><xsl:value-of select="@atom2"/></xsl:element>
<xsl:element name="VRPTx:angle_deviation"><xsl:value-of select="format-number(number(@obs)-number(@mean),'0.00')"/></xsl:element>
<xsl:element name="VRPTx:angle_deviation"><xsl:value-of select="format-number(number(@obs)-number(@mean),'0.000')"/></xsl:element>
<xsl:element name="VRPTx:angle_standard_deviation"><xsl:value-of select="@stdev"/></xsl:element>
<xsl:element name="VRPTx:angle_target_value"><xsl:value-of select="@mean"/></xsl:element>
<xsl:element name="VRPTx:angle_value"><xsl:value-of select="@obs"/></xsl:element>
Expand Down Expand Up @@ -3566,7 +3566,7 @@ Unmatched components exist in atoms, <xsl:value-of select="position()"/>, found
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:element name="VRPTx:angle_deviation"><xsl:value-of select="format-number(number(@obsval)-number(@mean),'0.00')"/></xsl:element>
<xsl:element name="VRPTx:angle_deviation"><xsl:value-of select="format-number(number(@obsval)-number(@mean),'0.000')"/></xsl:element>
<xsl:element name="VRPTx:angle_standard_deviation"><xsl:value-of select="@stdev"/></xsl:element>
<xsl:element name="VRPTx:angle_target_value"><xsl:value-of select="@mean"/></xsl:element>
<xsl:element name="VRPTx:angle_value"><xsl:value-of select="@obsval"/></xsl:element>
Expand Down
22 changes: 11 additions & 11 deletions stylesheet/extract_info_v2.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_missing_nmr_star_itemCategory>
Expand All @@ -195,7 +195,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_assigned_chem_shift_listCategory>
Expand All @@ -204,7 +204,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_annotationCategory>
Expand All @@ -215,7 +215,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_completenessCategory>
Expand All @@ -225,7 +225,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_completenessCategory>
Expand All @@ -237,7 +237,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_chem_shift_re_offsetCategory>
Expand All @@ -247,7 +247,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_unmapped_chem_shiftCategory>
Expand All @@ -257,7 +257,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_nmr_unparsed_chem_shiftCategory>
Expand All @@ -267,7 +267,7 @@ Unmatched entry ID in both documents (<xsl:value-of select="$entry_id"/> and <xs
<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"><xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="list_id" select="position()"/>
</xsl:call-template>
</xsl:for-each>
</VRPTx:pdbx_validate_nmr_chem_shiftCategory>
Expand Down Expand Up @@ -3309,7 +3309,7 @@ xsd:decimal
<xsl:element name="VRPTx:auth_atom_id_1"><xsl:value-of select="@atom0"/></xsl:element>
<xsl:element name="VRPTx:auth_atom_id_2"><xsl:value-of select="@atom1"/></xsl:element>
<xsl:element name="VRPTx:auth_atom_id_3"><xsl:value-of select="@atom2"/></xsl:element>
<xsl:element name="VRPTx:angle_deviation"><xsl:value-of select="format-number(number(@obs)-number(@mean),'0.00')"/></xsl:element>
<xsl:element name="VRPTx:angle_deviation"><xsl:value-of select="format-number(number(@obs)-number(@mean),'0.000')"/></xsl:element>
<xsl:element name="VRPTx:angle_standard_deviation"><xsl:value-of select="@stdev"/></xsl:element>
<xsl:element name="VRPTx:angle_target_value"><xsl:value-of select="@mean"/></xsl:element>
<xsl:element name="VRPTx:angle_value"><xsl:value-of select="@obs"/></xsl:element>
Expand Down Expand Up @@ -3544,7 +3544,7 @@ Unmatched components exist in atoms, <xsl:value-of select="position()"/>, found
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:element name="VRPTx:angle_deviation"><xsl:value-of select="format-number(number(@obsval)-number(@mean),'0.00')"/></xsl:element>
<xsl:element name="VRPTx:angle_deviation"><xsl:value-of select="format-number(number(@obsval)-number(@mean),'0.000')"/></xsl:element>
<xsl:element name="VRPTx:angle_standard_deviation"><xsl:value-of select="@stdev"/></xsl:element>
<xsl:element name="VRPTx:angle_target_value"><xsl:value-of select="@mean"/></xsl:element>
<xsl:element name="VRPTx:angle_value"><xsl:value-of select="@obsval"/></xsl:element>
Expand Down
Loading

0 comments on commit 9d93ded

Please sign in to comment.