ProteoWizard
Public Member Functions | Private Member Functions | Private Attributes | List of all members
pwiz::analysis::DemuxDebugWriter Class Reference

A class for writing demux matrices to file. More...

#include <DemuxDebugWriter.hpp>

Public Member Functions

 DemuxDebugWriter (const std::string &fileName)
 Constructs a DemuxDebugWriter to write the debug file with the given filename.
 
 ~DemuxDebugWriter ()
 Destructor writes header and closes the file.
 
bool IsOpen () const
 Should be called after construction to verify that the file was opened successfully.
 
void WriteDeconvBlock (uint64_t spectrumIndex, DemuxTypes::MatrixPtr masks, DemuxTypes::MatrixPtr solution, DemuxTypes::MatrixPtr signal)
 Writes a set of matrices with the given spectrum index to file.
 

Private Member Functions

void WriteHeader ()
 Writes the the header. The header is simply a pointer to the footer (fileIndex).
 
void WriteIndex ()
 Writes the file index at the end of the file.
 

Private Attributes

std::ofstream _writer
 Output file stream.
 
std::vector< std::pair< uint64_t, int64_t > > _fileIndex
 Set of spectrum indices and filepointers to their respective blocks.
 

Detailed Description

A class for writing demux matrices to file.

The primary purpose of writing demux matrices to file is for analysis externally. Exporting matrices is useful for comparing output with Skyline, which has a similar functionality for writing demux matrices to file. Python code exists for reading and interpreting these matrices. This class follows the RAII of ifstream and so the file is kept open until the destructor is called.

Definition at line 37 of file DemuxDebugWriter.hpp.

Constructor & Destructor Documentation

◆ DemuxDebugWriter()

pwiz::analysis::DemuxDebugWriter::DemuxDebugWriter ( const std::string &  fileName)
explicit

Constructs a DemuxDebugWriter to write the debug file with the given filename.

◆ ~DemuxDebugWriter()

pwiz::analysis::DemuxDebugWriter::~DemuxDebugWriter ( )

Destructor writes header and closes the file.

Member Function Documentation

◆ IsOpen()

bool pwiz::analysis::DemuxDebugWriter::IsOpen ( ) const

Should be called after construction to verify that the file was opened successfully.

Referenced by DemuxDebugRWTest::ReadWriteTest().

◆ WriteDeconvBlock()

void pwiz::analysis::DemuxDebugWriter::WriteDeconvBlock ( uint64_t  spectrumIndex,
DemuxTypes::MatrixPtr  masks,
DemuxTypes::MatrixPtr  solution,
DemuxTypes::MatrixPtr  signal 
)

Writes a set of matrices with the given spectrum index to file.

Referenced by DemuxDebugRWTest::ReadWriteTest().

◆ WriteHeader()

void pwiz::analysis::DemuxDebugWriter::WriteHeader ( )
private

Writes the the header. The header is simply a pointer to the footer (fileIndex).

◆ WriteIndex()

void pwiz::analysis::DemuxDebugWriter::WriteIndex ( )
private

Writes the file index at the end of the file.

This is the footer pointed to by the header. The footer contains information about the locations of the beginning of each block. Each matrix has it's own header for information about its size. This means that individual matrices must be accessed sequentially.

Member Data Documentation

◆ _writer

std::ofstream pwiz::analysis::DemuxDebugWriter::_writer
private

Output file stream.

Definition at line 67 of file DemuxDebugWriter.hpp.

◆ _fileIndex

std::vector<std::pair<uint64_t, int64_t> > pwiz::analysis::DemuxDebugWriter::_fileIndex
private

Set of spectrum indices and filepointers to their respective blocks.

Definition at line 70 of file DemuxDebugWriter.hpp.


The documentation for this class was generated from the following file: