44 if((timsCompressionType != 1) && (timsCompressionType != 2))
47 QObject::tr(
"compression type %1 not handled by this library").arg(timsCompressionType));
51 throw pappso::PappsoException(QObject::tr(
"No TIMS binary file name specified"));
54 if(!file.open(QIODevice::ReadOnly))
56 throw PappsoException(QObject::tr(
"ERROR opening TIMS binary file %1 for read")
57 .arg(timsBinFile.absoluteFilePath()));
106 const std::vector<pappso::TimsFrameRecord> &frame_record_list)
114 QObject::tr(
"ERROR opening TIMS binary file %1 for read").arg(
m_timsBinFile));
132 QObject::tr(
"ERROR opening TIMS binary file %1 for read").arg(
m_timsBinFile));
140 const std::vector<pappso::TimsFrameRecord> &frame_record_list)
143 qDebug() <<
"frameId:" << frameId;
166 if(chunck.getFrameId() == frameId)
179 throw PappsoException(QObject::tr(
"ERROR reading TIMS binary file %1 with linear QFile: "
182 .arg(error.
qwhat()));
189 bool seekpos_ok = p_file->seek(frame_record_list[frameId].tims_offset);
192 throw PappsoException(QObject::tr(
"ERROR reading TIMS frame %1 TIMS binary file %2: "
193 "m_timsBinFile.seek(%3) failed")
196 .arg(frame_record_list[frameId].tims_offset));
207 throw PappsoException(QObject::tr(
"ERROR reading TIMS binary file %1 with random QFile: "
210 .arg(error.
qwhat()));
218 const std::vector<pappso::TimsFrameRecord> &frame_record_list)
227 return a.getFrameId() < b.getFrameId();
249 auto decompressed_size2 = ZSTD_getFrameContentSize(raw_data_chunck.
getMemoryBuffer(),
252 if(decompressed_size2 == ZSTD_CONTENTSIZE_UNKNOWN)
254 throw PappsoException(QObject::tr(
"ERROR TimsBinDec::getTimsFrameFromRawDataChunck "
255 "reading TIMS frame %1 TIMS binary file %2: "
256 " decompressed_size2 == ZSTD_CONTENTSIZE_UNKNOWN, "
263 if(decompressed_size2 == ZSTD_CONTENTSIZE_ERROR)
266 throw PappsoException(QObject::tr(
"ERROR TimsBinDec::getTimsFrameFromRawDataChunck "
267 "reading TIMS frame %1 TIMS binary file %2: "
268 " decompressed_size2 == ZSTD_CONTENTSIZE_ERROR, "
274 qDebug() <<
" decompressed_size2=" << decompressed_size2;
291 if(decompressed_size != decompressed_size2)
293 throw PappsoException(QObject::tr(
"ERROR TimsBinDec::getTimsFrameFromRawDataChunck "
294 "reading TIMS frame %1 TIMS binary file %2: "
295 "decompressed_size != decompressed_size2")
298 .arg(decompressed_size)
299 .arg(decompressed_size2));
304 frame_sptr = std::make_shared<TimsFrame>(raw_data_chunck.
getFrameId(),
314 frame_sptr = std::make_shared<TimsFrameType1>(raw_data_chunck.
getFrameId(),
324 frame_sptr = std::make_shared<TimsFrame>(
339 std::size_t chunk_deque_size,
340 const std::vector<pappso::TimsFrameRecord> &frame_record_list)
348 if(p_file ==
nullptr)
353 bool seekpos_ok = p_file->seek(frame_record_list[start_frame_id].tims_offset);
356 throw PappsoException(QObject::tr(
"ERROR reading TIMS frame %1 TIMS binary file %2: "
357 "m_timsBinFile.seek(%3) failed")
360 .arg(frame_record_list[start_frame_id].tims_offset));
368 chunck.readTimsFrame(p_file, start_frame_id, frame_record_list);
377 QObject::tr(
"ERROR in TimsBinDec::startLinearRead reading TIMS binary file %1:\n "
378 " start_frame_id=%2 m_firstFrameId=%3 m_lastFrameId=%4 "
384 .arg(error.
qwhat()));
virtual const QString & qwhat() const
std::size_t m_firstFrameId
std::size_t m_decompressMemoryBufferSize
TimsFrameSPtr getTimsFrameSPtrByOffset(std::size_t frameId, const std::vector< pappso::TimsFrameRecord > &frame_record_list)
void startLinearRead(std::size_t start_frame_id, std::size_t chunk_deque_size, const std::vector< pappso::TimsFrameRecord > &frame_record_list)
populate a fifo buffer with TimsFrameRawDataChunck accelerates inputs from file
QFile * getQfileRandom()
open one QFile handler for random read
std::size_t m_linearForwardThreshold
void closeLinearRead()
close file access and flush cache
std::size_t m_lastFrameId
std::size_t m_linearAccessRawDataChunckDequeSize
QFile * getQfileLinear(std::size_t frameId, const std::vector< pappso::TimsFrameRecord > &frame_record_list)
open one QFile handler for linear read
std::vector< TimsFrameRawDataChunck > m_linearAccessRawDataChunckList
int m_timsCompressionType
void moveLinearReadForward(const std::vector< pappso::TimsFrameRecord > &frame_record_list)
TimsBinDec(const QFileInfo &timsBinFile, int timsCompressionType)
TimsFrameSPtr getTimsFrameFromRawDataChunck(const TimsFrameRawDataChunck &raw_data_chunck)
TimsFrameRawDataChunck m_randemAccessFrameRawDataChunck
char * mpa_decompressMemoryBuffer
std::size_t getFrameId() const
quint32 getCompressedSize() const
quint32 getFrameNumberOfScans() const
char * getMemoryBuffer() const
quint32 getFrameLength() const
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::shared_ptr< TimsFrame > TimsFrameSPtr