Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MISC] Update biocpp-core and biocpp-io #239

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/variant_detection/variant_output.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <bio/io/var_io/writer.hpp>
#include <bio/io/var/writer.hpp>

#include "iGenVar.hpp" // for cmd_arguments
#include "structures/cluster.hpp" // for class Cluster
Expand All @@ -19,7 +19,7 @@ std::string transTime();
*/
void write_header(std::map<std::string, int32_t> & references_lengths,
std::string sample_name,
bio::io::var_io::header & hdr);
bio::io::var::header & hdr);

/*! \brief Detects genomic variants from junction clusters and saves them in a record vector.
*
Expand All @@ -43,7 +43,7 @@ void write_header(std::map<std::string, int32_t> & references_lengths,
void write_record(Cluster const & cluster,
cmd_arguments const & args,
bool & found_SV,
bio::io::var_io::record<> & record);
bio::io::var::record<> & record);

/*! \brief Detects genomic variants from junction clusters and prints them in output file in VCF format.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/biocpp-io
Submodule biocpp-io updated 94 files
+8 −3 .clang-format
+2 −0 .gitignore
+7 −22 doc/main_page.md
+1 −1 doc/record_based/1_introduction.md
+20 −20 doc/record_based/2_record_faq.md
+119 −11 include/bio/io.hpp
+0 −13 include/bio/io/all.hpp
+3 −21 include/bio/io/detail/concept.hpp
+1 −1 include/bio/io/detail/in_file_iterator.hpp
+1 −1 include/bio/io/detail/magic_get.hpp
+1 −1 include/bio/io/detail/out_file_iterator.hpp
+10 −34 include/bio/io/detail/range.hpp
+1 −1 include/bio/io/detail/to_string.hpp
+4 −4 include/bio/io/detail/tuple_record.hpp
+0 −12 include/bio/io/detail/utility.hpp
+1 −1 include/bio/io/detail/writer_base.hpp
+1 −1 include/bio/io/format/all.hpp
+4 −4 include/bio/io/format/bcf.hpp
+180 −186 include/bio/io/format/bcf_input_handler.hpp
+125 −122 include/bio/io/format/bcf_output_handler.hpp
+3 −3 include/bio/io/format/fasta.hpp
+5 −5 include/bio/io/format/fasta_input_handler.hpp
+3 −3 include/bio/io/format/fastq.hpp
+6 −6 include/bio/io/format/fastq_input_handler.hpp
+5 −4 include/bio/io/format/format_input_handler.hpp
+3 −3 include/bio/io/format/format_output_handler.hpp
+4 −4 include/bio/io/format/vcf.hpp
+91 −90 include/bio/io/format/vcf_input_handler.hpp
+40 −41 include/bio/io/format/vcf_output_handler.hpp
+1 −16 include/bio/io/misc.hpp
+1 −1 include/bio/io/misc/all.hpp
+2 −2 include/bio/io/misc/char_predicate.hpp
+0 −68 include/bio/io/platform.hpp
+1 −5 include/bio/io/seq/all.hpp
+14 −15 include/bio/io/seq/reader.hpp
+13 −14 include/bio/io/seq/reader_options.hpp
+52 −52 include/bio/io/seq/record.hpp
+1 −1 include/bio/io/stream/all.hpp
+5 −4 include/bio/io/stream/compression.hpp
+1 −1 include/bio/io/stream/concept.hpp
+2 −2 include/bio/io/stream/detail/bgzf_istream.hpp
+161 −168 include/bio/io/stream/detail/buffer_queue.hpp
+2 −3 include/bio/io/stream/transparent_istream.hpp
+2 −3 include/bio/io/stream/transparent_ostream.hpp
+1 −5 include/bio/io/txt/all.hpp
+16 −13 include/bio/io/txt/misc.hpp
+51 −56 include/bio/io/txt/reader.hpp
+31 −32 include/bio/io/txt/writer.hpp
+2 −6 include/bio/io/var/all.hpp
+23 −23 include/bio/io/var/header.hpp
+69 −71 include/bio/io/var/misc.hpp
+28 −28 include/bio/io/var/reader.hpp
+14 −14 include/bio/io/var/reader_options.hpp
+262 −210 include/bio/io/var/record.hpp
+27 −27 include/bio/io/var/writer.hpp
+8 −8 include/bio/io/var/writer_options.hpp
+1 −1 test/biocpp_require_core_infrastructure.cmake
+1 −1 test/documentation/bio_doxygen_cfg.in
+1 −1 test/documentation/doc_usr/CMakeLists.txt
+4 −4 test/snippet/detail/reader_base.cpp
+13 −13 test/snippet/seq/seq_reader.cpp
+0 −0 test/snippet/seq/seq_reader.out
+6 −6 test/snippet/seq/seq_reader_options.cpp
+5 −5 test/snippet/var/var_reader.cpp
+0 −0 test/snippet/var/var_reader.out
+6 −6 test/snippet/var/var_reader_options.cpp
+0 −0 test/snippet/var/var_reader_options.out
+19 −19 test/snippet/var/var_writer.cpp
+1 −1 test/unit/detail/index_tabix_test.cpp
+6 −5 test/unit/detail/tuple_record_test.cpp
+10 −11 test/unit/format/bcf_input_test.cpp
+5 −5 test/unit/format/bcf_output_test.cpp
+3 −3 test/unit/format/fasta_input_test.cpp
+3 −3 test/unit/format/fastq_input_test.cpp
+28 −29 test/unit/format/vcf_data.hpp
+25 −26 test/unit/format/vcf_input_test.cpp
+5 −5 test/unit/format/vcf_output_test.cpp
+0 −2 test/unit/plain_io/CMakeLists.txt
+1 −0 test/unit/seq/CMakeLists.txt
+0 −0 test/unit/seq/data.hpp
+260 −0 test/unit/seq/seq_reader_test.cpp
+0 −1 test/unit/seq_io/CMakeLists.txt
+0 −260 test/unit/seq_io/seq_io_reader_test.cpp
+2 −0 test/unit/txt/CMakeLists.txt
+32 −32 test/unit/txt/txt_reader_test.cpp
+13 −13 test/unit/txt/txt_writer_test.cpp
+5 −0 test/unit/var/CMakeLists.txt
+14 −14 test/unit/var/var_header_test.cpp
+361 −0 test/unit/var/var_reader_test.cpp
+37 −0 test/unit/var/var_record_test.cpp
+96 −99 test/unit/var/var_writer_test.cpp
+4 −4 test/unit/var/var_writer_test_issue53.cpp
+0 −4 test/unit/var_io/CMakeLists.txt
+0 −367 test/unit/var_io/var_io_reader_test.cpp
20 changes: 10 additions & 10 deletions src/variant_detection/variant_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ std::string transTime()

void write_header(std::map<std::string, int32_t> & references_lengths,
std::string sample_name,
bio::io::var_io::header & hdr)
bio::io::var::header & hdr)
{
hdr.file_format = "VCFv4.3";
// Default:
// hdr.filters.push_back({ .id = "PASS", .description = "All filters passed"});
hdr.infos.push_back({ .id = "END", .number = 1, .type_id = bio::io::var_io::value_type_id::int32,
hdr.infos.push_back({ .id = "END", .number = 1, .type_id = bio::io::var::value_type_id::int32,
.description = "End position of SV called."});
hdr.infos.push_back({ .id = "SVLEN", .number = 1, .type_id = bio::io::var_io::value_type_id::int32,
hdr.infos.push_back({ .id = "SVLEN", .number = 1, .type_id = bio::io::var::value_type_id::int32,
.description = "Difference in length between REF and ALT alleles."});
hdr.infos.push_back({ .id = "iGenVar_SVLEN", .number = 1, .type_id = bio::io::var_io::value_type_id::int32,
hdr.infos.push_back({ .id = "iGenVar_SVLEN", .number = 1, .type_id = bio::io::var::value_type_id::int32,
.description = "Length of SV called."});
hdr.infos.push_back({ .id = "SVTYPE", .number = 1, .type_id = bio::io::var_io::value_type_id::string,
hdr.infos.push_back({ .id = "SVTYPE", .number = 1, .type_id = bio::io::var::value_type_id::string,
.description = "Type of SV called."});
hdr.formats.push_back({ .id = "GT", .number = 1, .type_id = bio::io::var_io::value_type_id::string,
hdr.formats.push_back({ .id = "GT", .number = 1, .type_id = bio::io::var::value_type_id::string,
.description = "Genotype"});

for (auto const & [id, length] : references_lengths)
Expand All @@ -52,7 +52,7 @@ void write_header(std::map<std::string, int32_t> & references_lengths,
void write_record(Cluster const & cluster,
cmd_arguments const & args,
bool & found_SV,
bio::io::var_io::record<> & record)
bio::io::var::record<> & record)
{
Breakend mate1 = cluster.get_average_mate1();
Breakend mate2 = cluster.get_average_mate2();
Expand Down Expand Up @@ -150,18 +150,18 @@ void find_and_output_variants(std::map<std::string, int32_t> & references_length
cmd_arguments const & args,
std::filesystem::path const & output_file_path)
{
bio::io::var_io::header hdr{};
bio::io::var::header hdr{};
write_header(references_lengths, args.vcf_sample_name, hdr);

bio::io::var_io::record<> record{};
bio::io::var::record<> record{};
size_t amount_SVs = 0;
bool found_SV = false;

// Sets whether the standard C++ streams are synchronized to the standard C streams after each input/output operation.
std::ios::sync_with_stdio(false);

auto writer
= output_file_path.empty() ? bio::io::var_io::writer{std::cout, bio::io::vcf{}} : bio::io::var_io::writer{output_file_path};
= output_file_path.empty() ? bio::io::var::writer{std::cout, bio::io::vcf{}} : bio::io::var::writer{output_file_path};

writer.set_header(hdr);
for (size_t i = 0; i < clusters.size(); ++i)
Expand Down