isoSeqQC
Quality assessment and re-mapping of poorly mapped isoSeq read segments
Loading...
Searching...
No Matches
isaSpace::ExonGroup Class Reference

Group of exons from the same gene. More...

#include <isoseqAlgn.hpp>

Public Member Functions

 ExonGroup ()=default
 Default constructor.
 ExonGroup (std::string geneName, const char strand, std::set< std::pair< hts_pos_t, hts_pos_t > > &exonSet)
 Constructor with lines from a GFF file.
 ExonGroup (std::string geneName, const char strand, const std::vector< std::string > &exonLinesFomGFF)
 Constructor with exon lines from a GFF file.
 ExonGroup (const ExonGroup &toCopy)=default
 Copy constructor.
ExonGroupoperator= (const ExonGroup &toCopy)=default
 Copy assignment operator.
 ExonGroup (ExonGroup &&toMove) noexcept=default
 Move constructor.
ExonGroupoperator= (ExonGroup &&toMove) noexcept=default
 Move assignment operator.
 ~ExonGroup ()=default
 Destructor.
bool empty () const noexcept
 Is the object empty?
std::string geneName () const
 Report the gene name.
size_t nExons () const noexcept
 Number of exons in the gene.
char strand () const noexcept
 Strand ID.
std::pair< hts_pos_t, hts_pos_t > at (const size_t &idx) const
 Range covered by a given exon.
std::pair< hts_pos_t, hts_pos_t > geneSpan () const noexcept
 Gene span.
std::pair< hts_pos_t, hts_pos_t > firstExonSpan () const noexcept
 First exon span.
hts_pos_t firstExonLength () const noexcept
 First exon length.
uint32_t firstExonAfter (const hts_pos_t &position) const noexcept
 Index of the first exon after a given position.
uint32_t firstOverlappingExon (const hts_pos_t &position) const noexcept
 Index of the first exon overlapping a given position.
uint32_t lastExonBefore (const hts_pos_t &position) const noexcept
 Index of the last exon before a given position.
uint32_t lastOverlappingExon (const hts_pos_t &position) const noexcept
 Index of the last exon overlapping a given position.
std::pair< hts_pos_t, hts_pos_t > getFirstIntronSpan () const
 First intron span.
std::vector< float > getExonCoverageQuality (const BAMrecord &alignment) const
 Get read coverage quality per exon.
std::vector< float > getBestExonCoverageQuality (const BAMrecord &alignment) const
 Get best read coverage quality per exon.

Detailed Description

Group of exons from the same gene.

Gathers exons belonging to all transcripts of a gene.

Constructor & Destructor Documentation

◆ ExonGroup() [1/4]

isaSpace::ExonGroup::ExonGroup ( std::string geneName,
const char strand,
std::set< std::pair< hts_pos_t, hts_pos_t > > & exonSet )

Constructor with lines from a GFF file.

The exon set is ordered by the exon starts. The first exon can be the first or the last, depending on the strand. The strand is assumed positive, unless explicitly specified as negative by passing the - character.

Parameters
[in]geneNamegene name
[in]strandmRNA strand
[in]exonSetset of exons from the same gene

◆ ExonGroup() [2/4]

isaSpace::ExonGroup::ExonGroup ( std::string geneName,
const char strand,
const std::vector< std::string > & exonLinesFomGFF )

Constructor with exon lines from a GFF file.

Uses lines exon from a GFF file that belong to the same gene.

Parameters
[in]geneNamegene name
[in]strandmRNA strand
[in]exonLinesFomGFFGFF file exon lines

◆ ExonGroup() [3/4]

isaSpace::ExonGroup::ExonGroup ( const ExonGroup & toCopy)
default

Copy constructor.

Parameters
[in]toCopyobject to copy

◆ ExonGroup() [4/4]

isaSpace::ExonGroup::ExonGroup ( ExonGroup && toMove)
defaultnoexcept

Move constructor.

Parameters
[in]toMoveobject to move

Member Function Documentation

◆ at()

std::pair< hts_pos_t, hts_pos_t > isaSpace::ExonGroup::at ( const size_t & idx) const
inlinenodiscard

Range covered by a given exon.

Parameters
[in]idxexon index
Returns
the exon start and end nucleotide position pair

◆ empty()

bool isaSpace::ExonGroup::empty ( ) const
inlinenodiscardnoexcept

Is the object empty?

Returns
true is the object has no exons

◆ firstExonAfter()

uint32_t isaSpace::ExonGroup::firstExonAfter ( const hts_pos_t & position) const
nodiscardnoexcept

Index of the first exon after a given position.

0-based index of the first exon found entirely after the given position. Equal to the index of the last exon if the position is after the last exon.

Parameters
[in]positiongenome position to test
Returns
index of the first exon after the given position

◆ firstExonLength()

hts_pos_t isaSpace::ExonGroup::firstExonLength ( ) const
nodiscardnoexcept

First exon length.

Returns
first exon length

◆ firstExonSpan()

std::pair< hts_pos_t, hts_pos_t > isaSpace::ExonGroup::firstExonSpan ( ) const
nodiscardnoexcept

First exon span.

Returns the position of the first exon, depends on the strand. First position is always smaller than the second regardless of strand, in keeping with the GFF3 specification.

Returns
first exon nucleotide position pair (1-based)

◆ firstOverlappingExon()

uint32_t isaSpace::ExonGroup::firstOverlappingExon ( const hts_pos_t & position) const
nodiscardnoexcept

Index of the first exon overlapping a given position.

0-based index of the first exon found at least partially after the given position. Equal to the index of the last exon if the position is after the last exon.

Parameters
[in]positiongenome position to test
Returns
index of the first exon overlapping the given position

◆ geneName()

std::string isaSpace::ExonGroup::geneName ( ) const
inlinenodiscard

Report the gene name.

Returns
gene name

◆ geneSpan()

std::pair< hts_pos_t, hts_pos_t > isaSpace::ExonGroup::geneSpan ( ) const
nodiscardnoexcept

Gene span.

Returns the position span of the gene. First element of the pair is always smaller than the last regardless of the strand.

Returns
first and last nucleotide position (1-based) of the gene

◆ getBestExonCoverageQuality()

std::vector< float > isaSpace::ExonGroup::getBestExonCoverageQuality ( const BAMrecord & alignment) const
nodiscard

Get best read coverage quality per exon.

Use CIGAR information, adding local secondary alignments, to extract alignment quality for each exon. Quality is the fraction of reference nucleotides covered by matching read bases.

Parameters
[in]alignmentBAM alignment record
Returns
vector best alignment qualities, one per exon

◆ getExonCoverageQuality()

std::vector< float > isaSpace::ExonGroup::getExonCoverageQuality ( const BAMrecord & alignment) const
nodiscard

Get read coverage quality per exon.

Use CIGAR information to extract alignment quality for each exon. Quality is the fraction of reference nucleotides covered by matching read bases.

Parameters
[in]alignmentBAM alignment record
Returns
vector of alignment qualities, one per exon

◆ getFirstIntronSpan()

std::pair< hts_pos_t, hts_pos_t > isaSpace::ExonGroup::getFirstIntronSpan ( ) const
nodiscard

First intron span.

Smaller value first regardless of strand, but the intron is always the first in the gene, last in the sequence if the strand is negative. If there is only one exon, the start and end are reported as -1.

Returns
first intron start and end positions

◆ lastExonBefore()

uint32_t isaSpace::ExonGroup::lastExonBefore ( const hts_pos_t & position) const
nodiscardnoexcept

Index of the last exon before a given position.

0-based index of the last exon found entirely before the given position. Equal to the index of the last exon if the position is after the last exon.

Parameters
[in]positiongenome position to test
Returns
index of the last exon before the given position

◆ lastOverlappingExon()

uint32_t isaSpace::ExonGroup::lastOverlappingExon ( const hts_pos_t & position) const
nodiscardnoexcept

Index of the last exon overlapping a given position.

0-based index of the last exon found at least before after the given position. Equal to the index of the last exon if the position is after the last exon.

Parameters
[in]positiongenome position to test
Returns
index of the last exon overlapping the given position

◆ nExons()

size_t isaSpace::ExonGroup::nExons ( ) const
inlinenodiscardnoexcept

Number of exons in the gene.

Returns
number of exons

◆ operator=() [1/2]

ExonGroup & isaSpace::ExonGroup::operator= ( const ExonGroup & toCopy)
default

Copy assignment operator.

Parameters
[in]toCopyobject to copy
Returns
ExonGroup object

◆ operator=() [2/2]

ExonGroup & isaSpace::ExonGroup::operator= ( ExonGroup && toMove)
defaultnoexcept

Move assignment operator.

Parameters
[in]toMoveobject to move
Returns
ExonGroup object

◆ strand()

char isaSpace::ExonGroup::strand ( ) const
inlinenodiscardnoexcept

Strand ID.

Returns
strand ID (+ or -)

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