diff --git a/Tests/DngCall/BamTest.cmake.in b/Tests/DngCall/BamTest.cmake.in index 5a5683e2..a0345201 100644 --- a/Tests/DngCall/BamTest.cmake.in +++ b/Tests/DngCall/BamTest.cmake.in @@ -21,7 +21,7 @@ set(TagLB-CMD @DNG_CALL_EXE@ --rgtag "LB" -f sample-5.3_ref.fasta.gz -p ceu.ped set(TagLB-WD "@TESTDATA_DIR@/sample_5_3/") set(TagLB-RESULT 0) set(TagLB-STDOUT - "FORMAT\tGL-1\tGL-2\tLB-NA12878-Solexa-135852\tLB-NA12891-Solexa-135851\tLB-NA12892-Solexa-135853" + "FORMAT\tGL-1_F@I_1\tGL-1_F@I_2\tLB-NA12878-Solexa-135852\tLB-NA12891-Solexa-135851\tLB-NA12892-Solexa-135853" ) ############################################################################### @@ -31,7 +31,7 @@ set(TagSM-CMD @DNG_CALL_EXE@ --rgtag "SM" -f sample-5.3_ref.fasta.gz -p ceu.ped set(TagSM-WD "@TESTDATA_DIR@/sample_5_3/") set(TagSM-RESULT 0) set(TagSM-STDOUT - "FORMAT\tGL-1\tGL-2\tLB-NA12878\tLB-NA12891\tLB-NA12892" + "FORMAT\tGL-1_F@I_1\tGL-1_F@I_2\tLB-NA12878\tLB-NA12891\tLB-NA12892" ) ############################################################################### @@ -41,7 +41,7 @@ set(TagID-CMD @DNG_CALL_EXE@ --rgtag "ID" -f sample-5.3_ref.fasta.gz -p ceu.ped set(TagID-WD "@TESTDATA_DIR@/sample_5_3/") set(TagID-RESULT 0) set(TagID-STDOUT - "FORMAT\tGL-1\tGL-2\tSM-NA12891\tSM-NA12892\tSM-NA12878\tLB-NA12878-H06HD.1\tLB-NA12878-H06HD.2\tLB-NA12878-H06JU\\.1\tLB-NA12891-H03N7\\.1\tLB-NA12891-H03N7\\.2\tLB-NA12891-H05F1\\.2\tLB-NA12892-H06JH\\.1\tLB-NA12892-H06JH\\.2\tLB-NA12892-H06JU\\.2" + "FORMAT\tGL-1_F@I_1\tGL-1_F@I_2\tSM-NA12891\tSM-NA12892\tSM-NA12878\tLB-NA12878-H06HD.1\tLB-NA12878-H06HD.2\tLB-NA12878-H06JU\\.1\tLB-NA12891-H03N7\\.1\tLB-NA12891-H03N7\\.2\tLB-NA12891-H05F1\\.2\tLB-NA12892-H06JH\\.1\tLB-NA12892-H06JH\\.2\tLB-NA12892-H06JU\\.2" ) ############################################################################### @@ -51,14 +51,14 @@ set(SepHeader1-CMD @DNG_CALL_EXE@ -f sample-5.3_ref.fasta.gz -p ceu.ped -m 0.001 set(SepHeader1-WD "@TESTDATA_DIR@/sep_header/") set(SepHeader1-RESULT 0) set(SepHeader1-STDOUT - "FORMAT\tGL-1\tGL-2\tLB-NA12878-Solexa-135852\tLB-NA12891-Solexa-135851\tLB-NA12892-Solexa-135853" + "FORMAT\tGL-1_F@I_1\tGL-1_F@I_2\tLB-NA12878-Solexa-135852\tLB-NA12891-Solexa-135851\tLB-NA12892-Solexa-135853" ) set(SepHeader2-CMD @DNG_CALL_EXE@ -f sample-5.3_ref.fasta.gz -p ceu.ped -m 0.001 -h test1_hdr.sam test1_nohdr.sam) set(SepHeader2-WD "@TESTDATA_DIR@/sep_header/") set(SepHeader2-RESULT 0) set(SepHeader2-STDOUT - "FORMAT\tGL-1\tGL-2\tLB-NA12878-Solexa-135852\tLB-NA12891-Solexa-135851\tLB-NA12892-Solexa-135853" + "FORMAT\tGL-1_F@I_1\tGL-1_F@I_2\tLB-NA12878-Solexa-135852\tLB-NA12891-Solexa-135851\tLB-NA12892-Solexa-135853" ) ############################################################################### diff --git a/Tests/Unit/dng/relationship_graph_m12.cc b/Tests/Unit/dng/relationship_graph_m12.cc index 16b8d22a..942dbb26 100644 --- a/Tests/Unit/dng/relationship_graph_m12.cc +++ b/Tests/Unit/dng/relationship_graph_m12.cc @@ -133,11 +133,11 @@ BOOST_FIXTURE_TEST_CASE(test_constructor, FixturePedigreeMid ) { auto labels = relationship_graph.labels(); const std::vector expected_labels = { - "GL-1", "GL-2", - "GL-4", "GL-5", - "GL-9", "GL-10", - "GL-3", "GL-6", - "GL-11", "GL-8", + "GL-1_F@I_1", "GL-1_F@I_2", + "GL-1_F@I_4", "GL-1_F@I_5", + "GL-1_F@I_9", "GL-1_F@I_10", + "GL-1_F@I_3", "GL-1_F@I_6", + "GL-1_F@I_11", "GL-1_F@I_8", "LB-NA12001:Solexa-001", "LB-NA12002:Solexa-002", "LB-NA12003:Solexa-003", "LB-NA12004:Solexa-004", "LB-NA12005:Solexa-005", "LB-NA12006:Solexa-006", @@ -427,12 +427,12 @@ BOOST_FIXTURE_TEST_CASE(test_add_lib_from_rgs, FixturePedigreeMid) { std::vector expected_vertex{ "GL-unknown", - "GL-1", "GL-2", - "GL-4", "GL-5", - "GL-9", "GL-10", - "GL-3", "GL-6", "GL-11", - "GL-7", "GL-8", - "GL-12", + "GL-1_F@I_1", "GL-1_F@I_2", + "GL-1_F@I_4", "GL-1_F@I_5", + "GL-1_F@I_9", "GL-1_F@I_10", + "GL-1_F@I_3", "GL-1_F@I_6", "GL-1_F@I_11", + "GL-1_F@I_7", "GL-1_F@I_8", + "GL-1_F@I_12", "SM-NA12001", "SM-NA12002", "SM-NA12004", "SM-NA12005", @@ -654,11 +654,11 @@ BOOST_FIXTURE_TEST_CASE(test_update_labels_node_ids, FixturePedigreeMid) { }; std::vector expected_labels { - "GL-1", "GL-2", - "GL-4", "GL-5", - "GL-9", "GL-10", - "GL-3", "GL-6", "GL-11", - "GL-8", + "GL-1_F@I_1", "GL-1_F@I_2", + "GL-1_F@I_4", "GL-1_F@I_5", + "GL-1_F@I_9", "GL-1_F@I_10", + "GL-1_F@I_3", "GL-1_F@I_6", "GL-1_F@I_11", + "GL-1_F@I_8", "LB-NA12001:Solexa-001", "LB-NA12002:Solexa-002", "LB-NA12003:Solexa-003", "LB-NA12004:Solexa-004", diff --git a/Tests/Unit/dng/relationship_graph_trio.cc b/Tests/Unit/dng/relationship_graph_trio.cc index b9aedc87..705555aa 100644 --- a/Tests/Unit/dng/relationship_graph_trio.cc +++ b/Tests/Unit/dng/relationship_graph_trio.cc @@ -69,8 +69,8 @@ BOOST_FIXTURE_TEST_CASE(test_constructor, FixturePedigree ) { auto labels = relationship_graph.labels(); const std::vector expected_labels = { - "GL-1", // founder 1 - "GL-2", // founder 2 + "GL-1_F@I_1", // founder 1 + "GL-1_F@I_2", // founder 2 "LB-NA12878:Solexa-135852", // lib 1 "LB-NA12891:Solexa-135851", // lib 2 "LB-NA12892:Solexa-135853" // lib 3 @@ -239,9 +239,9 @@ BOOST_FIXTURE_TEST_CASE(test_add_lib_from_rgs, ReadTrioFromFile) { std::vector expected_vertex{ "GL-unknown", - "GL-1", - "GL-2", - "GL-3", + "GL-1_F@I_1", + "GL-1_F@I_2", + "GL-1_F@I_3", "SM-NA12891", "SM-NA12892", "SM-NA12878", @@ -376,8 +376,8 @@ BOOST_FIXTURE_TEST_CASE(test_update_labels_node_ids, ReadTrioFromFile) { S_MAX,S_MAX,S_MAX,S_MAX, 2, 3, 4}; std::vector expected_labels { - "GL-1", - "GL-2", + "GL-1_F@I_1", + "GL-1_F@I_2", "LB-NA12878:Solexa-135852", "LB-NA12891:Solexa-135851", "LB-NA12892:Solexa-135853" diff --git a/src/include/dng/io/ped.h b/src/include/dng/io/ped.h index 1e1e0198..e954ef52 100644 --- a/src/include/dng/io/ped.h +++ b/src/include/dng/io/ped.h @@ -1,6 +1,8 @@ /* * Copyright (c) 2014-2015 Reed A. Cartwright + * Copyright (c) 2016 Steven H. Wu * Authors: Reed A. Cartwright + * Steven H. Wu * * This file is part of DeNovoGear. * @@ -40,6 +42,8 @@ namespace dng { namespace io { class Pedigree { + const std::string FAM_IND_DELIM = "_F@I_"; + public: typedef boost::multi_index_container child_names; child_names.emplace("", 0); for(k = 1; k < string_table.size(); ++k) { + string_table[k][1] = string_table[k][0] + FAM_IND_DELIM + string_table[k][1]; + string_table[k][2] = string_table[k][0] + FAM_IND_DELIM + string_table[k][2]; + string_table[k][3] = string_table[k][0] + FAM_IND_DELIM + string_table[k][3]; bool success = child_names.emplace(string_table[k][1], k).second; // If child name is duplicate, erase it if(!success) { diff --git a/src/include/dng/relationship_graph.h b/src/include/dng/relationship_graph.h index e54ad9a2..4a8ae2c0 100644 --- a/src/include/dng/relationship_graph.h +++ b/src/include/dng/relationship_graph.h @@ -35,7 +35,7 @@ #include #include -#define DEBUG_RGRAPH 1 +//#define DEBUG_RGRAPH 1 namespace dng {