1 #ifndef gamgee__synced_variant_reader__guard
2 #define gamgee__synced_variant_reader__guard
7 #include "../exceptions.h"
8 #include "../utils/hts_memory.h"
41 template<
class ITERATOR>
56 if (interval_list.empty()) {
57 m_synced_readers->require_index = 1;
62 throw HtslibException(success);
65 for (
const auto& filename : filenames) {
68 throw FileOpenException{filename};
76 SyncedVariantReader(SyncedVariantReader&& other) =
default;
77 SyncedVariantReader& operator=(SyncedVariantReader&& other) =
default;
82 SyncedVariantReader(
const SyncedVariantReader&) =
delete;
83 SyncedVariantReader& operator=(
const SyncedVariantReader&) =
delete;
92 return ITERATOR{m_synced_readers};
105 std::shared_ptr<bcf_srs_t> m_synced_readers;
Utility class to read multiple VCF.GZ/BCF files with an appropriate iterator in a for-each loop...
Definition: synced_variant_reader.h:42
SyncedVariantReader(const std::vector< std::string > &filenames, const std::string &interval_list)
opens multiple files (vcf or bcf) and allows an iterator to parse them
Definition: synced_variant_reader.h:52
ITERATOR begin() const
creates a ITERATOR pointing at the start of the input stream (needed by for-each loop) ...
Definition: synced_variant_reader.h:91
int bcf_sr_add_reader(bcf_srs_t *readers, const char *fname)
Definition: synced_bcf_reader.c:132
bcf_srs_t * bcf_sr_init(void)
Definition: synced_bcf_reader.c:245
int bcf_sr_set_regions(bcf_srs_t *readers, const char *regions, int is_file)
Definition: synced_bcf_reader.c:104
Definition: exceptions.h:9
std::shared_ptr< bcf_srs_t > make_shared_synced_variant_reader(bcf_srs_t *synced_reader_ptr)
wraps a pre-allocated bcf_srs_t in a shared_ptr with correct deleter
Definition: hts_memory.cpp:71
ITERATOR end() const
creates a ITERATOR with a nullified input stream (needed by for-each loop)
Definition: synced_variant_reader.h:100