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

A simple reader for features in the BedGraph format. More...

#include <Bpp/Seq/Feature/Bed/BedGraphFeatureReader.h>

+ Inheritance diagram for bpp::BedGraphFeatureReader:
+ Collaboration diagram for bpp::BedGraphFeatureReader:

Public Member Functions

 BedGraphFeatureReader (std::istream &input)
 
bool hasMoreFeature () const
 
const BasicSequenceFeature nextFeature ()
 
void getAllFeatures (SequenceFeatureSet &features)
 
void getFeaturesOfType (const std::string &type, SequenceFeatureSet &features)
 
void getFeaturesOfSequence (const std::string &seqId, SequenceFeatureSet &features)
 

Static Public Member Functions

static std::string toString (const bpp::SequenceFeature &f)
 
static void toString (const bpp::SequenceFeature &f, std::ostream &out)
 Out put a string description of a feature to a stream. More...
 
static void toString (const bpp::SequenceFeatureSet &fs, std::ostream &out)
 

Static Public Attributes

static const std::string BED_VALUE = "BedValue"
 

Private Member Functions

void getNextLine_ ()
 

Private Attributes

std::istream & input_
 
std::string nextLine_
 
unsigned int id_
 

Detailed Description

A simple reader for features in the BedGraph format.

Format desciption at UCSC: https://genome.ucsc.edu/goldenpath/help/bedgraph.html

Note: The value associated to each feature is stored as a string attribute, using tag BegGraphFeatureReader::BED_VALUE. No check is performed regarding its value. An automatic id is generated, and the source tag is set to "beg_graph".

Author
Julien Dutheil

Definition at line 66 of file BedGraphFeatureReader.h.

Constructor & Destructor Documentation

◆ BedGraphFeatureReader()

bpp::BedGraphFeatureReader::BedGraphFeatureReader ( std::istream &  input)
inline

Definition at line 78 of file BedGraphFeatureReader.h.

References getNextLine_(), input_, and nextLine_.

Member Function Documentation

◆ getAllFeatures()

void bpp::BedGraphFeatureReader::getAllFeatures ( SequenceFeatureSet features)
inlinevirtual

◆ getFeaturesOfSequence()

void bpp::BedGraphFeatureReader::getFeaturesOfSequence ( const std::string &  seqId,
SequenceFeatureSet features 
)
inlinevirtual

◆ getFeaturesOfType()

void bpp::BedGraphFeatureReader::getFeaturesOfType ( const std::string &  type,
SequenceFeatureSet features 
)
inlinevirtual

◆ getNextLine_()

void BedGraphFeatureReader::getNextLine_ ( )
private

Definition at line 58 of file BedGraphFeatureReader.cpp.

References bpp::TextTools::isEmpty().

Referenced by BedGraphFeatureReader().

◆ hasMoreFeature()

bool bpp::BedGraphFeatureReader::hasMoreFeature ( ) const
inlinevirtual

Implements bpp::FeatureReader.

Definition at line 94 of file BedGraphFeatureReader.h.

References nextLine_.

Referenced by getAllFeatures(), getFeaturesOfSequence(), and getFeaturesOfType().

◆ nextFeature()

◆ toString() [1/3]

std::string BedGraphFeatureReader::toString ( const bpp::SequenceFeature f)
static
Parameters
fA sequence feature.
Returns
A string describing the feature, in GFF format.

Definition at line 96 of file BedGraphFeatureReader.cpp.

References bpp::SequenceFeature::getAttribute(), bpp::SequenceFeature::getEnd(), bpp::SequenceFeature::getSequenceId(), bpp::SequenceFeature::getStart(), bpp::VectorTools::paste(), and bpp::TextTools::toString().

Referenced by toString().

◆ toString() [2/3]

static void bpp::BedGraphFeatureReader::toString ( const bpp::SequenceFeature f,
std::ostream &  out 
)
inlinestatic

Out put a string description of a feature to a stream.

A end of line character will be appended after the description.

Parameters
fA sequence feature.
outAn output stream.

Definition at line 131 of file BedGraphFeatureReader.h.

References toString().

◆ toString() [3/3]

static void bpp::BedGraphFeatureReader::toString ( const bpp::SequenceFeatureSet fs,
std::ostream &  out 
)
inlinestatic

Member Data Documentation

◆ BED_VALUE

const std::string BedGraphFeatureReader::BED_VALUE = "BedValue"
static

Definition at line 70 of file BedGraphFeatureReader.h.

◆ id_

unsigned int bpp::BedGraphFeatureReader::id_
private

Definition at line 75 of file BedGraphFeatureReader.h.

◆ input_

std::istream& bpp::BedGraphFeatureReader::input_
private

Definition at line 73 of file BedGraphFeatureReader.h.

Referenced by BedGraphFeatureReader().

◆ nextLine_

std::string bpp::BedGraphFeatureReader::nextLine_
private

Definition at line 74 of file BedGraphFeatureReader.h.

Referenced by BedGraphFeatureReader(), and hasMoreFeature().


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