bpp-seq-omics  2.4.1
bpp::Fastq Class Reference

The fastq sequence file format. More...

#include <Bpp/Seq/Io/Fastq.h>

+ Inheritance diagram for bpp::Fastq:
+ Collaboration diagram for bpp::Fastq:

Public Member Functions

 Fastq (bool repName=false)
 Build a new Fastq object. More...
 
virtual ~Fastq ()
 
bool repeatName () const
 
void repeatName (bool yn)
 
The IOSequence interface.
const std::string getFormatName () const
 
const std::string getFormatDescription () const
 
const std::string getDataType () const
 
The ISequenceStream interface.
bool nextSequence (std::istream &input, Sequence &seq) const
 
The OSequenceStream interface.
void writeSequence (std::ostream &output, const Sequence &seq) const
 

Private Attributes

bool repeatName_
 

Detailed Description

The fastq sequence file format.

Author
Sylvain Gaillard

Definition at line 56 of file Fastq.h.

Constructor & Destructor Documentation

◆ Fastq()

bpp::Fastq::Fastq ( bool  repName = false)
inline

Build a new Fastq object.

Parameters
repNameTell if the names in the file is repeated (tested on input) or must be repeated (for output).

Definition at line 70 of file Fastq.h.

◆ ~Fastq()

virtual bpp::Fastq::~Fastq ( )
inlinevirtual

Definition at line 73 of file Fastq.h.

Member Function Documentation

◆ getDataType()

const std::string bpp::Fastq::getDataType ( ) const
inlinevirtual

Implements bpp::IOFormat.

Definition at line 85 of file Fastq.h.

◆ getFormatDescription()

const std::string bpp::Fastq::getFormatDescription ( ) const
inlinevirtual

Implements bpp::IOFormat.

Definition at line 82 of file Fastq.h.

◆ getFormatName()

const std::string bpp::Fastq::getFormatName ( ) const
inlinevirtual

Implements bpp::IOFormat.

Definition at line 81 of file Fastq.h.

◆ nextSequence()

bool Fastq::nextSequence ( std::istream &  input,
Sequence seq 
) const
virtual

Author
Sylvain Gaillard
Usage
// Creating a SequenceWithQuality object
DNA alpha;
SequenceWithQuality seq(&alpha);
// Create a FastQ parser
Fastq fq;
// Opening the file
std::ifstream in("reads.fastq");
// Read the sequences
while (fq.nextSequence(in, seq)) {
// ... do something with the sequence ...
}
// Close the file
in.close();
Fastq(bool repName=false)
Build a new Fastq object.
Definition: Fastq.h:70

Implements bpp::ISequenceStream.

Definition at line 47 of file Fastq.cpp.

References bpp::Sequence::getName(), bpp::TextTools::isEmpty(), repeatName(), bpp::Sequence::setContent(), bpp::Sequence::setName(), and bpp::SequenceWithQuality::setQuality().

◆ repeatName() [1/2]

bool bpp::Fastq::repeatName ( ) const
inline

Definition at line 87 of file Fastq.h.

References repeatName_.

Referenced by nextSequence(), and writeSequence().

◆ repeatName() [2/2]

void bpp::Fastq::repeatName ( bool  yn)
inline

Definition at line 88 of file Fastq.h.

References repeatName_.

◆ writeSequence()

void Fastq::writeSequence ( std::ostream &  output,
const Sequence seq 
) const
virtual

Member Data Documentation

◆ repeatName_

bool bpp::Fastq::repeatName_
private

Definition at line 61 of file Fastq.h.

Referenced by repeatName().


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