float getHeight() { float maxIntensity = 0f; float intensityBuffer[] = dataPoints.getIntensityBuffer(); for (int i = 0; i < dataPoints.getSize(); i++) { maxIntensity = Math.max(maxIntensity, intensityBuffer[i]); } return maxIntensity; }
void addDataPoint(@Nonnull ChromatographyInfo rt, @Nonnull Double mz, @Nonnull Float intensity) { Preconditions.checkNotNull(rt); dataPoints.add(rt, intensity); mzValues.add(mz); buildingSegmentLength++; }
static void extractDataPoints( uk.ac.ebi.jmzml.model.mzml.Chromatogram jmzChromatogram, ChromatogramDataPointList dataPointList) { dataPointList.clear(); BinaryDataArrayList dataList = jmzChromatogram.getBinaryDataArrayList(); if ((dataList == null) || (dataList.getCount().equals(0))) return; // Obtain the data arrays from spectrum final BinaryDataArray rtArray = dataList.getBinaryDataArray().get(0); final BinaryDataArray intensityArray = dataList.getBinaryDataArray() .get(1); final Number rtValues[] = rtArray.getBinaryDataAsNumberArray(); final Number intensityValues[] = intensityArray .getBinaryDataAsNumberArray(); // Allocate space for the data points dataPointList.allocate(rtValues.length); final ChromatographyInfo rtBuffer[] = dataPointList.getRtBuffer(); final float intensityBuffer[] = dataPointList.getIntensityBuffer(); // Copy the actual data point values for (int i = 0; i < rtValues.length; i++) { final float rt = rtValues[i].floatValue(); final float intensity = intensityValues[i].floatValue(); final ChromatographyInfo chromatographyInfo = MSDKObjectBuilder .getChromatographyInfo1D(SeparationType.UNKNOWN, rt); rtBuffer[i] = chromatographyInfo; intensityBuffer[i] = intensity; } // Commit the changes dataPointList.setSize(rtValues.length); }
rtBuffer = chromatogram.getRetentionTimes(); intensityBuffer = chromatogram.getIntensityValues(intensityBuffer); int numOfDataPoints = chromatogram.getNumberOfDataPoints(); if (chromatogram.getIonAnnotation() != null) { column = featureTable.getColumn(ColumnName.IONANNOTATION, null); List<IonAnnotation> ionAnnotations = (List<IonAnnotation>) row.getData(column); if (ionAnnotations == null) ionAnnotations = new ArrayList<IonAnnotation>(); ionAnnotations.add(chromatogram.getIonAnnotation()); row.setData(column, ionAnnotations); row.setData(column, chromatogram); Double mz = chromatogram.getMz(); column = tableColumns.get(ColumnName.MZ); if (mz != null)
/** {@inheritDoc} */ @Override @Nonnull public Chromatogram clone(@Nonnull DataPointStore newStore) { Preconditions.checkNotNull(newStore); Chromatogram newChromatogram = MSDKObjectBuilder.getChromatogram( newStore, getChromatogramNumber(), getChromatogramType(), getSeparationType()); final ChromatogramDataPointList dataPointList = MSDKObjectBuilder .getChromatogramDataPointList(); getDataPoints(dataPointList); final RawDataFile rawDataFile2 = getRawDataFile(); if (rawDataFile2 != null) { newChromatogram.setRawDataFile(rawDataFile2); } newChromatogram.getIsolations().addAll(getIsolations()); newChromatogram.setDataPoints(dataPointList); return newChromatogram; }
if (chromatogram.getChromatogramType() == ChromatogramType.MRM_SRM) { List<IsolationInfo> isolations = chromatogram.getIsolations(); Double mzQ1 = isolations.get(0).getPrecursorMz(); Double mzQ3 = isolations.get(1).getPrecursorMz();
newRow.setData(column, chromatogram.getIonAnnotation()); double mz = chromatogram.getMz(); column = tableColumns.get(ColumnName.MZ.getName()); newRow.setData(column, mz);
/** * <p>Getter for the field <code>buildingSegmentLength</code>.</p> * * @return a float. */ @SuppressWarnings("null") public float getBuildingSegmentLength() { if (buildingSegmentLength < 2) return 0.0f; ChromatographyInfo rtBuffer[] = dataPoints.getRtBuffer(); ChromatographyInfo firstChromInfo = rtBuffer[dataPoints.getSize() - buildingSegmentLength]; ChromatographyInfo lastChromInfo = rtBuffer[dataPoints.getSize() - 1]; if ((firstChromInfo == null) || (lastChromInfo == null)) throw new MSDKRuntimeException( "Scans do not contain retention times"); float firstRT = firstChromInfo.getRetentionTime(); float lastRT = lastChromInfo.getRetentionTime(); return (lastRT - firstRT); }
ChromatogramDataPointList dataPoints = buildingChromatogram .getDataPoints(); newChromatogram.setDataPoints(dataPoints); newChromatogram.setMz(mz);
if (chromatogram.getChromatogramType() != ChromatogramType.MRM_SRM) { parsed++; continue;
float getLastIntensity() { if (dataPoints.getSize() == 0) throw new MSDKRuntimeException( "Cannot return the last data point of an empty chromatogram"); return dataPoints.getIntensityBuffer()[dataPoints.getSize() - 1]; }