BamTools 2.5.2
Loading...
Searching...
No Matches
BamTools::SamSequenceDictionary Class Reference

Container of SamSequence entries. More...

#include <SamSequenceDictionary.h>

Public Member Functions

 SamSequenceDictionary ()
 constructor
 
void Add (const SamSequence &sequence)
 Appends a sequence to the dictionary.
 
void Add (const std::string &name, const int &length)
 Appends a sequence to the dictionary.
 
void Add (const SamSequenceDictionary &sequences)
 Appends another sequence dictionary to this one.
 
void Add (const std::vector< SamSequence > &sequences)
 Appends multiple sequences to the dictionary.
 
void Add (const std::map< std::string, int > &sequenceMap)
 Appends multiple sequences to the dictionary.
 
void Clear ()
 Clears all sequence entries.
 
bool Contains (const SamSequence &sequence) const
 Returns true if dictionary contains sequence (matches on name).
 
bool Contains (const std::string &sequenceName) const
 Returns true if dictionary contains sequence.
 
bool IsEmpty () const
 Returns true if dictionary contains no sequences.
 
void Remove (const SamSequence &sequence)
 Removes sequence from dictionary, if found (matches on name).
 
void Remove (const std::string &sequenceName)
 Removes sequence from dictionary, if found.
 
void Remove (const std::vector< SamSequence > &sequences)
 Removes multiple sequences from dictionary.
 
void Remove (const std::vector< std::string > &sequenceNames)
 Removes multiple sequences from dictionary.
 
int Size () const
 Returns number of sequences in dictionary.
 
SamSequenceoperator[] (const std::string &sequenceName)
 Retrieves the modifiable SamSequence that matches sequenceName.
 
SamSequenceIterator Begin ()
 
SamSequenceConstIterator Begin () const
 
SamSequenceConstIterator ConstBegin () const
 
SamSequenceIterator End ()
 
SamSequenceConstIterator End () const
 
SamSequenceConstIterator ConstEnd () const
 

Detailed Description

Container of SamSequence entries.

Provides methods for operating on a collection of SamSequence entries.

Constructor & Destructor Documentation

◆ SamSequenceDictionary()

SamSequenceDictionary::SamSequenceDictionary ( )

constructor

Member Function Documentation

◆ Add() [1/5]

void SamSequenceDictionary::Add ( const SamSequence & sequence)

Appends a sequence to the dictionary.

Duplicate entries are silently discarded.

Parameters
[in]sequenceentry to be added

◆ Add() [2/5]

void SamSequenceDictionary::Add ( const SamSequenceDictionary & sequences)

Appends another sequence dictionary to this one.

This is an overloaded function.

Parameters
[in]sequencessequence dictionary to be appended
See also
Add()

◆ Add() [3/5]

void SamSequenceDictionary::Add ( const std::map< std::string, int > & sequenceMap)

Appends multiple sequences to the dictionary.

This is an overloaded function.

Parameters
[in]sequenceMapmap of sequence entries (name => length) to be added
See also
Add()

◆ Add() [4/5]

void SamSequenceDictionary::Add ( const std::string & name,
const int & length )

Appends a sequence to the dictionary.

This is an overloaded function.

Parameters
[in]namename of sequence entry to be added
[in]lengthlength of sequence entry to be added
See also
Add()

◆ Add() [5/5]

void SamSequenceDictionary::Add ( const std::vector< SamSequence > & sequences)

Appends multiple sequences to the dictionary.

This is an overloaded function.

Parameters
[in]sequencesentries to be added
See also
Add()

◆ Begin() [1/2]

SamSequenceIterator SamSequenceDictionary::Begin ( )
Returns
an STL iterator pointing to the first sequence
See also
ConstBegin(), End()

◆ Begin() [2/2]

SamSequenceConstIterator SamSequenceDictionary::Begin ( ) const
Returns
an STL const_iterator pointing to the first sequence

This is an overloaded function.

See also
ConstBegin(), End()

◆ Clear()

void SamSequenceDictionary::Clear ( )

Clears all sequence entries.

◆ ConstBegin()

SamSequenceConstIterator SamSequenceDictionary::ConstBegin ( ) const
Returns
an STL const_iterator pointing to the first sequence
See also
Begin(), ConstEnd()

◆ ConstEnd()

SamSequenceConstIterator SamSequenceDictionary::ConstEnd ( ) const
Returns
an STL const_iterator pointing to the imaginary entry after the last sequence
See also
End(), ConstBegin()

◆ Contains() [1/2]

bool SamSequenceDictionary::Contains ( const SamSequence & sequence) const

Returns true if dictionary contains sequence (matches on name).

This is an overloaded function.

Parameters
[in]sequencesearch for this sequence
Returns
true if dictionary contains sequence (matching on name)

◆ Contains() [2/2]

bool SamSequenceDictionary::Contains ( const std::string & sequenceName) const

Returns true if dictionary contains sequence.

Parameters
[in]sequenceNamesearch for sequence matching this name
Returns
true if dictionary contains a sequence with this name

◆ End() [1/2]

SamSequenceIterator SamSequenceDictionary::End ( )
Returns
an STL iterator pointing to the imaginary entry after the last sequence
See also
Begin(), ConstEnd()

◆ End() [2/2]

SamSequenceConstIterator SamSequenceDictionary::End ( ) const
Returns
an STL const_iterator pointing to the imaginary entry after the last sequence

This is an overloaded function.

See also
Begin(), ConstEnd()

◆ IsEmpty()

bool SamSequenceDictionary::IsEmpty ( ) const

Returns true if dictionary contains no sequences.

See also
Size()

◆ operator[]()

SamSequence & SamSequenceDictionary::operator[] ( const std::string & sequenceName)

Retrieves the modifiable SamSequence that matches sequenceName.

Note
If the dictionary contains no sequence matching this name, this function inserts a new one with this name (length:0), and returns a reference to it. If you want to avoid this insertion behavior, check the result of Contains() before using this operator.
Parameters
[in]sequenceNamename of sequence to retrieve
Returns
a modifiable reference to the SamSequence associated with the name

◆ Remove() [1/4]

void SamSequenceDictionary::Remove ( const SamSequence & sequence)

Removes sequence from dictionary, if found (matches on name).

This is an overloaded function.

Parameters
[in]sequenceSamSequence to remove (matching on name)

◆ Remove() [2/4]

void SamSequenceDictionary::Remove ( const std::string & sequenceName)

Removes sequence from dictionary, if found.

Parameters
[in]sequenceNamename of sequence to remove
See also
Remove()

◆ Remove() [3/4]

void SamSequenceDictionary::Remove ( const std::vector< SamSequence > & sequences)

Removes multiple sequences from dictionary.

This is an overloaded function.

Parameters
[in]sequencessequences to remove
See also
Remove()

◆ Remove() [4/4]

void SamSequenceDictionary::Remove ( const std::vector< std::string > & sequenceNames)

Removes multiple sequences from dictionary.

This is an overloaded function.

Parameters
[in]sequenceNamesnames of the sequences to remove
See also
Remove()

◆ Size()

int SamSequenceDictionary::Size ( ) const

Returns number of sequences in dictionary.

See also
IsEmpty()

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