Skip to content

Commit

Permalink
Ngsd annotate sv pathogenic (#611)
Browse files Browse the repository at this point in the history
* Added pathogenic class annotation in NGSDAnnotateSV
Added changelog entry for VcfBreakMulti and NGSDAnnotateCNV

* Refactored NGSDAnnotateSV to only annotate the pathogenic SV column

* Changed Description of NGSDAnnotateSV

---------

Co-authored-by: Kilian Ilius <[email protected]>
  • Loading branch information
KilianIlius and Kilian Ilius authored Dec 18, 2024
1 parent 9a5f717 commit 79ac725
Show file tree
Hide file tree
Showing 9 changed files with 194 additions and 553 deletions.
1 change: 1 addition & 0 deletions src/NGSDAnnotateCNV/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ConcreteTool
addFlag("test", "Uses the test database instead of on the production database.");

changeLog(2020, 2, 21, "Initial version.");
changeLog(2024, 11, 28, "Imporved annotation of overlapping pathogenic CNVs.");
}

virtual void main()
Expand Down
318 changes: 78 additions & 240 deletions src/NGSDAnnotateSV/main.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/VcfBreakMulti/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ConcreteTool: public ToolBase
addFlag("verbose", "Writes ignored VCF format errors to stderr.");

changeLog(2018, 10, 18, "Initial implementation.");
changeLog(2024, 11, 21, "Implemented handling of phased GT");
}

///Return ID from FORMAT/INFO line
Expand Down
45 changes: 1 addition & 44 deletions src/tools-TEST/NGSDAnnotateSV_Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,10 @@ private slots:
db.init();
db.executeQueriesFromFile(TESTDATA("data_in/NGSDAnnotateSV_init.sql"));

EXECUTE("NGSDAnnotateSV", "-test -debug -ps NA12878_46 -in " + TESTDATA("data_in/NGSDAnnotateSV_in1.bedpe") + " -out out/NGSDAnnotateSV_out1.bedpe");
EXECUTE("NGSDAnnotateSV", "-test -in " + TESTDATA("data_in/NGSDAnnotateSV_in1.bedpe") + " -out out/NGSDAnnotateSV_out1.bedpe");

COMPARE_FILES("out/NGSDAnnotateSV_out1.bedpe", TESTDATA("data_out/NGSDAnnotateSV_out1.bedpe"))
}

void artifical_svs_known_sample()
{
if (!NGSD::isAvailable(true)) SKIP("Test needs access to the NGSD test database!");

//init
NGSD db(true);
db.init();
db.executeQueriesFromFile(TESTDATA("data_in/NGSDAnnotateSV_init.sql"));

EXECUTE("NGSDAnnotateSV", "-test -debug -ps NA12878_45 -in " + TESTDATA("data_in/NGSDAnnotateSV_in1.bedpe") + " -out out/NGSDAnnotateSV_out2.bedpe");

COMPARE_FILES("out/NGSDAnnotateSV_out2.bedpe", TESTDATA("data_out/NGSDAnnotateSV_out2.bedpe"))
}

void artifical_svs_new_sample_ignore_ps()
{
if (!NGSD::isAvailable(true)) SKIP("Test needs access to the NGSD test database!");

//init
NGSD db(true);
db.init();
db.executeQueriesFromFile(TESTDATA("data_in/NGSDAnnotateSV_init.sql"));

EXECUTE("NGSDAnnotateSV", "-test -debug -ignore_processing_system -ps NA12878_46 -in " + TESTDATA("data_in/NGSDAnnotateSV_in1.bedpe") + " -out out/NGSDAnnotateSV_out3.bedpe");

COMPARE_FILES("out/NGSDAnnotateSV_out3.bedpe", TESTDATA("data_out/NGSDAnnotateSV_out3.bedpe"))
}

void artifical_svs_unknown_sample_name()
{
if (!NGSD::isAvailable(true)) SKIP("Test needs access to the NGSD test database!");

//init
NGSD db(true);
db.init();
db.executeQueriesFromFile(TESTDATA("data_in/NGSDAnnotateSV_init.sql"));

EXECUTE("NGSDAnnotateSV", "-test -debug -ps NA12878_invalid -in " + TESTDATA("data_in/NGSDAnnotateSV_in1.bedpe") + " -out out/NGSDAnnotateSV_out3.bedpe");

COMPARE_FILES("out/NGSDAnnotateSV_out3.bedpe", TESTDATA("data_out/NGSDAnnotateSV_out3.bedpe"))
}

};


86 changes: 43 additions & 43 deletions src/tools-TEST/data_in/NGSDAnnotateSV_in1.bedpe
Original file line number Diff line number Diff line change
Expand Up @@ -46,46 +46,46 @@
##FILTER=<ID=Ploidy,Description="For DEL & DUP variants, the genotypes of overlapping variants (with similar size) are inconsistent with diploid expectation">
##FILTER=<ID=SampleFT,Description="No sample passes all the sample-level filters (at the field FORMAT/FT)">
##FILTER=<ID=off-target,Description="Variant marked as 'off-target'.">
#CHROM_A START_A END_A CHROM_B START_B END_B ID QUAL STRAND_A STRAND_B TYPE FILTER NAME_A REF_A ALT_A NAME_B REF_B ALT_B INFO_A INFO_B FORMAT NA12878_46
chr1 1000 1020 chr1 12000 13000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr1 4 4 chr1 25000 25000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr3 1000 1020 chr3 12000 13000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr4 1000 1020 chr4 12000 13000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr1 1000 1020 chr1 52000 53000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr1 13000 13020 chr1 22000 23000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr1 500 520 chr1 1000 1000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr1 1000 1020 chr1 12000 13000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr1 101000 101020 chr1 112000 113000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr1 100004 100004 chr1 125000 125000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr3 101000 101020 chr3 112000 113000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr4 101000 101020 chr4 112000 113000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr1 101000 101020 chr1 152000 153000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr1 113000 113020 chr1 122000 123000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr1 100500 100520 chr1 101000 101000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr1 101000 101020 chr1 112000 113000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr1 9101000 9101020 chr1 9112000 9113000 MantaINV:0:0:0:0:0:0 999 . . INV PASS
chr1 9100004 9100004 chr1 9125000 9125000 MantaINV:0:0:0:0:0:0 999 . . INV PASS
chr3 9101000 9101020 chr3 9112000 9113000 MantaINV:0:0:0:0:0:0 999 . . INV PASS
chr4 9101000 9101020 chr4 9112000 9113000 MantaINV:0:0:0:0:0:0 999 . . INV PASS
chr1 9101000 9101020 chr1 9152000 9153000 MantaINV:0:0:0:0:0:0 999 . . INV PASS
chr1 9113000 9113020 chr1 9122000 9123000 MantaINV:0:0:0:0:0:0 999 . . INV PASS
chr1 9100500 9100520 chr1 9101000 9101000 MantaINV:0:0:0:0:0:0 999 . . INV PASS
chr1 9101000 9101020 chr1 9112000 9113000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
chr1 15482455 15482455 chr1 15482455 15482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr1 16482455 16482455 chr1 16482455 16482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr3 16482455 16482455 chr1 16482455 16482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr3 12482455 12482455 chr1 12482455 12482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr1 15482205 15482205 chr1 15482205 15482205 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr1 15482010 15482205 chr1 15482005 15482005 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr1 15482455 15482455 chr1 15482455 15482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr1 15482505 15482505 chr1 15482505 15482505 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr1 15482500 15482805 chr1 15482805 15482805 MantaINS:0:0:0:0:0:0 999 . . INS PASS
chr1 15482455 15482455 chr1 15482455 15482455 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS
chr1 9101000 9101020 chr5 4112000 4113000 MantaBND:0:0:0:0:0:0 999 . . BND PASS
chr1 9100004 9100004 chr5 4125000 4125000 MantaBND:0:0:0:0:0:0 999 . . BND PASS
chr3 9101000 9101020 chr5 4112000 4113000 MantaBND:0:0:0:0:0:0 999 . . BND PASS
chr4 9101000 9101020 chr5 4112000 4113000 MantaBND:0:0:0:0:0:0 999 . . BND PASS
chr1 9101000 9101020 chr5 4152000 4153000 MantaBND:0:0:0:0:0:0 999 . . BND PASS
chr1 9113000 9113020 chr5 4122000 4123000 MantaBND:0:0:0:0:0:0 999 . . BND PASS
chr1 9100500 9100520 chr5 4101000 4101000 MantaBND:0:0:0:0:0:0 999 . . BND PASS
chr1 9101000 9101020 chr5 4112000 4113000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS
#CHROM_A START_A END_A CHROM_B START_B END_B ID QUAL STRAND_A STRAND_B TYPE FILTER NAME_A REF_A ALT_A NAME_B REF_B ALT_B INFO_A INFO_B FORMAT NA12878_46 NGSD_COUNT NGSD_COUNT_OVERLAP
chr1 1000 1020 chr1 12000 13000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 1 (1.0000) 3
chr1 4 4 chr1 25000 25000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 0 (0.0000) 3
chr3 1000 1020 chr3 12000 13000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 1 (1.0000) 1
chr4 1000 1020 chr4 12000 13000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 0 (0.0000) 1
chr1 1000 1020 chr1 52000 53000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 0 (0.0000) 3
chr1 13000 13020 chr1 22000 23000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 0 (0.0000) 3
chr1 500 520 chr1 1000 1000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 0 (0.0000) 3
chr1 1000 1020 chr1 12000 13000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 0 (0.0000) 0
chr1 101000 101020 chr1 112000 113000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 1 (1.0000) 3
chr1 100004 100004 chr1 125000 125000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 0 (0.0000) 3
chr3 101000 101020 chr3 112000 113000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 1 (1.0000) 1
chr4 101000 101020 chr4 112000 113000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 0 (0.0000) 1
chr1 101000 101020 chr1 152000 153000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 0 (0.0000) 3
chr1 113000 113020 chr1 122000 123000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 0 (0.0000) 3
chr1 100500 100520 chr1 101000 101000 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 0 (0.0000) 3
chr1 101000 101020 chr1 112000 113000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 0 (0.0000) 0
chr1 9101000 9101020 chr1 9112000 9113000 MantaINV:0:0:0:0:0:0 999 . . INV PASS 1 (1.0000) 3
chr1 9100004 9100004 chr1 9125000 9125000 MantaINV:0:0:0:0:0:0 999 . . INV PASS 0 (0.0000) 3
chr3 9101000 9101020 chr3 9112000 9113000 MantaINV:0:0:0:0:0:0 999 . . INV PASS 1 (1.0000) 1
chr4 9101000 9101020 chr4 9112000 9113000 MantaINV:0:0:0:0:0:0 999 . . INV PASS 0 (0.0000) 1
chr1 9101000 9101020 chr1 9152000 9153000 MantaINV:0:0:0:0:0:0 999 . . INV PASS 0 (0.0000) 3
chr1 9113000 9113020 chr1 9122000 9123000 MantaINV:0:0:0:0:0:0 999 . . INV PASS 0 (0.0000) 3
chr1 9100500 9100520 chr1 9101000 9101000 MantaINV:0:0:0:0:0:0 999 . . INV PASS 0 (0.0000) 3
chr1 9101000 9101020 chr1 9112000 9113000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 0 (0.0000) 0
chr1 15482455 15482455 chr1 15482455 15482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS 1 (1.0000) 1
chr1 16482455 16482455 chr1 16482455 16482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS 1 (1.0000) 1
chr3 16482455 16482455 chr1 16482455 16482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS 0 (0.0000) 0
chr3 12482455 12482455 chr1 12482455 12482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS 1 (1.0000) 1
chr1 15482205 15482205 chr1 15482205 15482205 MantaINS:0:0:0:0:0:0 999 . . INS PASS 1 (1.0000) 1
chr1 15482010 15482205 chr1 15482005 15482005 MantaINS:0:0:0:0:0:0 999 . . INS PASS 1 (1.0000) 1
chr1 15482455 15482455 chr1 15482455 15482455 MantaINS:0:0:0:0:0:0 999 . . INS PASS 1 (1.0000) 1
chr1 15482505 15482505 chr1 15482505 15482505 MantaINS:0:0:0:0:0:0 999 . . INS PASS 0 (0.0000) 0
chr1 15482500 15482805 chr1 15482805 15482805 MantaINS:0:0:0:0:0:0 999 . . INS PASS 0 (0.0000) 0
chr1 15482455 15482455 chr1 15482455 15482455 MantaDUP:0:0:0:0:0:0 999 . . DUP PASS 0 (0.0000) 0
chr1 9101000 9101020 chr5 4112000 4113000 MantaBND:0:0:0:0:0:0 999 . . BND PASS 2 (2.0000) 2
chr1 9100004 9100004 chr5 4125000 4125000 MantaBND:0:0:0:0:0:0 999 . . BND PASS 0 (0.0000) 0
chr3 9101000 9101020 chr5 4112000 4113000 MantaBND:0:0:0:0:0:0 999 . . BND PASS 1 (1.0000) 1
chr4 9101000 9101020 chr5 4112000 4113000 MantaBND:0:0:0:0:0:0 999 . . BND PASS 0 (0.0000) 0
chr1 9101000 9101020 chr5 4152000 4153000 MantaBND:0:0:0:0:0:0 999 . . BND PASS 0 (0.0000) 0
chr1 9113000 9113020 chr5 4122000 4123000 MantaBND:0:0:0:0:0:0 999 . . BND PASS 0 (0.0000) 0
chr1 9100500 9100520 chr5 4101000 4101000 MantaBND:0:0:0:0:0:0 999 . . BND PASS 0 (0.0000) 0
chr1 9101000 9101020 chr5 4112000 4113000 MantaDEL:0:0:0:0:0:0 999 . . DEL PASS 0 (0.0000) 0
28 changes: 27 additions & 1 deletion src/tools-TEST/data_in/NGSDAnnotateSV_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ INSERT INTO `processed_sample`(`id`, `sample_id`, `process_id`, `sequencing_run_
(4007, 1, 47, 1, '1,2,3,4', 165, 1, 'bad'),
(4008, 1, 48, 1, '1,2,3,4', 165, 1, 'good');

INSERT INTO `report_configuration` (`id`, `processed_sample_id`, `created_by`, `created_date`) VALUES
(1, 4001, 99, '2020-01-01');

INSERT INTO `sv_callset` (`id`, `processed_sample_id`, `caller`, `caller_version`, `call_date`) VALUES
(1, 4001, 'Manta', '1.6.0', '2020-01-01'),
(2, 4000, 'Manta', '1.5.0', '2019-08-13'),
Expand Down Expand Up @@ -119,5 +122,28 @@ INSERT INTO `sv_translocation` (`id`, `sv_callset_id`, `chr1`, `start1`, `end1`,
(5, 3, 'chr1', 9101000, 9101020, 'chr5', 4120000, 4120000, ''),
(6, 3, 'chr1', 9101000, 9101020, 'chr5', 4120000, 4120000, ''),
(7, 1, 'chr3', 9101000, 9101020, 'chr5', 4112000, 4113000, ''),
(8, 1, 'chr4', 9101000, 9101020, 'chr5', 4120000, 4120000, '');
(8, 1, 'chr4', 9101000, 9101020, 'chr5', 4120000, 4120000, ''),
(11, 1, 'chr1', 9100990, 9101010, 'chr5', 4112999, 4114000, '');

INSERT INTO `report_configuration_sv` (`id`, `report_configuration_id`, `sv_deletion_id`, `sv_duplication_id`, `sv_insertion_id`, `sv_inversion_id`, `sv_translocation_id`, `type`, `causal`, `class`, `inheritance`, `de_novo`, `mosaic`, `compound_heterozygous`, `exclude_artefact`, `exclude_frequency`, `exclude_phenotype`, `exclude_mechanism`, `exclude_other`, `comments`, `comments2`) VALUES
(1, 1, NULL, NULL, NULL, NULL, 1, 'diagnostic variant', false, '5', 'n/a', false, false, false, false, false, false, false, false, false, false),
(2, 1, NULL, NULL, NULL, 4, NULL, 'diagnostic variant', false, '4', 'n/a', false, false, false, false, false, false, false, false, false, false),
(3, 1, NULL, NULL, 7, NULL, NULL, 'diagnostic variant', false, '5', 'n/a', false, false, false, false, false, false, false, false, false, false),
(4, 1, NULL, 41, NULL, NULL, NULL, 'diagnostic variant', false, '4', 'n/a', false, false, false, false, false, false, false, false, false, false),
(5, 1, 11, NULL, NULL, NULL, NULL, 'diagnostic variant', false, '5', 'n/a', false, false, false, false, false, false, false, false, false, false),
(6, 1, NULL, NULL, NULL, NULL, 3, 'diagnostic variant', false, '3', 'n/a', false, false, false, false, false, false, false, false, false, false),
(7, 1, NULL, NULL, NULL, 2, NULL, 'diagnostic variant', false, '4', 'n/a', false, false, false, false, false, false, false, false, false, false),
(8, 1, NULL, NULL, 1, NULL, NULL, 'diagnostic variant', false, '3', 'n/a', false, false, false, false, false, false, false, false, false, false),
(11, 1, NULL, 25, NULL, NULL, NULL, 'diagnostic variant', false, '4', 'n/a', false, false, false, false, false, false, false, false, false, false),
(21, 1, 2, NULL, NULL, NULL, NULL, 'diagnostic variant', false, '5', 'n/a', false, false, false, false, false, false, false, false, false, false),
(31, 1, NULL, NULL, NULL, NULL, 4, 'diagnostic variant', false, '3', 'n/a', false, false, false, false, false, false, false, false, false, false),
(41, 1, NULL, NULL, NULL, 1, NULL, 'diagnostic variant', false, '3', 'n/a', false, false, false, false, false, false, false, false, false, false),
(51, 1, NULL, NULL, 2, NULL, NULL, 'diagnostic variant', false, '5', 'n/a', false, false, false, false, false, false, false, false, false, false),
(61, 1, NULL, 7, NULL, NULL, NULL, 'diagnostic variant', false, '5', 'n/a', false, false, false, false, false, false, false, false, false, false),
(71, 1, 81, NULL, NULL, NULL, NULL, 'diagnostic variant', false, '5', 'n/a', false, false, false, false, false, false, false, false, false, false),
(81, 1, NULL, NULL, NULL, NULL, 7, 'diagnostic variant', false, '4', 'n/a', false, false, false, false, false, false, false, false, false, false),
(15, 1, NULL, NULL, NULL, 8, NULL, 'diagnostic variant', false, '4', 'n/a', false, false, false, false, false, false, false, false, false, false),
(25, 1, NULL, NULL, 3, NULL, NULL, 'diagnostic variant', false, '3', 'n/a', false, false, false, false, false, false, false, false, false, false),
(35, 1, NULL, 75, NULL, NULL, NULL, 'diagnostic variant', false, '4', 'n/a', false, false, false, false, false, false, false, false, false, false),
(45, 1, 15, NULL, NULL, NULL, NULL, 'diagnostic variant', false, '2', 'n/a', false, false, false, false, false, false, false, false, false, false),
(55, 1, NULL, NULL, NULL, NULL, 11, 'diagnostic variant', false, '5', 'n/a', false, false, false, false, false, false, false, false, false, false);
Loading

0 comments on commit 79ac725

Please sign in to comment.