bpp-seq-omics
2.4.1
|
This iterator outputs all biallelic SNPs in the PLINK format (ped and map files). More...
#include <Bpp/Seq/Io/Maf/PlinkOutputMafIterator.h>
Public Member Functions | |
PlinkOutputMafIterator (MafIterator *iterator, std::ostream *outPed, std::ostream *outMap, const std::vector< std::string > &species, const std::string &reference, bool map3=false, bool recodeChr=false) | |
Build a new PlinkOutputMafIterator object. More... | |
MafBlock * | analyseCurrentBlock_ () |
void | setLogStream (std::shared_ptr< OutputStream > logstream) |
void | addIterationListener (IterationListener *listener) |
MafBlock * | nextBlock () |
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 ¤tBlock) |
virtual void | fireIterationStopSignal_ () |
Protected Attributes | |
MafIterator * | iterator_ |
MafBlock * | currentBlock_ |
std::shared_ptr< OutputStream > | logstream_ |
std::vector< IterationListener * > | iterationListeners_ |
bool | started_ |
bool | verbose_ |
Private Member Functions | |
PlinkOutputMafIterator (const PlinkOutputMafIterator &iterator) | |
PlinkOutputMafIterator & | operator= (const PlinkOutputMafIterator &iterator) |
void | init_ () |
void | parseBlock_ (std::ostream &out, const MafBlock &block) |
void | writePedToFile_ (std::ostream &out) |
Private Attributes | |
std::ostream * | outputPed_ |
std::ostream * | outputMap_ |
std::vector< std::string > | species_ |
std::string | refSpecies_ |
bool | map3_ |
std::vector< std::string > | ped_ |
std::string | currentChr_ |
size_t | lastPosition_ |
bool | recodeChr_ |
std::map< std::string, unsigned int > | chrCodes_ |
unsigned int | currentCode_ |
This iterator outputs all biallelic SNPs in the PLINK format (ped and map files).
Definition at line 55 of file PlinkOutputMafIterator.h.
|
inline |
Build a new PlinkOutputMafIterator object.
iterator | The input iterator. |
outPed | The output stream where to write the Ped file. |
outMap | The output stream where to write the Map file. |
species | A list of at least two species to compute SNPs. Only blocks containing at least these two species will be used. In case one species is duplicated in a block, the first sequence will be used. |
reference | The species to use as a reference for coordinates. It does not have to be one of the selected species on which SNPs are computed. |
map3 | Tell if genetic distance column should be ommited in the map file. Otherwise set to 0. |
recodeChr | Tell if chromosomes should be recoded to numbers. |
Definition at line 90 of file PlinkOutputMafIterator.h.
References init_().
|
inlineprivate |
Definition at line 105 of file PlinkOutputMafIterator.h.
|
inlinevirtualinherited |
Implements bpp::MafIterator.
Definition at line 99 of file MafIterator.h.
References bpp::AbstractMafIterator::iterationListeners_.
|
inlinevirtual |
Implements bpp::AbstractMafIterator.
Definition at line 138 of file PlinkOutputMafIterator.h.
References bpp::AbstractFilterMafIterator::currentBlock_, bpp::AbstractFilterMafIterator::iterator_, bpp::MafIterator::nextBlock(), outputMap_, outputPed_, parseBlock_(), and writePedToFile_().
|
protectedvirtualinherited |
Definition at line 57 of file MafIterator.cpp.
Referenced by bpp::AbstractMafIterator::nextBlock().
|
protectedvirtualinherited |
Definition at line 51 of file MafIterator.cpp.
Referenced by bpp::AbstractMafIterator::nextBlock().
|
protectedvirtualinherited |
Definition at line 63 of file MafIterator.cpp.
Referenced by bpp::AbstractMafIterator::nextBlock().
|
private |
Definition at line 57 of file PlinkOutputMafIterator.cpp.
References bpp::TextTools::toString().
Referenced by PlinkOutputMafIterator().
|
inlinevirtualinherited |
Implements bpp::MafIterator.
Definition at line 116 of file MafIterator.h.
References bpp::AbstractMafIterator::verbose_.
|
inlinevirtualinherited |
Get the next available alignment block.
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_.
|
inlineprivate |
Definition at line 120 of file PlinkOutputMafIterator.h.
References chrCodes_, currentChr_, currentCode_, lastPosition_, map3_, outputMap_, outputPed_, ped_, recodeChr_, refSpecies_, and species_.
|
private |
Definition at line 64 of file PlinkOutputMafIterator.cpp.
References bpp::VectorSiteContainer::addSequence(), bpp::AlphabetTools::DNA_ALPHABET, bpp::SequenceWithAnnotation::getAlphabet(), bpp::MafSequence::getChromosome(), bpp::MafSequence::getDescription(), bpp::Alphabet::getGapCharacterCode(), bpp::SiteTools::getNumberOfDistinctCharacters(), bpp::VectorSiteContainer::getNumberOfSites(), bpp::MafBlock::getSequenceForSpecies(), bpp::SequenceWalker::getSequencePosition(), bpp::VectorSiteContainer::getSite(), bpp::MafBlock::hasSequenceForSpecies(), bpp::SiteTools::isComplete(), bpp::MafSequence::start(), bpp::MafSequence::stop(), bpp::Site::toString(), and bpp::TextTools::toString().
Referenced by analyseCurrentBlock_().
|
inlineinherited |
Definition at line 178 of file MafIterator.h.
References bpp::AbstractFilterMafIterator::logstream_.
|
inlinevirtualinherited |
Implements bpp::MafIterator.
Definition at line 117 of file MafIterator.h.
References bpp::AbstractMafIterator::verbose_.
|
private |
Definition at line 132 of file PlinkOutputMafIterator.cpp.
Referenced by analyseCurrentBlock_().
|
private |
Definition at line 68 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
protectedinherited |
Definition at line 154 of file MafIterator.h.
Referenced by bpp::BlockLengthMafIterator::analyseCurrentBlock_(), bpp::BlockSizeMafIterator::analyseCurrentBlock_(), bpp::MafIteratorSynchronizer::analyseCurrentBlock_(), bpp::MsmcOutputMafIterator::analyseCurrentBlock_(), bpp::OrderFilterMafIterator::analyseCurrentBlock_(), bpp::OutputMafIterator::analyseCurrentBlock_(), analyseCurrentBlock_(), bpp::SequenceStatisticsMafIterator::analyseCurrentBlock_(), bpp::TableOutputMafIterator::analyseCurrentBlock_(), bpp::VcfOutputMafIterator::analyseCurrentBlock_(), and bpp::AbstractFilterMafIterator::operator=().
|
private |
Definition at line 65 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
private |
Definition at line 69 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
protectedinherited |
Definition at line 89 of file MafIterator.h.
Referenced by bpp::AbstractMafIterator::addIterationListener().
|
protectedinherited |
Definition at line 153 of file MafIterator.h.
Referenced by bpp::BlockLengthMafIterator::analyseCurrentBlock_(), bpp::BlockSizeMafIterator::analyseCurrentBlock_(), bpp::MafIteratorSynchronizer::analyseCurrentBlock_(), bpp::MsmcOutputMafIterator::analyseCurrentBlock_(), bpp::OrderFilterMafIterator::analyseCurrentBlock_(), bpp::OutputMafIterator::analyseCurrentBlock_(), analyseCurrentBlock_(), bpp::SequenceStatisticsMafIterator::analyseCurrentBlock_(), bpp::TableOutputMafIterator::analyseCurrentBlock_(), bpp::VcfOutputMafIterator::analyseCurrentBlock_(), and bpp::AbstractFilterMafIterator::operator=().
|
private |
Definition at line 66 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
protectedinherited |
Definition at line 155 of file MafIterator.h.
Referenced by bpp::BlockLengthMafIterator::analyseCurrentBlock_(), bpp::BlockSizeMafIterator::analyseCurrentBlock_(), bpp::AbstractFilterMafIterator::operator=(), and bpp::AbstractFilterMafIterator::setLogStream().
|
private |
Definition at line 63 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
private |
Definition at line 60 of file PlinkOutputMafIterator.h.
Referenced by analyseCurrentBlock_(), and operator=().
|
private |
Definition at line 59 of file PlinkOutputMafIterator.h.
Referenced by analyseCurrentBlock_(), and operator=().
|
private |
Definition at line 64 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
private |
Definition at line 67 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
private |
Definition at line 62 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
private |
Definition at line 61 of file PlinkOutputMafIterator.h.
Referenced by operator=().
|
protectedinherited |
Definition at line 90 of file MafIterator.h.
Referenced by bpp::AbstractMafIterator::nextBlock().
|
protectedinherited |
Definition at line 91 of file MafIterator.h.
Referenced by bpp::AbstractMafIterator::isVerbose(), and bpp::AbstractMafIterator::setVerbose().