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

This iterator performs a simple SNP call from the MAF blocks, and outputs the results in the Variant Call Format (VCF). More...

#include <Bpp/Seq/Io/Maf/VcfOutputMafIterator.h>

+ Inheritance diagram for bpp::VcfOutputMafIterator:
+ Collaboration diagram for bpp::VcfOutputMafIterator:

Public Member Functions

 VcfOutputMafIterator (MafIterator *iterator, std::ostream *out, const std::string &reference, const std::vector< std::string > &genotypes, bool outputAll=false, bool generateDiploids=false)
 Build a new VcfOutputMafIterator object. More...
 
 VcfOutputMafIterator (MafIterator *iterator, std::ostream *out, const std::string &reference, const std::vector< std::vector< std::string > > &genotypes, bool outputAll=false)
 Build a new VcfOutputMafIterator object. More...
 
MafBlockanalyseCurrentBlock_ ()
 
void setLogStream (std::shared_ptr< OutputStream > logstream)
 
void addIterationListener (IterationListener *listener)
 
MafBlocknextBlock ()
 Get the next available alignment block. More...
 
bool isVerbose () const
 
void setVerbose (bool yn)
 

Protected Member Functions

virtual void fireIterationStartSignal_ ()
 
virtual void fireIterationMoveSignal_ (const MafBlock &currentBlock)
 
virtual void fireIterationStopSignal_ ()
 

Protected Attributes

MafIteratoriterator_
 
MafBlockcurrentBlock_
 
std::shared_ptr< OutputStreamlogstream_
 
std::vector< IterationListener * > iterationListeners_
 
bool started_
 
bool verbose_
 

Private Member Functions

 VcfOutputMafIterator (const VcfOutputMafIterator &iterator)
 
VcfOutputMafIteratoroperator= (const VcfOutputMafIterator &iterator)
 
void writeHeader_ (std::ostream &out) const
 
void writeBlock_ (std::ostream &out, const MafBlock &block) const
 

Private Attributes

std::ostream * output_
 
std::string refSpecies_
 
std::vector< std::vector< std::string > > genotypes_
 
bool outputAll_
 
bool generateDiploids_
 

Detailed Description

This iterator performs a simple SNP call from the MAF blocks, and outputs the results in the Variant Call Format (VCF).

Only substitutions are supported for now.

Definition at line 57 of file VcfOutputMafIterator.h.

Constructor & Destructor Documentation

◆ VcfOutputMafIterator() [1/3]

bpp::VcfOutputMafIterator::VcfOutputMafIterator ( MafIterator iterator,
std::ostream *  out,
const std::string &  reference,
const std::vector< std::string > &  genotypes,
bool  outputAll = false,
bool  generateDiploids = false 
)
inline

Build a new VcfOutputMafIterator object.

Parameters
iteratorThe input iterator.
outThe output stream where to write the VCF file.
referenceThe species to use as a reference.
genotypesA list of species for which genotype information should be written in the VCF file. There will be one extra column per genotype, +1 format column.
outputAllIf true, also output non-variable positions.
generateDiploidsIf true, output artificial "homozygous" diploids.

Definition at line 78 of file VcfOutputMafIterator.h.

References genotypes_, output_, and writeHeader_().

◆ VcfOutputMafIterator() [2/3]

bpp::VcfOutputMafIterator::VcfOutputMafIterator ( MafIterator iterator,
std::ostream *  out,
const std::string &  reference,
const std::vector< std::vector< std::string > > &  genotypes,
bool  outputAll = false 
)
inline

Build a new VcfOutputMafIterator object.

Parameters
iteratorThe input iterator.
outThe output stream where to write the VCF file.
referenceThe species to use as a reference.
genotypesA list of species combinations for which genotype information should be written in the VCF file. There will be one extra column per genotype, +1 format column. When more than one sequence is specified in a combination, a (phased) polyploid genotype will be created.
outputAllIf true, also output non-variable positions.

Definition at line 99 of file VcfOutputMafIterator.h.

References output_, and writeHeader_().

◆ VcfOutputMafIterator() [3/3]

bpp::VcfOutputMafIterator::VcfOutputMafIterator ( const VcfOutputMafIterator iterator)
inlineprivate

Definition at line 107 of file VcfOutputMafIterator.h.

Member Function Documentation

◆ addIterationListener()

void bpp::AbstractMafIterator::addIterationListener ( IterationListener listener)
inlinevirtualinherited

Implements bpp::MafIterator.

Definition at line 99 of file MafIterator.h.

References bpp::AbstractMafIterator::iterationListeners_.

◆ analyseCurrentBlock_()

MafBlock* bpp::VcfOutputMafIterator::analyseCurrentBlock_ ( )
inlinevirtual

◆ fireIterationMoveSignal_()

void AbstractMafIterator::fireIterationMoveSignal_ ( const MafBlock currentBlock)
protectedvirtualinherited

Definition at line 57 of file MafIterator.cpp.

Referenced by bpp::AbstractMafIterator::nextBlock().

◆ fireIterationStartSignal_()

void AbstractMafIterator::fireIterationStartSignal_ ( )
protectedvirtualinherited

Definition at line 51 of file MafIterator.cpp.

Referenced by bpp::AbstractMafIterator::nextBlock().

◆ fireIterationStopSignal_()

void AbstractMafIterator::fireIterationStopSignal_ ( )
protectedvirtualinherited

Definition at line 63 of file MafIterator.cpp.

Referenced by bpp::AbstractMafIterator::nextBlock().

◆ isVerbose()

bool bpp::AbstractMafIterator::isVerbose ( ) const
inlinevirtualinherited

Implements bpp::MafIterator.

Definition at line 116 of file MafIterator.h.

References bpp::AbstractMafIterator::verbose_.

◆ nextBlock()

MafBlock* bpp::AbstractMafIterator::nextBlock ( )
inlinevirtualinherited

Get the next available alignment block.

Returns
A maf alignment block, or a null pointer if no more block is available.

Implements bpp::MafIterator.

Definition at line 103 of file MafIterator.h.

References bpp::AbstractMafIterator::analyseCurrentBlock_(), bpp::AbstractMafIterator::fireIterationMoveSignal_(), bpp::AbstractMafIterator::fireIterationStartSignal_(), bpp::AbstractMafIterator::fireIterationStopSignal_(), and bpp::AbstractMafIterator::started_.

◆ operator=()

VcfOutputMafIterator& bpp::VcfOutputMafIterator::operator= ( const VcfOutputMafIterator iterator)
inlineprivate

Definition at line 116 of file VcfOutputMafIterator.h.

References generateDiploids_, genotypes_, output_, outputAll_, and refSpecies_.

◆ setLogStream()

void bpp::AbstractFilterMafIterator::setLogStream ( std::shared_ptr< OutputStream logstream)
inlineinherited

Definition at line 178 of file MafIterator.h.

References bpp::AbstractFilterMafIterator::logstream_.

◆ setVerbose()

void bpp::AbstractMafIterator::setVerbose ( bool  yn)
inlinevirtualinherited

Implements bpp::MafIterator.

Definition at line 117 of file MafIterator.h.

References bpp::AbstractMafIterator::verbose_.

◆ writeBlock_()

◆ writeHeader_()

void VcfOutputMafIterator::writeHeader_ ( std::ostream &  out) const
private

Definition at line 58 of file VcfOutputMafIterator.cpp.

Referenced by VcfOutputMafIterator().

Member Data Documentation

◆ currentBlock_

◆ generateDiploids_

bool bpp::VcfOutputMafIterator::generateDiploids_
private

Definition at line 65 of file VcfOutputMafIterator.h.

Referenced by operator=().

◆ genotypes_

std::vector<std::vector<std::string> > bpp::VcfOutputMafIterator::genotypes_
private

Definition at line 63 of file VcfOutputMafIterator.h.

Referenced by operator=(), and VcfOutputMafIterator().

◆ iterationListeners_

std::vector<IterationListener*> bpp::AbstractMafIterator::iterationListeners_
protectedinherited

Definition at line 89 of file MafIterator.h.

Referenced by bpp::AbstractMafIterator::addIterationListener().

◆ iterator_

◆ logstream_

◆ output_

std::ostream* bpp::VcfOutputMafIterator::output_
private

Definition at line 61 of file VcfOutputMafIterator.h.

Referenced by analyseCurrentBlock_(), operator=(), and VcfOutputMafIterator().

◆ outputAll_

bool bpp::VcfOutputMafIterator::outputAll_
private

Definition at line 64 of file VcfOutputMafIterator.h.

Referenced by operator=().

◆ refSpecies_

std::string bpp::VcfOutputMafIterator::refSpecies_
private

Definition at line 62 of file VcfOutputMafIterator.h.

Referenced by operator=().

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

Referenced by bpp::AbstractMafIterator::nextBlock().

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

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