Page MenuHomec4science

SequenceMatrixCreator.hpp
No OneTemporary

File Metadata

Created
Wed, May 1, 16:32

SequenceMatrixCreator.hpp

#ifndef SEQUENCEMATRIXCREATOR_HPP
#define SEQUENCEMATRIXCREATOR_HPP
#include <MatrixCreator.hpp>
#include <seqan/seq_io.h> // seqan::SeqFileIn
#include <string>
#include <Matrix2D.hpp>
class SequenceMatrixCreator : public MatrixCreator
{
public:
/*!
* \brief Constructs an object to build a
* sequence matrix from a partition.
* \param bed_file_path the path to the file containing
* the references.
* \param fasta_file_path the path to the file containing
* the sequences.
* \param from the upstream most relative position
* to consider around the references. It may
* be changed to make sure that the central bin
* is centered on +/- 0.
* \param to the dowmstream most relative position
* to consider around the references. It may
* be changed to make sure that the central bin
* is centered on +/- 0.
*/
SequenceMatrixCreator(const std::string& bed_file_path,
const std::string& fasta_file_path,
int from,
int to) ;
/*!
* \brief Destructor
*/
virtual ~SequenceMatrixCreator() ;
/*!
* \brief Computes the matrix and returns it.
* \return the sequence matrix.
* \throw std::runtime_error if two sequences
* have the same header in the fasta file or
* if a sequence/chromosome name present
* in the bed cannot be found as sequence
* header in the fasta file.
*/
virtual Matrix2D<int> create_matrix() override ;
protected:
/*!
* \brief Opens the fasta file.
* \throw std::runtime_error if the file cannot
* be open.
*/
void open_fasta_file() ;
/*!
* \brief Closes the fasta file.
* \throw std::runtime_error if the file cannot
* be open.
*/
void close_fasta_file() ;
/*!
* \brief Fasta file path.
*/
std::string fasta_path ;
/*!
* \brief An input stream to the
* fasta file.
* Use open_fasta_file() to open the stream
* and close_fasta_file() to close it.
*/
seqan::SeqFileIn fasta_file ;
} ;
#endif // SEQUENCEMATRIXCREATOR_HPP

Event Timeline