Skip to content
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
30 changes: 15 additions & 15 deletions src/common/io/graph/cigar.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ namespace cigar::grammar {
auto integer = dsl::if_(dsl::lit_c < '-' > ) + dsl::digits<>.no_leading_zero();
auto fraction = dsl::lit_c < '.' > >> dsl::digits<>;
auto exp_char = dsl::lit_c < 'e' > | dsl::lit_c<'E'>;
auto exponent = exp_char >> (dsl::lit_c < '+' > | dsl::lit_c < '-' > ) + dsl::digits<>;
auto exponent = exp_char >> ((dsl::lit_c < '+' > | dsl::lit_c < '-' > ) + dsl::digits<>);
return dsl::peek(dsl::lit_c < '-' > / dsl::digit<>) >>
dsl::position +
(dsl::position +
integer +
dsl::if_(fraction) +
dsl::if_(exponent) +
dsl::position;
dsl::position);
}();

static constexpr auto value = lexy::callback<float>(
Expand All @@ -64,17 +64,17 @@ namespace cigar::grammar {

static constexpr auto rule = [] {
auto colon = dsl::lit_c<':'>;
return dsl::p<tag_name> >> colon +
(
dsl::capture(LEXY_LIT("A")) >> colon + dsl::p < tag_character > |
dsl::capture(LEXY_LIT("i")) >> colon + dsl::p < tag_integer > |
dsl::capture(LEXY_LIT("f")) >> colon + dsl::p < tag_float > |
dsl::capture(LEXY_LIT("Z")) >> colon + dsl::p < tag_string > |
dsl::capture(LEXY_LIT("J")) >> colon + dsl::p < tag_string > |
dsl::capture(LEXY_LIT("H")) >> colon + dsl::p < tag_string > |
dsl::capture(LEXY_LIT("B")) >> colon + dsl::p < tag_string > |
return dsl::p<tag_name> >> (
colon + (
dsl::capture(LEXY_LIT("A")) >> (colon + dsl::p < tag_character >) |
dsl::capture(LEXY_LIT("i")) >> (colon + dsl::p < tag_integer >) |
dsl::capture(LEXY_LIT("f")) >> (colon + dsl::p < tag_float >) |
dsl::capture(LEXY_LIT("Z")) >> (colon + dsl::p < tag_string >) |
dsl::capture(LEXY_LIT("J")) >> (colon + dsl::p < tag_string >) |
dsl::capture(LEXY_LIT("H")) >> (colon + dsl::p < tag_string >) |
dsl::capture(LEXY_LIT("B")) >> (colon + dsl::p < tag_string >) |
dsl::error<invalid_tag_type>
);
));
}();

static constexpr auto value = lexy::callback<cigar::tag>(
Expand All @@ -101,7 +101,7 @@ namespace cigar::grammar {
static constexpr auto value = lexy::callback<cigar::cigarop>(
[]() { return cigar::cigarop{0, 0}; },
[](std::uint32_t cnt, auto lexeme) {
return cigar::cigarop{cnt, lexeme[0]};
return cigar::cigarop{cnt & 0xFFFFFF, lexeme[0]};
});
};

Expand All @@ -116,7 +116,7 @@ namespace cigar::grammar {

static constexpr auto rule = [] {
auto tags = dsl::list(dsl::p<tag>, dsl::trailing_sep(tab));
return dsl::eof | (tab >> tags + dsl::eof);
return dsl::eof | (tab >> (tags + dsl::eof));
}();
static constexpr auto value = lexy::as_list<std::vector<cigar::tag>>;
};
Expand Down
22 changes: 11 additions & 11 deletions src/common/io/graph/gfa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ struct segment {
static constexpr auto name = "GFA segment";

static constexpr auto rule =
LEXY_LIT("S") >>
LEXY_LIT("S") >> (
tab + dsl::p<segment_name> +
tab + (LEXY_LIT("*") |
dsl::identifier(dsl::ascii::alpha)) +
dsl::p<opt_tags>;
dsl::p<opt_tags>);
static constexpr auto value = lexy::construct<gfa::segment>;
};

Expand All @@ -103,13 +103,13 @@ struct link {
static constexpr auto name = "GFA link line";

static constexpr auto rule =
LEXY_LIT("L") >>
LEXY_LIT("L") >> (
tab + dsl::p<segment_name> +
tab + dsl::p<segment_orientation> +
tab + dsl::p<segment_name> +
tab + dsl::p<segment_orientation> +
tab + (LEXY_LIT("*") | dsl::p<cigar_string>) +
dsl::p<opt_tags>;
dsl::p<opt_tags>);
static constexpr auto value = lexy::construct<gfa::link>;
};

Expand All @@ -127,13 +127,13 @@ struct gaplink {
static constexpr auto name = "GFA jump line";

static constexpr auto rule =
LEXY_LIT("J") >>
LEXY_LIT("J") >> (
tab + dsl::p<segment_name> +
tab + dsl::p<segment_orientation> +
tab + dsl::p<segment_name> +
tab + dsl::p<segment_orientation> +
tab + (LEXY_LIT("*") | (dsl::else_ >> dsl::p<segment_distance>)) +
dsl::p<opt_tags>;
dsl::p<opt_tags>);
static constexpr auto value = lexy::construct<gfa::gaplink>;
};

Expand All @@ -159,11 +159,11 @@ struct path {
};

static constexpr auto rule =
LEXY_LIT("P") >>
LEXY_LIT("P") >> (
tab + dsl::p<segment_name> +
tab + dsl::p<segments> +
tab + (LEXY_LIT("*") | dsl::p<overlaps>) +
dsl::p<opt_tags>;
dsl::p<opt_tags>);
static constexpr auto value = lexy::construct<gfa::path>;
};

Expand Down Expand Up @@ -209,14 +209,14 @@ struct walk {
};

static constexpr auto rule =
LEXY_LIT("W") >>
LEXY_LIT("W") >> (
tab + dsl::p<sample_id> + // SampleId
tab + dsl::integer<unsigned> + // HapIndex
tab + dsl::p<sequence_id> + // SeqId
tab + dsl::p<opt_uint64_t> + // SeqStart
tab + dsl::p<opt_uint64_t> + // SeqEnd
tab + dsl::p<wsegments> + // Walk
dsl::p<opt_tags>;
dsl::p<opt_tags>);
static constexpr auto value = lexy::construct<gfa::walk>;
};

Expand All @@ -241,7 +241,7 @@ struct record {
dsl::p<walk> |
comment |
// Explicitly ignore all other records (though require proper tab-delimited format)
dsl::ascii::alpha >> tab + dsl::until(dsl::newline).or_eof() |
dsl::ascii::alpha >> (tab + dsl::until(dsl::newline).or_eof()) |
dsl::error<expected_gfa_record>;
}();

Expand Down
2 changes: 1 addition & 1 deletion src/common/modules/genome_consistance_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void GenomeConsistenceChecker::Fill() {
}

vector<size_t> theoretic_lens;
for (const auto &prefix: vector<std::string>{"0_", "1_"}) {
for (auto prefix: {"0_", "1_"}) {
for (const auto &chr: genome.GetChromosomes()) {
string label = prefix + chr.name;
INFO("Spelling label " << label);
Expand Down
Loading