Class
BamAlignmentRecordRepresent a record from a BAM or SAM file.
Implements | FormattedFileRecordConcept |
---|---|
All Impl'd | AssignableConcept, CopyConstructibleConcept, DefaultConstructibleConcept, FormattedFileRecordConcept |
Defined in | <seqan/bam_io.h> |
Signature |
class BamAlignmentRecord;
|
Interface Function Overview
-
void bamRecordToAlignment(align, reference, record);
Construct an Align object from a BamAlignmentRecord object. -
void clear(record);
Clear BamAlignmentRecord. -
unsigned getAlignmentLengthInRef(record);
Return the alignment length in the record's projection in the reference. -
TLength getContigLength(record, file);
Return the length of the reference contig of a BamAlignmentRecord. -
TNameString getContigName(record, file);
Return the name of the reference contig of a BamAlignmentRecord. -
bool hasFlagAllProper(record);
Return true if a BamAlignmentRecord has the "all properly aligned" flag set. -
bool hasFlagDuplicate(record);
Return true if a BamAlignmentRecord has the "duplicate" flag set. -
bool hasFlagFirst(record);
Return true if a BamAlignmentRecord has the "first in template" flag set. -
bool hasFlagLast(record);
Return true if a BamAlignmentRecord has the "last in template" flag set. -
bool hasFlagMultiple(record);
Return true if a BamAlignmentRecord has the "multiple" flag set. -
bool hasFlagNextRC(record);
Return true if a BamAlignmentRecord has the "next reverse-complemented" flag set. -
bool hasFlagNextUnmapped(record);
Return true if a BamAlignmentRecord has the "next unmapped" flag set. -
bool hasFlagQCNoPass(record);
Return true if a BamAlignmentRecord has the "did not pass QC" flag set. -
bool hasFlagRC(record);
Return true if a BamAlignmentRecord has the "reverse-complemented" flag set. -
bool hasFlagSecondary(record);
Return true if a BamAlignmentRecord has the "secondary" flag set. -
bool hasFlagSupplementary(record);
Return true if a BamAlignmentRecord has the "supplementary" flag set. -
bool hasFlagUnmapped(record);
Return true if a BamAlignmentRecord has the "unmapped" flag set.
Interface Functions Inherited From AssignableConcept
Member Variable Overview
-
int32_t BamAlignmentRecord::beginPos
Begin position of the alignment (0-based, INVALID_POS for '0' in SAM). -
uint16_t BamAlignmentRecord::bin
The bin of the alignment, automatically computed when writing BAM. -
TCigarString BamAlignmentRecord::cigar
The CIGAR string for the BAM alignment (of type String<CigarElement<> >). -
uint16_t BamAlignmentRecord::flag
The flag of this mapping. -
uint32_t BamAlignmentRecord::INVALID_LEN
Static member with invalid/sentinel reference ids (0 as in BAM/SAM). -
uint32_t BamAlignmentRecord::INVALID_POS
Static member with invalid sentinel/position value (-1). -
uint32_t BamAlignmentRecord::INVALID_REFID
Static member with invalid sentinel/position value (-1). -
uint8_t BamAlignmentRecord::mapQ
Mapping quality (255 for '*'). -
int32_t BamAlignmentRecord::pNext
Position on the reference where the next fragment in this template aligns. -
CharString BamAlignmentRecord::qName
The query/read name. -
CharString BamAlignmentRecord::qual
The PHRED quality values of the sequence (as in SAM), empty for '*'. -
int32_t BamAlignmentRecord::rID
ID of reference for this fragment mapping (0-based, INVALID_REFID for '*' in SAM). -
int32_t BamAlignmentRecord::rNextId
The ID of the reference where the next fragment in this template aligns. -
CharString BamAlignmentRecord::seq
The fragment sequence. -
CharString BamAlignmentRecord::tags
Raw BAM tag string, use BamTagsDict for comfortable access. -
int32_t BamAlignmentRecord::tLen
The inferred template size.
Detailed Description
Remarks
While also used to represent SAM records, the type is called BamAlignmentRecord since the data directly reflects a BAM records (0-based positions, identify references by id, and tags are stored in BAM format.
See Also
Interface Functions Detail
void bamRecordToAlignment(align, reference, record);
Parameters
align
|
The Align object to create the alignment object in. |
---|---|
reference
|
The string with the reference that record lies on. |
record
|
The BamAlignmentRecord to construct alignment from. |
The function will resize align to have two rows. The part of the reference that the read from record aligns to will be copied to the first row and the sequence from record will be copied to the second row (and reverse-complemented if appropriate). Then, the gaps from the CIGAR string in record will be copied to align.
Example
Here is an example:
StringSet<Dna5String> references;
BamAlignment record;
// Read references and record.
Align<Dna5String> align;
if (record.rID != BamAlignmentRecord::INVALID_REFID)
bamRecordToAlignment(align, references[record.refId], record);
Data Races
void clear(record);
Parameters
record
|
The BamAlignmentRecord to clear. |
---|
Clears all strings and resets it to default initialization state.
Data Races
unsigned getAlignmentLengthInRef(record);
Parameters
record
|
The BamAlignmentRecord to compute length for. |
---|
Returns
unsigned |
The alignment length. |
---|
Data Races
See Also
TLength getContigLength(record, file);
Parameters
record
|
The BamAlignmentRecord to query. |
---|---|
file
|
The BamFileIn or BamFileOut where the record belongs to. |
Returns
TLength |
The length of the reference contig. TLength is the Value type of the LengthStore. The LengthStore type can be determined using the Member metafunction for the BamIOContext in conjunction with the LengthStoreMember tag. |
---|
Data Races
TNameString getContigName(record, file);
Parameters
record
|
The BamAlignmentRecord to query. |
---|---|
file
|
The BamFileIn or BamFileOut where the record belongs to. |
Returns
TNameString |
The name of the reference contig. TNameString is the Value type of the NameStore. The NameStore type can be determined using the Member metafunction for the BamIOContext in conjunction with the NameStoreMember tag. |
---|
Data Races
bool hasFlagAllProper(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagDuplicate(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagFirst(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagLast(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagMultiple(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagNextRC(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagNextUnmapped(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagQCNoPass(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagRC(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagSecondary(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
bool hasFlagSupplementary(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
bool hasFlagUnmapped(record);
Parameters
record
|
The BamAlignmentRecord to query. |
---|
Returns
bool |
true if the flag is set, false otherwise. |
---|
Data Races
See Also
Member Variables Detail
int32_t BamAlignmentRecord::beginPos
uint16_t BamAlignmentRecord::bin
TCigarString BamAlignmentRecord::cigar
uint16_t BamAlignmentRecord::flag
See BamFlags for flag constants and also see the hasFlag*() functions.
uint32_t BamAlignmentRecord::INVALID_LEN
uint32_t BamAlignmentRecord::INVALID_POS
uint32_t BamAlignmentRecord::INVALID_REFID
uint8_t BamAlignmentRecord::mapQ
int32_t BamAlignmentRecord::pNext
INVALID_POS for '*'.
CharString BamAlignmentRecord::qName
Note that the reads of a template all of the same query name and are differentiated by their position and the BAM_FLAG_FIRST/BAM_FLAG_LAST flag values.
CharString BamAlignmentRecord::qual
int32_t BamAlignmentRecord::rID
int32_t BamAlignmentRecord::rNextId
INVALID_REFID for '*'.
CharString BamAlignmentRecord::seq
CharString BamAlignmentRecord::tags
int32_t BamAlignmentRecord::tLen
INVALID_LEN for '*'.