SliceSparseMatrix { public List<Triplet> getHorizontalSlice(double mz, int lowerScanBound, int upperScanBound) { int roundedmz = roundMZ(mz); List<Triplet> sliceList = new ArrayList<Triplet>(); for (int i = lowerScanBound; i <= upperScanBound; i++) { Triplet searchTriplet = new Triplet(); searchTriplet.mz = roundedmz; searchTriplet.scanListIndex = i; int index = Collections.binarySearch(sortListAccordingToMzScan, searchTriplet, compareMzScan); if (index >= 0) { Triplet triplet = sortListAccordingToMzScan.get(index); sliceList.add(triplet); } else { searchTriplet.intensity = 0; searchTriplet.removed = 0; sliceList.add(searchTriplet); } } return sliceList; } SliceSparseMatrix(RawDataFile rawFile);  SliceSparseMatrix(RawDataFile rawFile, Predicate<MsScan> msScanPredicate); List<Triplet> getHorizontalSlice(double mz, int lowerScanBound, int upperScanBound); List<Triplet> getHorizontalSlice(int roundedMZ, int lowerScanBound, int upperScanBound); List<VerticalSliceDataPoint> getVerticalSlice(int scanNumber); Triplet findNextMaxIntensity(); List<ContinuousWaveletTransform.DataPoint> getCWTDataPoint(List<Triplet> slice); List<Triplet> removeDataPoints(int roundedmz, int lowerScanBound, int upperScanBound); List<Triplet> restoreDataPoints(int roundedmz, int lowerScanBound, int upperScanBound); int roundMZ(double mz); void setMaxIntensityIndexZero(); int getSizeOfRawDataFile(); float[] getRetentionTimeArray(int lowerScanBound, int upperScanbound); float[] getIntensities(GoodPeakInfo peak); double getRetentionTime(int scanNumber); float getFinishedPercent(Triplet maxIntensityTriplet); double numOfScans(); final List<Integer> mzValues; }
@Test public void getHorizontalSlice() throws MSDKException, IOException { List<Triplet> slice = objSliceSparseMatrix.getHorizontalSlice(181.0596, 50, 77); Assert.assertEquals(28, slice.size()); }