Skip to content

Commit

Permalink
Spectrum index is zero-based.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Dec 16, 2021
1 parent 7e26ffc commit 0c9c0b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void writeChromatogram(File file, IChromatogramMSD chromatogram, IProgres
//
SpectrumType spectrum = new SpectrumType();
spectrum.setId("scan=" + scan.getScanNumber());
spectrum.setIndex(BigInteger.valueOf(scan.getScanNumber()));
spectrum.setIndex(BigInteger.valueOf((scan.getScanNumber() - 1)));
spectrum.setScanList(scanList);
spectrum.setBinaryDataArrayList(binaryDataArrayList);
IVendorMassSpectrum massSpectrum = (IVendorMassSpectrum)scanMSD;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2018 Lablicate GmbH.
* Copyright (c) 2015, 2021 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -12,6 +12,7 @@
package org.eclipse.chemclipse.msd.converter.supplier.mzml.internal.v110.model;

import java.math.BigInteger;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
Expand All @@ -32,7 +33,7 @@ public class SpectrumType extends ParamGroupType {
@XmlAttribute(name = "spotID")
private String spotID;
@XmlAttribute(name = "index", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
@XmlSchemaType(name = "nonNegativeInteger") // zero based
private BigInteger index;
@XmlAttribute(name = "defaultArrayLength", required = true)
private int defaultArrayLength;
Expand Down

0 comments on commit 0c9c0b9

Please sign in to comment.