1515 */
1616package org .labkey .targetedms .parser ;
1717
18- import com .google .protobuf .CodedInputStream ;
1918import org .apache .commons .io .IOUtils ;
2019import org .apache .logging .log4j .Logger ;
2120import org .jetbrains .annotations .NotNull ;
2221import org .labkey .api .exp .api .DataType ;
23- import org .labkey .api .pipeline .PipelineJobException ;
2422import org .labkey .targetedms .parser .proto .ChromatogramGroupDataOuterClass ;
2523import org .labkey .targetedms .parser .skyd .CacheFormat ;
2624import org .labkey .targetedms .parser .skyd .CacheFormatVersion ;
2725import org .labkey .targetedms .parser .skyd .CacheHeaderStruct ;
2826import org .labkey .targetedms .parser .skyd .CachedFileHeaderStruct ;
2927import org .labkey .targetedms .parser .skyd .ChromGroupHeaderInfo ;
30- import org .labkey .targetedms .parser .skyd .ChromPeak ;
3128import org .labkey .targetedms .parser .skyd .ChromTransition ;
3229import org .labkey .targetedms .parser .skyd .StructSerializer ;
3330
3936import java .nio .ByteBuffer ;
4037import java .nio .channels .Channels ;
4138import java .nio .channels .FileChannel ;
42- import java .nio .channels .SeekableByteChannel ;
4339import java .util .EnumSet ;
4440import java .util .List ;
4541import java .util .Objects ;
@@ -64,7 +60,6 @@ public class SkylineBinaryParser
6460 private CacheHeaderStruct _cacheHeaderStruct ;
6561
6662 private ChromGroupHeaderInfo [] _chromatograms ;
67- private float [] _allPeaksRt ;
6863 private byte [] _seqBytes ;
6964 private List <ChromatogramGroupId > _chromatogramGroupIds ;
7065
@@ -122,7 +117,6 @@ public void parse() throws IOException
122117
123118 parseChromatogramGroupIds ();
124119 parseFiles ();
125- parsePeaks ();
126120 _log .debug ("Starting to load chromatogram headers" );
127121 parseChromatograms ();
128122 _log .debug ("Done loading chromatogram headers" );
@@ -202,19 +196,6 @@ private String readStringOfByteLength(InputStream inputStream, int length) throw
202196 return new String (buffer , _cacheFormat .getCharset ());
203197 }
204198
205- private void parsePeaks () throws IOException
206- {
207- _channel .position (_cacheHeaderStruct .getLocationPeaks ());
208- ChromPeak [] chromPeaks = _cacheFormat .chromPeakSerializer ()
209- .readArray (Channels .newInputStream (_channel ), _cacheHeaderStruct .getNumPeaks ());
210- _allPeaksRt = new float [chromPeaks .length ];
211-
212- for (int i = 0 ; i < chromPeaks .length ; i ++)
213- {
214- _allPeaksRt [i ] = chromPeaks [i ].getRetentionTime ();
215- }
216- }
217-
218199 private void parseChromatogramGroupIds () throws IOException
219200 {
220201 if (_cacheFormat .getFormatVersion ().compareTo (CacheFormatVersion .Eighteen ) < 0 )
@@ -253,11 +234,6 @@ private void parseChromatograms() throws IOException
253234 Channels .newInputStream (_channel ), _cacheHeaderStruct .getNumChromatograms ());
254235 }
255236
256- public SeekableByteChannel getChannel ()
257- {
258- return _channel ;
259- }
260-
261237 final int getCacheFileSize ()
262238 {
263239 return _cacheFiles != null ? _cacheFiles .length : 0 ;
@@ -312,19 +288,6 @@ public int matchTransitions(ChromGroupHeaderInfo header, List<? extends GeneralT
312288 return match ;
313289 }
314290
315- public byte [] readChromatogramBytes (ChromGroupHeaderInfo header ) throws DataFormatException , IOException
316- {
317- // Get the compressed bytes
318- ByteBuffer buffer = ByteBuffer .allocate (header .getCompressedSize ());
319- getChannel ().position (header .getLocationPoints ()).read (buffer );
320- buffer .position (0 );
321- byte [] result = new byte [header .getCompressedSize ()];
322- buffer .get (result );
323- // Make sure it uncompresses successfully so that we don't import bad content into the database
324- uncompress (result , header .getUncompressedSize ());
325- return result ;
326- }
327-
328291 public static byte [] uncompressStoredBytes (byte [] bytes , Integer uncompressedSize , int numPoints , int numTransitions ) throws DataFormatException
329292 {
330293 if (uncompressedSize == null || uncompressedSize == -1 )
0 commit comments