Loading...
Searching...
No Matches
timsbindec.h
Go to the documentation of this file.
/**
* \file pappsomspp/vendors/tims/timsbindec.h
* \date 23/08/2019
* \author Olivier Langella
* \brief binary file handler of Bruker's TimsTof raw data
*/
/*******************************************************************************
* Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include <QFile>
#include <QFileInfo>
#include "timsframerecord.h"
#include "timsframe.h"
#include "timsframerawdatachunck.h"
#include <vector>
namespace pappso
{
/**
* @todo write docs
*/
class TimsBinDec
{
public:
/**
* Default constructor
*/
TimsBinDec(const QFileInfo &timsBinFile, int timsCompressionType);
/**
* Copy constructor
*
* @param other TODO
*/
TimsBinDec(const TimsBinDec &other);
/**
* Destructor
*/
virtual ~TimsBinDec();
// TimsFrameCstSPtr getTimsFrameCstSPtr(std::size_t timsId);
TimsFrameSPtr getTimsFrameSPtrByOffset(
std::size_t frameId,
const std::vector<pappso::TimsFrameRecord> &frame_record_list);
/** @brief close file access and flush cache
*/
void closeLinearRead();
private:
/** @brief open one QFile handler for linear read
*/
QFile *
getQfileLinear(std::size_t frameId,
const std::vector<pappso::TimsFrameRecord> &frame_record_list);
/** @brief open one QFile handler for random read
*/
QFile *getQfileRandom();
/** @brief populate a fifo buffer with TimsFrameRawDataChunck
* accelerates inputs from file
*/
void startLinearRead(
std::size_t start_frame_id,
std::size_t chunk_deque_size,
const std::vector<pappso::TimsFrameRecord> &frame_record_list);
TimsFrameSPtr
getTimsFrameFromRawDataChunck(const TimsFrameRawDataChunck &raw_data_chunck);
void moveLinearReadForward(
const std::vector<pappso::TimsFrameRecord> &frame_record_list);
private:
int m_timsCompressionType;
QString m_timsBinFile;
QFile *mp_fileLinear = nullptr;
QFile *mp_fileRandom = nullptr;
// QMutex m_mutex;
// std::vector<quint64> m_indexArray;
char *mpa_decompressMemoryBuffer = nullptr;
std::size_t m_decompressMemoryBufferSize = 0;
TimsFrameRawDataChunck m_randemAccessFrameRawDataChunck;
std::vector<TimsFrameRawDataChunck> m_linearAccessRawDataChunckList;
std::size_t m_firstFrameId = 0;
std::size_t m_lastFrameId = 0;
std::size_t m_linearAccessRawDataChunckDequeSize = 100;
std::size_t m_linearForwardThreshold = 30;
};
} // namespace pappso
pappso::TimsBinDec::mp_fileRandom
QFile * mp_fileRandom
Definition timsbindec.h:103
pappso::TimsBinDec::m_firstFrameId
std::size_t m_firstFrameId
Definition timsbindec.h:113
pappso::TimsBinDec::m_decompressMemoryBufferSize
std::size_t m_decompressMemoryBufferSize
Definition timsbindec.h:107
pappso::TimsBinDec::getTimsFrameSPtrByOffset
TimsFrameSPtr getTimsFrameSPtrByOffset(std::size_t frameId, const std::vector< pappso::TimsFrameRecord > &frame_record_list)
Definition timsbindec.cpp:139
pappso::TimsBinDec::startLinearRead
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
Definition timsbindec.cpp:338
pappso::TimsBinDec::getQfileRandom
QFile * getQfileRandom()
open one QFile handler for random read
Definition timsbindec.cpp:124
pappso::TimsBinDec::m_linearForwardThreshold
std::size_t m_linearForwardThreshold
Definition timsbindec.h:116
pappso::TimsBinDec::closeLinearRead
void closeLinearRead()
close file access and flush cache
Definition timsbindec.cpp:88
pappso::TimsBinDec::m_lastFrameId
std::size_t m_lastFrameId
Definition timsbindec.h:114
pappso::TimsBinDec::m_linearAccessRawDataChunckDequeSize
std::size_t m_linearAccessRawDataChunckDequeSize
Definition timsbindec.h:115
pappso::TimsBinDec::getQfileLinear
QFile * getQfileLinear(std::size_t frameId, const std::vector< pappso::TimsFrameRecord > &frame_record_list)
open one QFile handler for linear read
Definition timsbindec.cpp:105
pappso::TimsBinDec::mp_fileLinear
QFile * mp_fileLinear
Definition timsbindec.h:102
pappso::TimsBinDec::m_linearAccessRawDataChunckList
std::vector< TimsFrameRawDataChunck > m_linearAccessRawDataChunckList
Definition timsbindec.h:112
pappso::TimsBinDec::m_timsCompressionType
int m_timsCompressionType
Definition timsbindec.h:100
pappso::TimsBinDec::moveLinearReadForward
void moveLinearReadForward(const std::vector< pappso::TimsFrameRecord > &frame_record_list)
Definition timsbindec.cpp:217
pappso::TimsBinDec::TimsBinDec
TimsBinDec(const QFileInfo &timsBinFile, int timsCompressionType)
Definition timsbindec.cpp:40
pappso::TimsBinDec::~TimsBinDec
virtual ~TimsBinDec()
Definition timsbindec.cpp:66
pappso::TimsBinDec::getTimsFrameFromRawDataChunck
TimsFrameSPtr getTimsFrameFromRawDataChunck(const TimsFrameRawDataChunck &raw_data_chunck)
Definition timsbindec.cpp:240
pappso::TimsBinDec::m_timsBinFile
QString m_timsBinFile
Definition timsbindec.h:101
pappso::TimsBinDec::m_randemAccessFrameRawDataChunck
TimsFrameRawDataChunck m_randemAccessFrameRawDataChunck
Definition timsbindec.h:109
pappso::TimsBinDec::mpa_decompressMemoryBuffer
char * mpa_decompressMemoryBuffer
Definition timsbindec.h:106
pappso::TimsFrameRawDataChunck
Definition timsframerawdatachunck.h:41
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::TimsFrameSPtr
std::shared_ptr< TimsFrame > TimsFrameSPtr
Definition timsframe.h:43
timsframe.h
timsframerawdatachunck.h
timsframerecord.h