Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60643879
SequenceMatrixCreator.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, May 1, 16:32
Size
2 KB
Mime Type
text/x-c
Expires
Fri, May 3, 16:32 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17389207
Attached To
R8820 scATAC-seq
SequenceMatrixCreator.hpp
View Options
#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
Log In to Comment