Skip to content

Commit

Permalink
Update MzId to use all Doubles instead of Floats
Browse files Browse the repository at this point in the history
  • Loading branch information
chhh committed Dec 4, 2017
1 parent ed5eba1 commit 81f066e
Show file tree
Hide file tree
Showing 8 changed files with 1,918 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
public class FragmentArrayType {

@XmlAttribute(name = "values", required = true)
protected List<Float> values;
protected List<Double> values;
@XmlAttribute(name = "measure_ref", required = true)
protected String measureRef;

Expand All @@ -72,13 +72,13 @@ public class FragmentArrayType {
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Float }
* {@link Double }
*
*
*/
public List<Float> getValues() {
public List<Double> getValues() {
if (values == null) {
values = new ArrayList<Float>(1);
values = new ArrayList<Double>(1);
}
return this.values;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="code" use="required" type="{http://psidev.info/psi/pi/mzIdentML/1.2}chars" />
* &lt;attribute name="mass" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
* &lt;attribute name="mass" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
Expand All @@ -48,7 +48,7 @@ public class ResidueType {
@XmlAttribute(name = "code", required = true)
protected String code;
@XmlAttribute(name = "mass", required = true)
protected float mass;
protected double mass;

/**
* Gets the value of the code property.
Expand Down Expand Up @@ -78,15 +78,15 @@ public void setCode(String value) {
* Gets the value of the mass property.
*
*/
public float getMass() {
public double getMass() {
return mass;
}

/**
* Sets the value of the mass property.
*
*/
public void setMass(float value) {
public void setMass(double value) {
this.mass = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* &lt;element name="cvParam" type="{http://psidev.info/psi/pi/mzIdentML/1.2}CVParamType" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;attribute name="fixedMod" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="massDelta" use="required" type="{http://www.w3.org/2001/XMLSchema}float" />
* &lt;attribute name="massDelta" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
* &lt;attribute name="residues" use="required" type="{http://psidev.info/psi/pi/mzIdentML/1.2}listOfCharsOrAny" />
* &lt;/restriction>
* &lt;/complexContent>
Expand All @@ -65,7 +65,7 @@ public class SearchModificationType {
@XmlAttribute(name = "fixedMod", required = true)
protected boolean fixedMod;
@XmlAttribute(name = "massDelta", required = true)
protected float massDelta;
protected double massDelta;
@XmlAttribute(name = "residues", required = true)
protected List<String> residues;

Expand Down Expand Up @@ -147,15 +147,15 @@ public void setFixedMod(boolean value) {
* Gets the value of the massDelta property.
*
*/
public float getMassDelta() {
public double getMassDelta() {
return massDelta;
}

/**
* Sets the value of the massDelta property.
*
*/
public void setMassDelta(float value) {
public void setMassDelta(double value) {
this.massDelta = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* &lt;attribute name="chargeState" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="experimentalMassToCharge" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
* &lt;attribute name="calculatedMassToCharge" type="{http://www.w3.org/2001/XMLSchema}double" />
* &lt;attribute name="calculatedPI" type="{http://www.w3.org/2001/XMLSchema}float" />
* &lt;attribute name="calculatedPI" type="{http://www.w3.org/2001/XMLSchema}double" />
* &lt;attribute name="peptide_ref" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="rank" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;attribute name="passThreshold" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
Expand Down Expand Up @@ -86,7 +86,7 @@ public class SpectrumIdentificationItemType
@XmlAttribute(name = "calculatedMassToCharge")
protected Double calculatedMassToCharge;
@XmlAttribute(name = "calculatedPI")
protected Float calculatedPI;
protected Double calculatedPI;
@XmlAttribute(name = "peptide_ref", required = true)
protected String peptideRef;
@XmlAttribute(name = "rank", required = true)
Expand Down Expand Up @@ -242,10 +242,10 @@ public void setCalculatedMassToCharge(Double value) {
*
* @return
* possible object is
* {@link Float }
* {@link Double }
*
*/
public Float getCalculatedPI() {
public Double getCalculatedPI() {
return calculatedPI;
}

Expand All @@ -254,10 +254,10 @@ public Float getCalculatedPI() {
*
* @param value
* allowed object is
* {@link Float }
* {@link Double }
*
*/
public void setCalculatedPI(Float value) {
public void setCalculatedPI(Double value) {
this.calculatedPI = value;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2017 Dmitry Avtonomov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@javax.xml.bind.annotation.XmlSchema()
package umich.ms.fileio.filetypes.mzidentml.jaxb.standard;
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
These schemas are much better than pepxml, they actually compile without errors with _xjc_.

# Generated with
Using xjc.exe from Oracle JDK 8.
* `cd BatMass\MSFTBX\MSFileToolbox\src\umich\ms\fileio\filetypes\mzidentml\resources`

* Standard:
`"C:\Programs\Java\oracle-jdk-8\bin\xjc.exe" -b bindings_mzidml_standard.xml -no-header -encoding UTF-8 -extension -p umich.ms.fileio.filetypes.mzidentml.jaxb.standard -d "C:\projects\batmass\MSFTBX\MSFileToolbox\src" mzIdentML1.2.0.xsd`
* Old version: `"D:\tmp\jaxb-ri-2.2.11\jaxb-ri\bin\xjc.bat" -b bindings_mzidml_standard.xml -no-header -extension -p umich.ms.fileio.filetypes.mzidentml.jaxb.standard -d "D:\projects\BatMass\MSFTBX\MSFileToolbox\src" mzIdentML1.2.0.xsd`

`xjc -b bindings_mzidml_standard.xml -no-header -encoding UTF-8 -extension -p umich.ms.fileio.filetypes.mzidentml.jaxb.standard -d "C:\projects\batmass\MSFTBX\MSFileToolbox\src" mzIdentML1.2.0_fixed-double.xsd`

* Primitive (deprecated):
~~`"C:\Programs\Java\oracle-jdk-8\bin\xjc.exe" -b bindings_mzidml_primitive.xml -no-header -encoding UTF-8 -extension -p umich.ms.fileio.filetypes.mzidentml.jaxb.primitive -d "C:\projects\batmass\MSFTBX\MSFileToolbox\src" mzIdentML1.2.0.xsd`~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,25 @@
<jaxb:globalBindings localScoping="toplevel">
<!-- No nonsense like BigDecimal and the likes -->
<jaxb:javaType name="java.lang.Double"
xmlType="xs:decimal"
xmlType="xsd:decimal"
parseMethod="javax.xml.bind.DatatypeConverter.parseDouble"
printMethod="javax.xml.bind.DatatypeConverter.printDouble" />

<jaxb:javaType name="java.lang.Integer"
xmlType="xs:integer"
xmlType="xsd:integer"
parseMethod="javax.xml.bind.DatatypeConverter.parseInt"
printMethod="javax.xml.bind.DatatypeConverter.printInt" />

<!--<jaxb:javaType name="java.lang.Double"-->
<!--xmlType="xsd:float"-->
<!--parseMethod="javax.xml.bind.DatatypeConverter.parseDouble"-->
<!--printMethod="javax.xml.bind.DatatypeConverter.printDouble" />-->

<!--<jaxb:javaType name="java.lang.Double"-->
<!--xmlType="xs:double"-->
<!--parseMethod="javax.xml.bind.DatatypeConverter.parseDouble"-->
<!--printMethod="javax.xml.bind.DatatypeConverter.printDouble" />-->
<!--<jaxb:javaType name="java.lang.Float"-->
<!--xmlType="xs:float"-->
<!--parseMethod="javax.xml.bind.DatatypeConverter.parseFloat"-->
<!--printMethod="javax.xml.bind.DatatypeConverter.printFloat" />-->

<!--<jaxb:javaType name="java.lang.Integer"-->
<!--xmlType="xs:int"-->
<!--parseMethod="javax.xml.bind.DatatypeConverter.parseInt"-->
Expand All @@ -40,7 +42,8 @@

</jaxb:globalBindings>

<jaxb:bindings schemaLocation="mzIdentML1.2.0.xsd" node="/xs:schema">
<!--<jaxb:bindings schemaLocation="mzIdentML1.2.0.xsd" node="/xs:schema">-->
<jaxb:bindings schemaLocation="mzIdentML1.2.0_fixed-double.xsd" node="/xs:schema">

</jaxb:bindings>

Expand Down
Loading

0 comments on commit 81f066e

Please sign in to comment.