SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
output.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
15 #include <cassert>
16 #include <fstream>
17 #include <string>
18 #include <string_view>
19 #include <variant>
20 #include <vector>
21 
32 #include <seqan3/io/detail/record.hpp>
33 #include <seqan3/io/exception.hpp>
34 #include <seqan3/std/filesystem>
35 #include <seqan3/io/record.hpp>
37 #include <seqan3/std/ranges>
38 
39 namespace seqan3
40 {
41 
42 // ----------------------------------------------------------------------------
43 // alignment_file_output
44 // ----------------------------------------------------------------------------
45 
168 template <detail::fields_specialisation selected_field_ids_ =
169  fields<field::seq,
170  field::id,
176  field::mapq,
177  field::qual,
178  field::flag,
179  field::mate,
180  field::tags,
184  detail::type_list_of_alignment_file_output_formats valid_formats_ = type_list<format_sam, format_bam>,
185  typename ref_ids_type = ref_info_not_given>
187 {
188 public:
193  using selected_field_ids = selected_field_ids_;
196  using valid_formats = valid_formats_;
198  using stream_char_type = char;
200 
203  field::seq,
204  field::id,
210  field::cigar,
211  field::mapq,
212  field::flag,
213  field::qual,
214  field::mate,
215  field::tags,
218 
219  static_assert([] () constexpr
220  {
221  for (field f : selected_field_ids::as_array)
222  if (!field_ids::contains(f))
223  return false;
224  return true;
225  }(),
226  "You selected a field that is not valid for alignment files, "
227  "please refer to the documentation of "
228  "seqan3::alignment_file_output::field_ids for the accepted values.");
229 
230  static_assert([] () constexpr
231  {
234  }(),
235  "You may not select field::alignment and field::cigar at the same time.");
236 
242  using value_type = void;
245  using reference = void;
247  using const_reference = void;
249  using size_type = void;
253  using iterator = detail::out_file_iterator<alignment_file_output>;
255  using const_iterator = void;
257  using sentinel = std::ranges::default_sentinel_t;
259 
263  alignment_file_output() = delete;
274  ~alignment_file_output() = default;
275 
302  selected_field_ids const & SEQAN3_DOXYGEN_ONLY(fields_tag) = selected_field_ids{}) :
303  primary_stream{new std::ofstream{filename, std::ios_base::out | std::ios::binary}, stream_deleter_default}
304  {
305  // open stream
306  if (!primary_stream->good())
307  throw file_open_error{"Could not open file " + filename.string() + " for writing."};
308 
309  // possibly add intermediate compression stream
310  secondary_stream = detail::make_secondary_ostream(*primary_stream, filename);
311 
312  // initialise format handler or throw if format is not found
313  detail::set_format(format, filename);
314  }
315 
332  template <output_stream stream_type, alignment_file_output_format file_format>
336  alignment_file_output(stream_type & stream,
337  file_format const & SEQAN3_DOXYGEN_ONLY(format_tag),
338  selected_field_ids const & SEQAN3_DOXYGEN_ONLY(fields_tag) = selected_field_ids{}) :
339  primary_stream{&stream, stream_deleter_noop},
340  secondary_stream{&stream, stream_deleter_noop},
341  format{detail::alignment_file_output_format_exposer<file_format>{}}
342  {
343  static_assert(list_traits::contains<file_format, valid_formats>,
344  "You selected a format that is not in the valid_formats of this file.");
345  }
346 
348  template <output_stream stream_type, alignment_file_output_format file_format>
352  alignment_file_output(stream_type && stream,
353  file_format const & SEQAN3_DOXYGEN_ONLY(format_tag),
354  selected_field_ids const & SEQAN3_DOXYGEN_ONLY(fields_tag) = selected_field_ids{}) :
355  primary_stream{new stream_type{std::move(stream)}, stream_deleter_default},
356  secondary_stream{&*primary_stream, stream_deleter_noop},
357  format{detail::alignment_file_output_format_exposer<file_format>{}}
358  {
359  static_assert(list_traits::contains<file_format, valid_formats>,
360  "You selected a format that is not in the valid_formats of this file.");
361  }
362 
393  template <typename ref_ids_type_, std::ranges::forward_range ref_lengths_type>
398  ref_ids_type_ && ref_ids,
399  ref_lengths_type && ref_lengths,
400  selected_field_ids const & SEQAN3_DOXYGEN_ONLY(fields_tag) = selected_field_ids{}) :
402 
403  {
404  initialise_header_information(ref_ids, ref_lengths);
405  }
406 
428  template <output_stream stream_type,
429  alignment_file_output_format file_format,
430  typename ref_ids_type_, // generic type to capture lvalue references
431  std::ranges::forward_range ref_lengths_type>
435  alignment_file_output(stream_type && stream,
436  ref_ids_type_ && ref_ids,
437  ref_lengths_type && ref_lengths,
438  file_format const & SEQAN3_DOXYGEN_ONLY(format_tag),
439  selected_field_ids const & SEQAN3_DOXYGEN_ONLY(fields_tag) = selected_field_ids{}) :
440  alignment_file_output{std::forward<stream_type>(stream), file_format{}, selected_field_ids{}}
441  {
442  initialise_header_information(ref_ids, ref_lengths);
443  }
445 
467  iterator begin() noexcept
468  {
469  return {*this};
470  }
471 
486  sentinel end() noexcept
487  {
488  return {};
489  }
490 
509  template <typename record_t>
510  void push_back(record_t && r)
512  requires tuple_like<record_t> &&
513  requires { requires detail::is_type_specialisation_of_v<remove_cvref_t<record_t>, record>; }
515  {
516  using default_align_t = std::pair<std::span<gapped<char>>, std::span<gapped<char>>>;
517  using default_mate_t = std::tuple<std::string_view, std::optional<int32_t>, int32_t>;
518 
519  write_record(detail::get_or<field::header_ptr>(r, nullptr),
520  detail::get_or<field::seq>(r, std::string_view{}),
521  detail::get_or<field::qual>(r, std::string_view{}),
522  detail::get_or<field::id>(r, std::string_view{}),
523  detail::get_or<field::offset>(r, 0u),
524  detail::get_or<field::ref_seq>(r, std::string_view{}),
525  detail::get_or<field::ref_id>(r, std::ignore),
526  detail::get_or<field::ref_offset>(r, std::optional<int32_t>{}),
527  detail::get_or<field::alignment>(r, default_align_t{}),
528  detail::get_or<field::cigar>(r, std::vector<cigar>{}),
529  detail::get_or<field::flag>(r, sam_flag::none),
530  detail::get_or<field::mapq>(r, 0u),
531  detail::get_or<field::mate>(r, default_mate_t{}),
532  detail::get_or<field::tags>(r, sam_tag_dictionary{}),
533  detail::get_or<field::evalue>(r, 0u),
534  detail::get_or<field::bit_score>(r, 0u));
535  }
536 
558  template <typename tuple_t>
559  void push_back(tuple_t && t)
561  requires tuple_like<tuple_t>
563  {
564  using default_align_t = std::pair<std::span<gapped<char>>, std::span<gapped<char>>>;
565  using default_mate_t = std::tuple<std::string_view, std::optional<int32_t>, int32_t>;
566 
567  // index_of might return npos, but this will be handled well by get_or_ignore (and just return ignore)
568  write_record(detail::get_or<selected_field_ids::index_of(field::header_ptr)>(t, nullptr),
569  detail::get_or<selected_field_ids::index_of(field::seq)>(t, std::string_view{}),
570  detail::get_or<selected_field_ids::index_of(field::qual)>(t, std::string_view{}),
571  detail::get_or<selected_field_ids::index_of(field::id)>(t, std::string_view{}),
572  detail::get_or<selected_field_ids::index_of(field::offset)>(t, 0u),
573  detail::get_or<selected_field_ids::index_of(field::ref_seq)>(t, std::string_view{}),
574  detail::get_or<selected_field_ids::index_of(field::ref_id)>(t, std::ignore),
575  detail::get_or<selected_field_ids::index_of(field::ref_offset)>(t, std::optional<int32_t>{}),
576  detail::get_or<selected_field_ids::index_of(field::alignment)>(t, default_align_t{}),
577  detail::get_or<selected_field_ids::index_of(field::cigar)>(t, std::vector<cigar>{}),
578  detail::get_or<selected_field_ids::index_of(field::flag)>(t, sam_flag::none),
579  detail::get_or<selected_field_ids::index_of(field::mapq)>(t, 0u),
580  detail::get_or<selected_field_ids::index_of(field::mate)>(t, default_mate_t{}),
581  detail::get_or<selected_field_ids::index_of(field::tags)>(t, sam_tag_dictionary{}),
582  detail::get_or<selected_field_ids::index_of(field::evalue)>(t, 0u),
583  detail::get_or<selected_field_ids::index_of(field::bit_score)>(t, 0u));
584  }
585 
609  template <typename arg_t, typename ...arg_types>
610  void emplace_back(arg_t && arg, arg_types && ... args)
611  {
612  push_back(std::tie(arg, args...));
613  }
614 
636  template <typename rng_t>
639  requires std::ranges::input_range<rng_t> && tuple_like<reference_t<rng_t>>
641  {
642  for (auto && record : range)
643  push_back(std::forward<decltype(record)>(record));
644  return *this;
645  }
646 
675  template <typename rng_t>
678  requires std::ranges::input_range<rng_t> && tuple_like<reference_t<rng_t>>
680  {
681  f = range;
682  return f;
683  }
684 
686  template <typename rng_t>
689  requires std::ranges::input_range<rng_t> && tuple_like<reference_t<rng_t>>
691  {
692  f = range;
693  return std::move(f);
694  }
696 
699 
704  {
705  return *secondary_stream;
706  }
708 
719  auto & header()
720  {
722  throw std::logic_error{"Please construct your file with reference id and length information in order "
723  "to properly initialise the header before accessing it."};
724 
725  return *header_ptr;
726  }
727 
728 protected:
730 
738  static void stream_deleter_noop(std::basic_ostream<stream_char_type> *) {}
740  static void stream_deleter_default(std::basic_ostream<stream_char_type> * ptr) { delete ptr; }
741 
743  stream_ptr_t primary_stream{nullptr, stream_deleter_noop};
745  stream_ptr_t secondary_stream{nullptr, stream_deleter_noop};
746 
748  using format_type = typename detail::variant_from_tags<valid_formats,
749  detail::alignment_file_output_format_exposer>::type;
750 
752  format_type format;
754 
756  using header_type = alignment_file_header<std::conditional_t<std::same_as<ref_ids_type, ref_info_not_given>,
758  ref_ids_type>>;
759 
761  std::unique_ptr<header_type> header_ptr;
762 
764  template <typename ref_ids_type_, typename ref_lengths_type>
765  void initialise_header_information(ref_ids_type_ && ref_ids, ref_lengths_type && ref_lengths)
766  {
767  assert(std::ranges::size(ref_ids) == std::ranges::size(ref_lengths));
768 
769  header_ptr = std::make_unique<alignment_file_header<ref_ids_type>>(std::forward<ref_ids_type_>(ref_ids));
770 
771  for (int32_t idx = 0; idx < std::ranges::distance(ref_ids); ++idx)
772  {
773  header_ptr->ref_id_info.emplace_back(ref_lengths[idx], "");
774 
775  if constexpr (std::ranges::contiguous_range<reference_t<ref_ids_type_>> &&
776  std::ranges::sized_range<reference_t<ref_ids_type_>> &&
777  forwarding_range<reference_t<ref_ids_type_>>)
778  {
779  auto && id = header_ptr->ref_ids()[idx];
780  header_ptr->ref_dict[std::span{std::ranges::data(id), std::ranges::size(id)}] = idx;
781  }
782  else
783  {
784  header_ptr->ref_dict[header_ptr->ref_ids()[idx]] = idx;
785  }
786  }
787  }
788 
790  template <typename record_header_ptr_t, typename ...pack_type>
791  void write_record(record_header_ptr_t && record_header_ptr, pack_type && ...remainder)
792  {
793  static_assert((sizeof...(pack_type) == 15), "Wrong parameter list passed to write_record.");
794 
795  assert(!format.valueless_by_exception());
796 
797  std::visit([&] (auto & f)
798  {
799  // use header from record if explicitly given, e.g. file_output = file_input
801  {
802  f.write_alignment_record(*secondary_stream,
803  options,
804  *record_header_ptr,
805  std::forward<pack_type>(remainder)...);
806  }
808  {
809  f.write_alignment_record(*secondary_stream,
810  options,
811  std::ignore,
812  std::forward<pack_type>(remainder)...);
813  }
814  else
815  {
816  f.write_alignment_record(*secondary_stream,
817  options,
818  *header_ptr,
819  std::forward<pack_type>(remainder)...);
820  }
821  }, format);
822  }
823 
825  friend iterator;
826 };
827 
836 template <detail::fields_specialisation selected_field_ids>
837 alignment_file_output(std::filesystem::path, selected_field_ids const &)
838  -> alignment_file_output<selected_field_ids,
840  ref_info_not_given>;
841 
845 template <output_stream stream_type,
846  alignment_file_output_format file_format,
847  detail::fields_specialisation selected_field_ids>
848 alignment_file_output(stream_type &&, file_format const &, selected_field_ids const &)
849  -> alignment_file_output<selected_field_ids,
850  type_list<file_format>,
851  ref_info_not_given>;
852 
856 template <output_stream stream_type,
857  alignment_file_output_format file_format,
858  detail::fields_specialisation selected_field_ids>
859 alignment_file_output(stream_type &, file_format const &, selected_field_ids const &)
860  -> alignment_file_output<selected_field_ids,
861  type_list<file_format>,
862  ref_info_not_given>;
863 
867 template <output_stream stream_type,
868  alignment_file_output_format file_format>
869 alignment_file_output(stream_type &&, file_format const &)
871  type_list<file_format>,
872  ref_info_not_given>;
873 
877 template <output_stream stream_type,
878  alignment_file_output_format file_format>
879 alignment_file_output(stream_type &, file_format const &)
881  type_list<file_format>,
882  ref_info_not_given>;
883 
885 template <detail::fields_specialisation selected_field_ids,
886  std::ranges::forward_range ref_ids_type,
887  std::ranges::forward_range ref_lengths_type>
888 alignment_file_output(std::filesystem::path const &,
889  ref_ids_type &&,
890  ref_lengths_type &&,
891  selected_field_ids const &)
892  -> alignment_file_output<selected_field_ids,
895 
897 template <std::ranges::forward_range ref_ids_type,
898  std::ranges::forward_range ref_lengths_type>
899 alignment_file_output(std::filesystem::path const &,
900  ref_ids_type &&,
901  ref_lengths_type &&)
905 
907 template <output_stream stream_type,
908  std::ranges::forward_range ref_ids_type,
909  std::ranges::forward_range ref_lengths_type,
910  alignment_file_output_format file_format,
911  detail::fields_specialisation selected_field_ids>
912 alignment_file_output(stream_type &&,
913  ref_ids_type &&,
914  ref_lengths_type &&,
915  file_format const &,
916  selected_field_ids const &)
917  -> alignment_file_output<selected_field_ids,
918  type_list<file_format>,
920 
922 template <output_stream stream_type,
923  std::ranges::forward_range ref_ids_type,
924  std::ranges::forward_range ref_lengths_type,
925  alignment_file_output_format file_format,
926  detail::fields_specialisation selected_field_ids>
927 alignment_file_output(stream_type &,
928  ref_ids_type &&,
929  ref_lengths_type &&,
930  file_format const &,
931  selected_field_ids const &)
932  -> alignment_file_output<selected_field_ids,
933  type_list<file_format>,
935 
937 template <output_stream stream_type,
938  std::ranges::forward_range ref_ids_type,
939  std::ranges::forward_range ref_lengths_type,
940  alignment_file_output_format file_format>
941 alignment_file_output(stream_type &&,
942  ref_ids_type &&,
943  ref_lengths_type &&,
944  file_format const &)
946  type_list<file_format>,
948 
950 template <output_stream stream_type,
951  std::ranges::forward_range ref_ids_type,
952  std::ranges::forward_range ref_lengths_type,
953  alignment_file_output_format file_format>
954 alignment_file_output(stream_type &,
955  ref_ids_type &&,
956  ref_lengths_type &&,
957  file_format const &)
959  type_list<file_format>,
962 
963 } // namespace seqan3
seqan3::alignment_file_output_options
The options type defines various option members that influence the behavior of all or some formats.
Definition: output_options.hpp:22
misc.hpp
Provides helper data structures for the seqan3::alignment_file_output.
seqan3::field::seq
The "sequence", usually a range of nucleotides or amino acids.
seqan3::alignment_file_output::size_type
void size_type
The size type (void).
Definition: output.hpp:249
std::span
fstream
seqan3::alignment_file_output::sentinel
std::ranges::default_sentinel_t sentinel
The type returned by end().
Definition: output.hpp:257
misc_output.hpp
Provides various utility functions required only for output.
seqan3::alignment_file_output::options
alignment_file_output_options options
The options are public and its members can be set directly.
Definition: output.hpp:698
std::string_view
tuple.hpp
Provides seqan3::tuple_like.
seqan3::field::offset
Sequence (SEQ) relative start position (0-based), unsigned value.
concept.hpp
Stream concepts.
seqan3::alignment_file_output::const_reference
void const_reference
The const reference type (void).
Definition: output.hpp:247
seqan3::alignment_file_output::~alignment_file_output
~alignment_file_output()=default
Destructor is defaulted.
std::pair
vector
seqan3::alignment_file_output::end
sentinel end() noexcept
Returns a sentinel for comparison with iterator.
Definition: output.hpp:486
seqan3::alignment_file_output::value_type
void value_type
The value type (void).
Definition: output.hpp:243
seqan3::field::id
The identifier, usually a string.
format_sam.hpp
Provides the seqan3::format_sam.
seqan3::views::move
const auto move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:68
seqan3::alignment_file_output
A class for writing alignment files, e.g. SAM, BAL, BLAST, ...
Definition: output.hpp:186
std::tuple
record.hpp
Provides the seqan3::record template and the seqan3::field enum.
std::function
filesystem
This header includes C++17 filesystem support and imports it into namespace seqan3::filesystem (indep...
seqan3::alignment_file_output::stream_char_type
char stream_char_type
Character type of the stream(s).
Definition: output.hpp:198
seqan3::field::bit_score
The bit score (statistical significance indicator), unsigned value.
seqan3::field::ref_seq
The (reference) "sequence" information, usually a range of nucleotides or amino acids.
seqan3::field::ref_offset
Sequence (REF_SEQ) relative start position (0-based), unsigned value.
std::filesystem::path
seqan3::alignment_file_output::alignment_file_output
alignment_file_output(stream_type &stream, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from an existing stream and with specified format.
Definition: output.hpp:336
seqan3::pack_traits::contains
constexpr bool contains
Whether a type occurs in a pack or not.
Definition: traits.hpp:193
seqan3::fields
A class template that holds a choice of seqan3::field.
Definition: record.hpp:165
std::tie
T tie(T... args)
seqan3::alignment_file_output::push_back
void push_back(record_t &&r)
Write a seqan3::record to the file.
Definition: output.hpp:510
same_as
The concept std::same_as<T, U> is satisfied if and only if T and U denote the same type.
seqan3::alignment_file_output::header
auto & header()
Access the file's header.
Definition: output.hpp:719
seqan3::alignment_file_output::alignment_file_output
alignment_file_output(stream_type &&stream, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: output.hpp:352
seqan3::field::cigar
The cigar vector (std::vector<seqan3::cigar>) representing the alignment in SAM/BAM format.
seqan3::alignment_file_output::operator=
alignment_file_output & operator=(alignment_file_output const &)=delete
Copy assignment is explicitly deleted, because you can't have multiple access to the same file.
seqan3::sam_flag::none
None of the flags below are set.
std::basic_ostream
std::forward
T forward(T... args)
seqan3::alignment_file_output::push_back
void push_back(tuple_t &&t)
Write a record in form of a std::tuple to the file.
Definition: output.hpp:559
std::ofstream
seqan3::field::mapq
The mapping quality of the SEQ alignment, usually a ohred-scaled score.
seqan3::alignment_file_output::valid_formats
valid_formats_ valid_formats
A seqan3::type_list with the possible formats.
Definition: output.hpp:196
exception.hpp
Provides exceptions used in the I/O module.
header.hpp
Provides the seqan3::alignment_file_header class.
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
alignment_file_output_format
The generic concept for alignment file out formats.
std::logic_error
seqan3::alignment_file_output::operator=
alignment_file_output & operator=(rng_t &&range)
Write a range of records (or tuples) to the file.
Definition: output.hpp:637
seqan3::field::tags
The optional tags in the SAM format, stored in a dictionary.
seqan3::alignment_file_output::emplace_back
void emplace_back(arg_t &&arg, arg_types &&... args)
Write a record to the file by passing individual fields.
Definition: output.hpp:610
output_options.hpp
Provides seqan3::alignment_file_output_options.
seqan3::pack_traits::size
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:116
seqan3::alignment_file_output::alignment_file_output
alignment_file_output(std::filesystem::path filename, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from filename.
Definition: output.hpp:301
tuple_like
Whether a type behaves like a tuple.
seqan3::alignment_file_output::const_iterator
void const_iterator
The const iterator type is void, because files are not const-iterable.
Definition: output.hpp:255
ranges
Adaptations of concepts from the Ranges TS.
seqan3::sam_tag_dictionary
The SAM tag dictionary class that stores all optional SAM fields.
Definition: sam_tag_dictionary.hpp:324
format_bam.hpp
Provides the seqan3::format_bam.
std::remove_reference_t
seqan3::alignment_file_output::reference
void reference
The reference type (void).
Definition: output.hpp:245
cassert
seqan3::field::ref_id
The identifier of the (reference) sequence that SEQ was aligned to.
seqan3::field
field
An enumerator for the fields used in file formats.
Definition: record.hpp:64
seqan3::alignment_file_output::selected_field_ids
selected_field_ids_ selected_field_ids
A seqan3::fields list with the fields selected for the record.
Definition: output.hpp:194
seqan3::record
The class template that file records are based on; behaves like an std::tuple.
Definition: record.hpp:225
std::ptrdiff_t
std::visit
T visit(T... args)
output_format_concept.hpp
Provides seqan3::alignment_file_output_format and auxiliary classes.
seqan3::alignment_file_output::operator|
friend alignment_file_output & operator|(rng_t &&range, alignment_file_output &f)
Write a range of records (or tuples) to the file.
Definition: output.hpp:676
seqan3::field::qual
The qualities, usually in phred-score notation.
std::optional
out_file_iterator.hpp
Provides the seqan3::detail::out_file_iterator class template.
seqan3::alignment_file_output::begin
iterator begin() noexcept
Returns an iterator to current position in the file.
Definition: output.hpp:467
seqan3::field::flag
The alignment flag (bit information), uint16_t value.
seqan3::alignment_file_output::operator|
friend alignment_file_output operator|(rng_t &&range, alignment_file_output &&f)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: output.hpp:687
seqan3::alignment_file_output::alignment_file_output
alignment_file_output(stream_type &&stream, ref_ids_type_ &&ref_ids, ref_lengths_type &&ref_lengths, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from an existing stream and with specified format.
Definition: output.hpp:435
seqan3::alignment_file_output::iterator
detail::out_file_iterator< alignment_file_output > iterator
The iterator type of this view (an output iterator).
Definition: output.hpp:253
seqan3::alignment_file_output::alignment_file_output
alignment_file_output()=delete
Default constructor is explicitly deleted, you need to give a stream or file name.
traits.hpp
Provides traits for seqan3::type_list.
std::unique_ptr
forwarding_range
Specifies a range whose iterators may outlive the range and remain valid.
seqan3::alignment_file_output::alignment_file_output
alignment_file_output(std::filesystem::path const &filename, ref_ids_type_ &&ref_ids, ref_lengths_type &&ref_lengths, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from filename.
Definition: output.hpp:397
string_view
seqan3::field::header_ptr
A pointer to the seqan3::alignment_file_header object storing header information.
seqan3::field::evalue
The e-value (length normalized bit score), double value.
seqan3::field::alignment
The (pairwise) alignment stored in an seqan3::alignment object.
variant
seqan3::field::mate
The mate pair information given as a std::tuple of reference name, offset and template length.
string