Loading...
Searching...
No Matches
sam_file/record.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <seqan3/io/record.hpp>
namespace seqan3
{
template <typename field_types, typename field_ids>
class sam_record : public record<field_types, field_ids>
{
using base_t = record<field_types, field_ids>;
using tuple_base_t = typename base_t::base_type;
template <field f>
using field_constant = typename base_t::template field_constant<f>;
using base_t::get_impl;
public:
sam_record() = default;
sam_record(sam_record const &) = default;
sam_record & operator=(sam_record const &) = default;
sam_record(sam_record &&) = default;
sam_record & operator=(sam_record &&) = default;
~sam_record() = default;
using base_t::base_t;
decltype(auto) id() &&
{
return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) id() const &&
{
return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) id() &
{
return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) id() const &
{
return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t const &>(*this));
}
decltype(auto) sequence() &&
{
return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) sequence() const &&
{
return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) sequence() &
{
return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) sequence() const &
{
return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t const &>(*this));
}
decltype(auto) base_qualities() &&
{
return get_impl(field_constant<seqan3::field::qual>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) base_qualities() const &&
{
return get_impl(field_constant<seqan3::field::qual>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) base_qualities() &
{
return get_impl(field_constant<seqan3::field::qual>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) base_qualities() const &
{
return get_impl(field_constant<seqan3::field::qual>{}, static_cast<tuple_base_t const &>(*this));
}
SEQAN3_DEPRECATED_340 decltype(auto) sequence_position() &&
{
return static_cast<int32_t>(0);
}
SEQAN3_DEPRECATED_340 decltype(auto) sequence_position() const &&
{
return static_cast<int32_t>(0);
}
SEQAN3_DEPRECATED_340 decltype(auto) sequence_position() &
{
return static_cast<int32_t>(0);
}
SEQAN3_DEPRECATED_340 decltype(auto) sequence_position() const &
{
return static_cast<int32_t>(0);
}
SEQAN3_DEPRECATED_340 decltype(auto) alignment() &&
{}
SEQAN3_DEPRECATED_340 decltype(auto) alignment() const &&
{}
SEQAN3_DEPRECATED_340 decltype(auto) alignment() &
{}
SEQAN3_DEPRECATED_340 decltype(auto) alignment() const &
{}
decltype(auto) reference_id() &&
{
return get_impl(field_constant<seqan3::field::ref_id>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) reference_id() const &&
{
return get_impl(field_constant<seqan3::field::ref_id>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) reference_id() &
{
return get_impl(field_constant<seqan3::field::ref_id>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) reference_id() const &
{
return get_impl(field_constant<seqan3::field::ref_id>{}, static_cast<tuple_base_t const &>(*this));
}
decltype(auto) reference_sequence() = delete;
decltype(auto) reference_position() &&
{
return get_impl(field_constant<seqan3::field::ref_offset>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) reference_position() const &&
{
return get_impl(field_constant<seqan3::field::ref_offset>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) reference_position() &
{
return get_impl(field_constant<seqan3::field::ref_offset>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) reference_position() const &
{
return get_impl(field_constant<seqan3::field::ref_offset>{}, static_cast<tuple_base_t const &>(*this));
}
decltype(auto) header_ptr() &&
{
return get_impl(field_constant<seqan3::field::header_ptr>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) header_ptr() const &&
{
return get_impl(field_constant<seqan3::field::header_ptr>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) header_ptr() &
{
return get_impl(field_constant<seqan3::field::header_ptr>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) header_ptr() const &
{
return get_impl(field_constant<seqan3::field::header_ptr>{}, static_cast<tuple_base_t const &>(*this));
}
decltype(auto) flag() &&
{
return get_impl(field_constant<seqan3::field::flag>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) flag() const &&
{
return get_impl(field_constant<seqan3::field::flag>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) flag() &
{
return get_impl(field_constant<seqan3::field::flag>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) flag() const &
{
return get_impl(field_constant<seqan3::field::flag>{}, static_cast<tuple_base_t const &>(*this));
}
decltype(auto) mate_reference_id() &&
{
return std::get<0>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t &&>(*this)));
}
decltype(auto) mate_reference_id() const &&
{
return std::get<0>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t const &&>(*this)));
}
decltype(auto) mate_reference_id() &
{
return std::get<0>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t &>(*this)));
}
decltype(auto) mate_reference_id() const &
{
return std::get<0>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t const &>(*this)));
}
decltype(auto) mate_position() &&
{
return std::get<1>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t &&>(*this)));
}
decltype(auto) mate_position() const &&
{
return std::get<1>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t const &&>(*this)));
}
decltype(auto) mate_position() &
{
return std::get<1>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t &>(*this)));
}
decltype(auto) mate_position() const &
{
return std::get<1>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t const &>(*this)));
}
decltype(auto) template_length() &&
{
return std::get<2>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t &&>(*this)));
}
decltype(auto) template_length() const &&
{
return std::get<2>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t const &&>(*this)));
}
decltype(auto) template_length() &
{
return std::get<2>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t &>(*this)));
}
decltype(auto) template_length() const &
{
return std::get<2>(get_impl(field_constant<seqan3::field::mate>{}, static_cast<tuple_base_t const &>(*this)));
}
decltype(auto) mapping_quality() &&
{
return get_impl(field_constant<seqan3::field::mapq>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) mapping_quality() const &&
{
return get_impl(field_constant<seqan3::field::mapq>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) mapping_quality() &
{
return get_impl(field_constant<seqan3::field::mapq>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) mapping_quality() const &
{
return get_impl(field_constant<seqan3::field::mapq>{}, static_cast<tuple_base_t const &>(*this));
}
decltype(auto) cigar_sequence() &&
{
return get_impl(field_constant<seqan3::field::cigar>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) cigar_sequence() const &&
{
return get_impl(field_constant<seqan3::field::cigar>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) cigar_sequence() &
{
return get_impl(field_constant<seqan3::field::cigar>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) cigar_sequence() const &
{
return get_impl(field_constant<seqan3::field::cigar>{}, static_cast<tuple_base_t const &>(*this));
}
decltype(auto) tags() &&
{
return get_impl(field_constant<seqan3::field::tags>{}, static_cast<tuple_base_t &&>(*this));
}
decltype(auto) tags() const &&
{
return get_impl(field_constant<seqan3::field::tags>{}, static_cast<tuple_base_t const &&>(*this));
}
decltype(auto) tags() &
{
return get_impl(field_constant<seqan3::field::tags>{}, static_cast<tuple_base_t &>(*this));
}
decltype(auto) tags() const &
{
return get_impl(field_constant<seqan3::field::tags>{}, static_cast<tuple_base_t const &>(*this));
}
};
} // namespace seqan3
namespace std
{
template <typename field_types, typename field_ids>
struct tuple_size<seqan3::sam_record<field_types, field_ids>> :
tuple_size<typename seqan3::sam_record<field_types, field_ids>::base_type>
{};
template <size_t elem_no, typename field_types, typename field_ids>
struct tuple_element<elem_no, seqan3::sam_record<field_types, field_ids>> :
tuple_element<elem_no, typename seqan3::sam_record<field_types, field_ids>::base_type>
{};
} // namespace std
seqan3::sam_record::reference_position
decltype(auto) reference_position() const &
(Reference) Sequence (seqan3::sam_record::reference_sequence) relative start position (0-based),...
Definition sam_file/record.hpp:217
seqan3::sam_record::header_ptr
decltype(auto) header_ptr() const &&
A pointer to the seqan3::sam_file_header object storing header information.
Definition sam_file/record.hpp:232
seqan3::sam_record::sequence_position
SEQAN3_DEPRECATED_340 decltype(auto) sequence_position() &
[DEPRECATED] Sequence (seqan3::sam_record::sequence) relative start position (0-based),...
Definition sam_file/record.hpp:143
seqan3::sam_record::sequence_position
SEQAN3_DEPRECATED_340 decltype(auto) sequence_position() const &&
[DEPRECATED] Sequence (seqan3::sam_record::sequence) relative start position (0-based),...
Definition sam_file/record.hpp:138
seqan3::sam_record::flag
decltype(auto) flag() const &
The alignment flag (bit information), uint16_t value. (SAM Column ID: FLAG).
Definition sam_file/record.hpp:265
seqan3::sam_record::alignment
SEQAN3_DEPRECATED_340 decltype(auto) alignment() &
[DEPRECATED] The (pairwise) alignment stored in an object that models seqan3::detail::pairwise_alignm...
Definition sam_file/record.hpp:163
seqan3::sam_record::cigar_sequence
decltype(auto) cigar_sequence() &
The cigar vector representing the alignment. (SAM Column ID: CIGAR).
Definition sam_file/record.hpp:379
seqan3::sam_record::mate_reference_id
decltype(auto) mate_reference_id() &&
The identifier of the (reference) sequence of the mate. (SAM Column ID: RNEXT).
Definition sam_file/record.hpp:277
seqan3::sam_record::cigar_sequence
decltype(auto) cigar_sequence() &&
The cigar vector representing the alignment. (SAM Column ID: CIGAR).
Definition sam_file/record.hpp:369
seqan3::sam_record::sequence_position
SEQAN3_DEPRECATED_340 decltype(auto) sequence_position() const &
[DEPRECATED] Sequence (seqan3::sam_record::sequence) relative start position (0-based),...
Definition sam_file/record.hpp:148
seqan3::sam_record::reference_id
decltype(auto) reference_id() const &&
The identifier of the (reference) sequence that seqan3::sam_record::sequence was aligned to....
Definition sam_file/record.hpp:178
seqan3::sam_record::base_qualities
decltype(auto) base_qualities() const &
The qualities, usually in Phred score notation. (SAM Column ID: QUAL).
Definition sam_file/record.hpp:118
seqan3::sam_record::header_ptr
decltype(auto) header_ptr() &&
A pointer to the seqan3::sam_file_header object storing header information.
Definition sam_file/record.hpp:227
seqan3::sam_record::base_qualities
decltype(auto) base_qualities() const &&
The qualities, usually in Phred score notation. (SAM Column ID: QUAL).
Definition sam_file/record.hpp:108
seqan3::sam_record::template_length
decltype(auto) template_length() const &
The observed template length. (SAM Column ID: TLEN).
Definition sam_file/record.hpp:338
seqan3::sam_record::mate_reference_id
decltype(auto) mate_reference_id() const &&
The identifier of the (reference) sequence of the mate. (SAM Column ID: RNEXT).
Definition sam_file/record.hpp:282
seqan3::sam_record::sequence
decltype(auto) sequence() &
The "sequence", usually a range of nucleotides or amino acids. (SAM Column ID: SEQ).
Definition sam_file/record.hpp:90
seqan3::sam_record::mapping_quality
decltype(auto) mapping_quality() &&
The mapping quality of the alignment, usually a Phred-scaled score. (SAM Column ID: MAPQ).
Definition sam_file/record.hpp:346
seqan3::sam_record::reference_id
decltype(auto) reference_id() &
The identifier of the (reference) sequence that seqan3::sam_record::sequence was aligned to....
Definition sam_file/record.hpp:183
seqan3::sam_record::sequence
decltype(auto) sequence() const &&
The "sequence", usually a range of nucleotides or amino acids. (SAM Column ID: SEQ).
Definition sam_file/record.hpp:85
seqan3::sam_record::reference_position
decltype(auto) reference_position() &&
(Reference) Sequence (seqan3::sam_record::reference_sequence) relative start position (0-based),...
Definition sam_file/record.hpp:202
seqan3::sam_record::operator=
sam_record & operator=(sam_record &&)=default
Defaulted.
seqan3::sam_record::template_length
decltype(auto) template_length() const &&
The observed template length. (SAM Column ID: TLEN).
Definition sam_file/record.hpp:328
seqan3::sam_record::mate_position
decltype(auto) mate_position() &
(Reference) Sequence relative start position (0-based) of the mate. (SAM Column ID: PNEXT)
Definition sam_file/record.hpp:310
seqan3::sam_record::sam_record
sam_record(sam_record const &)=default
Defaulted.
seqan3::sam_record::tags
decltype(auto) tags() const &
The optional tags in the SAM format.
Definition sam_file/record.hpp:407
seqan3::sam_record::reference_id
decltype(auto) reference_id() &&
The identifier of the (reference) sequence that seqan3::sam_record::sequence was aligned to....
Definition sam_file/record.hpp:173
seqan3::sam_record::flag
decltype(auto) flag() &&
The alignment flag (bit information), uint16_t value. (SAM Column ID: FLAG).
Definition sam_file/record.hpp:250
seqan3::sam_record::tags
decltype(auto) tags() &
The optional tags in the SAM format.
Definition sam_file/record.hpp:402
seqan3::sam_record::flag
decltype(auto) flag() const &&
The alignment flag (bit information), uint16_t value. (SAM Column ID: FLAG).
Definition sam_file/record.hpp:255
seqan3::sam_record::header_ptr
decltype(auto) header_ptr() const &
A pointer to the seqan3::sam_file_header object storing header information.
Definition sam_file/record.hpp:242
seqan3::sam_record::base_qualities
decltype(auto) base_qualities() &&
The qualities, usually in Phred score notation. (SAM Column ID: QUAL).
Definition sam_file/record.hpp:103
seqan3::sam_record::mapping_quality
decltype(auto) mapping_quality() &
The mapping quality of the alignment, usually a Phred-scaled score. (SAM Column ID: MAPQ).
Definition sam_file/record.hpp:356
seqan3::sam_record::alignment
SEQAN3_DEPRECATED_340 decltype(auto) alignment() &&
[DEPRECATED] The (pairwise) alignment stored in an object that models seqan3::detail::pairwise_alignm...
Definition sam_file/record.hpp:157
seqan3::sam_record::template_length
decltype(auto) template_length() &
The observed template length. (SAM Column ID: TLEN).
Definition sam_file/record.hpp:333
seqan3::sam_record::tags
decltype(auto) tags() const &&
The optional tags in the SAM format.
Definition sam_file/record.hpp:397
seqan3::sam_record::tags
decltype(auto) tags() &&
The optional tags in the SAM format.
Definition sam_file/record.hpp:392
seqan3::sam_record::flag
decltype(auto) flag() &
The alignment flag (bit information), uint16_t value. (SAM Column ID: FLAG).
Definition sam_file/record.hpp:260
seqan3::sam_record::sam_record
sam_record()=default
Defaulted.
seqan3::sam_record::sam_record
sam_record(sam_record &&)=default
Defaulted.
seqan3::sam_record::reference_position
decltype(auto) reference_position() &
(Reference) Sequence (seqan3::sam_record::reference_sequence) relative start position (0-based),...
Definition sam_file/record.hpp:212
seqan3::sam_record::cigar_sequence
decltype(auto) cigar_sequence() const &
The cigar vector representing the alignment. (SAM Column ID: CIGAR).
Definition sam_file/record.hpp:384
seqan3::sam_record::reference_id
decltype(auto) reference_id() const &
The identifier of the (reference) sequence that seqan3::sam_record::sequence was aligned to....
Definition sam_file/record.hpp:188
seqan3::sam_record::sequence_position
SEQAN3_DEPRECATED_340 decltype(auto) sequence_position() &&
[DEPRECATED] Sequence (seqan3::sam_record::sequence) relative start position (0-based),...
Definition sam_file/record.hpp:133
seqan3::sam_record::mate_position
decltype(auto) mate_position() &&
(Reference) Sequence relative start position (0-based) of the mate. (SAM Column ID: PNEXT)
Definition sam_file/record.hpp:300
seqan3::sam_record::reference_sequence
decltype(auto) reference_sequence()=delete
The (reference) "sequence" information, usually a range of nucleotides or amino acids....
seqan3::sam_record::operator=
sam_record & operator=(sam_record const &)=default
Defaulted.
seqan3::sam_record::cigar_sequence
decltype(auto) cigar_sequence() const &&
The cigar vector representing the alignment. (SAM Column ID: CIGAR).
Definition sam_file/record.hpp:374
seqan3::sam_record::sequence
decltype(auto) sequence() const &
The "sequence", usually a range of nucleotides or amino acids. (SAM Column ID: SEQ).
Definition sam_file/record.hpp:95
seqan3::sam_record::alignment
SEQAN3_DEPRECATED_340 decltype(auto) alignment() const &
[DEPRECATED] The (pairwise) alignment stored in an object that models seqan3::detail::pairwise_alignm...
Definition sam_file/record.hpp:166
seqan3::sam_record::alignment
SEQAN3_DEPRECATED_340 decltype(auto) alignment() const &&
[DEPRECATED] The (pairwise) alignment stored in an object that models seqan3::detail::pairwise_alignm...
Definition sam_file/record.hpp:160
seqan3::sam_record::mate_position
decltype(auto) mate_position() const &
(Reference) Sequence relative start position (0-based) of the mate. (SAM Column ID: PNEXT)
Definition sam_file/record.hpp:315
seqan3::sam_record::~sam_record
~sam_record()=default
Defaulted.
seqan3::sam_record::header_ptr
decltype(auto) header_ptr() &
A pointer to the seqan3::sam_file_header object storing header information.
Definition sam_file/record.hpp:237
seqan3::sam_record::mate_position
decltype(auto) mate_position() const &&
(Reference) Sequence relative start position (0-based) of the mate. (SAM Column ID: PNEXT)
Definition sam_file/record.hpp:305
seqan3::sam_record::mapping_quality
decltype(auto) mapping_quality() const &
The mapping quality of the alignment, usually a Phred-scaled score. (SAM Column ID: MAPQ).
Definition sam_file/record.hpp:361
seqan3::sam_record::mate_reference_id
decltype(auto) mate_reference_id() &
The identifier of the (reference) sequence of the mate. (SAM Column ID: RNEXT).
Definition sam_file/record.hpp:287
seqan3::sam_record::mapping_quality
decltype(auto) mapping_quality() const &&
The mapping quality of the alignment, usually a Phred-scaled score. (SAM Column ID: MAPQ).
Definition sam_file/record.hpp:351
seqan3::sam_record::sequence
decltype(auto) sequence() &&
The "sequence", usually a range of nucleotides or amino acids. (SAM Column ID: SEQ).
Definition sam_file/record.hpp:80
seqan3::sam_record::reference_position
decltype(auto) reference_position() const &&
(Reference) Sequence (seqan3::sam_record::reference_sequence) relative start position (0-based),...
Definition sam_file/record.hpp:207
seqan3::sam_record::base_qualities
decltype(auto) base_qualities() &
The qualities, usually in Phred score notation. (SAM Column ID: QUAL).
Definition sam_file/record.hpp:113
seqan3::sam_record::template_length
decltype(auto) template_length() &&
The observed template length. (SAM Column ID: TLEN).
Definition sam_file/record.hpp:323
seqan3::sam_record::mate_reference_id
decltype(auto) mate_reference_id() const &
The identifier of the (reference) sequence of the mate. (SAM Column ID: RNEXT).
Definition sam_file/record.hpp:292
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
std
SeqAn specific customisations in the standard namespace.
SEQAN3_DEPRECATED_340
#define SEQAN3_DEPRECATED_340
Deprecation message for deprecated header.
Definition platform.hpp:185
record.hpp
Provides the seqan3::record template and the seqan3::field enum.
seqan3::record::base_type
detail::transfer_template_args_onto_t< field_types, std::tuple > base_type
A specialisation of std::tuple.
Definition record.hpp:193
seqan3::record::record
record()=default
Defaulted.
Hide me