Skip to content

Commit ffb1ab2

Browse files
committed
Merge branch 'v2.7' into 'master'
v2.7.1 See merge request stat/graphtyper-github!2
2 parents b1a69e8 + 63a3b38 commit ffb1ab2

File tree

13 files changed

+61
-33
lines changed

13 files changed

+61
-33
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include(ExternalProject)
66
# The version number
77
set (graphtyper_VERSION_MAJOR 2)
88
set (graphtyper_VERSION_MINOR 7)
9-
set (graphtyper_VERSION_PATCH 0)
9+
set (graphtyper_VERSION_PATCH 1)
1010
set(STATIC_DIR "" CACHE STRING "If set, GraphTyper will be built as a static binary using libraries from the given STATIC_DIR.")
1111

1212
# Get the current working branch

include/graphtyper/utilities/options.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Options
8484
bool is_csi{false};
8585
bool force_align_both_orientations{false};
8686
int sam_flag_filter{3840};
87-
long max_files_open{576}; // Maximum amount of SAM/BAM/CRAM files can be opened at the same time
87+
long max_files_open{864}; // Maximum amount of SAM/BAM/CRAM files can be opened at the same time
8888
long soft_cap_of_variants_in_100_bp_window{22};
8989
bool get_sample_names_from_filename{false};
9090
bool output_all_variants{false};

src/graph/constructor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ add_var_record(std::vector<VarRecord> & var_records,
16921692
assert(key == "GT_HAPLOTYPE");
16931693
auto const val_ul = std::stoul(val_str);
16941694
ref.anti_events.insert(val_ul);
1695-
alt.anti_events.insert(-val_ul);
1695+
//alt.anti_events.insert(-val_ul);
16961696
}
16971697
} // for (auto const & val : values)
16981698
} // for (auto const & info : infos)

src/typer/caller.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ namespace
4747

4848
#ifndef NDEBUG
4949
std::string const debug_read_name = "HISEQ1:33:H9YY4ADXX:1:2110:2792:58362/2";
50-
long debug_event_pos{699214};
51-
char debug_event_type{'D'};
52-
std::size_t debug_event_size{3};
50+
long debug_event_pos{15001};
51+
char debug_event_type{'X'};
52+
std::size_t debug_event_size{1};
5353
#endif // NDEBUG
5454

5555

@@ -1017,13 +1017,13 @@ run_first_pass(bam1_t * hts_rec,
10171017
}
10181018
else
10191019
{
1020-
//#ifndef NDEBUG
1021-
// if (debug_event_type == 'X' && snp.pos == debug_event_pos)
1022-
// {
1023-
// BOOST_LOG_TRIVIAL(info) << __HERE__ << " debug snp has bad support " << snp.to_string() << " "
1024-
// << info.to_string() << " file_i=" << file_i;
1025-
// }
1026-
//#endif // DEBUG
1020+
#ifndef NDEBUG
1021+
if (debug_event_type == 'X' && snp.pos == debug_event_pos)
1022+
{
1023+
BOOST_LOG_TRIVIAL(info) << __HERE__ << " debug snp has bad support " << snp.to_string() << " "
1024+
<< info.to_string() << " file_i=" << file_i;
1025+
}
1026+
#endif // DEBUG
10271027

10281028
snp_it = bucket.events.erase(snp_it);
10291029
}
@@ -1233,9 +1233,10 @@ run_first_pass(bam1_t * hts_rec,
12331233
if (support_ratio < 0.3)
12341234
support_ratio = 0.3;
12351235

1236-
// 0 low coverage or ambigous
1236+
// 0 low coverage
12371237
// 1 support
12381238
// 2 anti support
1239+
// 3 ambigous
12391240
auto is_good_support =
12401241
[&cov_down, &region_begin, &support_ratio]
12411242
(long local_cov,
@@ -1285,7 +1286,7 @@ run_first_pass(bam1_t * hts_rec,
12851286
return IS_ANY_HAP_SUPPORT;
12861287
}
12871288

1288-
return 0;
1289+
return IS_ANY_ANTI_HAP_SUPPORT | IS_ANY_HAP_SUPPORT;
12891290
};
12901291

12911292
// check this bucket
@@ -2179,9 +2180,9 @@ realign_to_indels(std::vector<Tindel_events::iterator> const & realignment_indel
21792180

21802181
double const count = correction * (indel_info.hq_count + indel_info.lq_count);
21812182

2182-
bool const is_good_count = (indel_info.hq_count >= 5 && count >= 8.0) ||
2183-
(indel_info.span >= 9 && indel_info.hq_count >= 5 && count >= 7.0) ||
2184-
(indel_info.span >= 18 && indel_info.hq_count >= 4 && count >= 6.0);
2183+
bool const is_good_count = (indel_info.hq_count >= 5 && count >= 5.5) ||
2184+
(indel_info.span >= 5 && indel_info.hq_count >= 4 && count >= 5.0) ||
2185+
(indel_info.span >= 15 && indel_info.hq_count >= 3 && count >= 4.5);
21852186

21862187
#ifndef NDEBUG
21872188
if (debug_event_type == indel.type &&

src/typer/event.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ EventSupport::is_good_indel(uint32_t eps) const
321321
assert(sequence_reversed <= depth);
322322
long const qual = 3 * get_log_qual(hq_count + lq_count, anti_count, eps);
323323

324-
if (qual < 60)
324+
if (qual < 50)
325325
return false;
326326

327327
double const qd = static_cast<double>(qual) / static_cast<double>(depth);
328-
return qd >= 4.0;
328+
return qd >= 3.5;
329329
}
330330

331331

src/typer/variant.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,8 @@ Variant::generate_infos()
898898

899899
if (per_al.total_depth > 0 &&
900900
qd > 0.1 &&
901-
per_al.maximum_alt_support >= 3 &&
902-
per_al.maximum_alt_support_ratio >= 0.175)
901+
per_al.maximum_alt_support >= 2 &&
902+
per_al.maximum_alt_support_ratio >= 0.15)
903903
{
904904
double const alt_seq_depth = per_al.total_depth;
905905
double const _sb = 2.0 * ((static_cast<double>(sb_alt[s]) / alt_seq_depth) - 0.5);
@@ -1009,14 +1009,14 @@ Variant::generate_infos()
10091009
#ifndef NDEBUG
10101010
if (is_good_alt[a] == 0)
10111011
{
1012-
BOOST_LOG_TRIVIAL(debug) << __HERE__ << " In variant=" << to_string(true) // skip calls
1013-
<< " bad alt="
1014-
<< std::string(seqs[a + 1].begin(), seqs[a + 1].end())
1015-
<< " MaxAAS=" << per_al.maximum_alt_support
1016-
<< " MaxAASR=" << per_al.maximum_alt_support_ratio
1017-
<< " AAScore=" << aa_score[a]
1018-
<< " ABHom=" << info_abhom
1019-
<< " QDAlt=" << qd_alt[a];
1012+
BOOST_LOG_TRIVIAL(info) << __HERE__ << " In variant=" << to_string(true) // skip calls
1013+
<< " bad alt="
1014+
<< std::string(seqs[a + 1].begin(), seqs[a + 1].end())
1015+
<< " MaxAAS=" << per_al.maximum_alt_support
1016+
<< " MaxAASR=" << per_al.maximum_alt_support_ratio
1017+
<< " AAScore=" << aa_score[a]
1018+
<< " ABHom=" << info_abhom
1019+
<< " QDAlt=" << qd_alt[a];
10201020
}
10211021
#endif // NDEBUG
10221022
}

test/data/reference/index_test.fa

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ GGGGGGGGG
3030
>chr10
3131
GGGGGGGGGGGTGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
3232
GGGGGGGGG
33+
>chr11
34+
AAGGGCGGGGGTGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
35+
GGGGGGGGG

test/data/reference/index_test.fa.fai

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ chr7 280 878 70 71
88
chr8 79 1168 70 71
99
chr9 79 1255 70 71
1010
chr10 79 1343 70 71
11+
chr11 79 1431 70 71

test/data/reference/index_test.vcf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ chr9 5 . G A 0 . GT_ANTI_HAPLOTYPE=2;GT_ID=1
1515
chr9 10 . G GA 0 . GT_ID=2
1616
chr10 5 . G A 0 . GT_HAPLOTYPE=2;GT_ID=1
1717
chr10 10 . G GA 0 . GT_ID=2
18+
chr11 2 . AGGGC A 0 . GT_ANTI_HAPLOTYPE=2,3,4;GT_ID=1
19+
chr11 4 . G T 0 . GT_ANTI_HAPLOTYPE=4;GT_HAPLOTYPE=3;GT_ID=2
20+
chr11 5 . G T 0 . GT_ANTI_HAPLOTYPE=4;GT_ID=3
21+
chr11 6 . C T 0 . GT_ID=4

test/data/reference/index_test.vcf.gz

41 Bytes
Binary file not shown.
13 Bytes
Binary file not shown.

test/graph/test_constructor.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,30 @@ TEST_CASE("Construct test graph with anti events (chr10)")
533533
{
534534
REQUIRE(var_nodes[0].anti_events.size() == 1);
535535
REQUIRE(var_nodes[0].anti_events.count(2) == 1);
536-
REQUIRE(var_nodes[1].anti_events.size() == 1);
537-
REQUIRE(var_nodes[1].anti_events.count(-2) == 1);
536+
REQUIRE(var_nodes[1].anti_events.size() == 0);
538537
REQUIRE(var_nodes[2].anti_events.size() == 0);
539538
REQUIRE(var_nodes[3].anti_events.size() == 0);
540539
}
541540

542541
Options::instance()->add_all_variants = false;
543542
}
543+
544+
545+
TEST_CASE("Construct test graph with anti events (chr11)")
546+
{
547+
using namespace gyper;
548+
Options::instance()->add_all_variants = true;
549+
550+
BOOST_LOG_TRIVIAL(debug) << __HERE__ << " TEST CASE: Construct test graph (chr11).";
551+
create_test_graph("/test/data/reference/index_test.fa", "/test/data/reference/index_test.vcf.gz", "chr11", true);
552+
553+
std::vector<gyper::RefNode> const & ref_nodes = graph.ref_nodes;
554+
std::vector<gyper::VarNode> const & var_nodes = graph.var_nodes;
555+
556+
{
557+
REQUIRE(ref_nodes.size() == 2);
558+
REQUIRE(var_nodes.size() == 6);
559+
}
560+
561+
Options::instance()->add_all_variants = false;
562+
}

test/index/test_index.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ TEST_CASE("Test index chr10 with parity event")
455455
REQUIRE(labels[0].variant_id != labels[1].variant_id);
456456

457457
labels = ph_index.get(gyper::to_uint64("AGGGGGGTGGGGGGGGGGGGGGGGGGGGGGGG", 0));
458-
REQUIRE(labels.size() == 0);
458+
REQUIRE(labels.size() == 2);
459459

460460
labels = ph_index.get(gyper::to_uint64("AGGGGGAGTGGGGGGGGGGGGGGGGGGGGGGG", 0));
461461

0 commit comments

Comments
 (0)