Skip to content

Commit

Permalink
[FEATURE] Add Tandem Dup to the output vcf
Browse files Browse the repository at this point in the history
Signed-off-by: Lydia Buntrock <lydia.buntrock@fu-berlin.de>
  • Loading branch information
Irallia committed Aug 19, 2021
1 parent b181905 commit e37ebc5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/variant_detection/variant_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ void find_and_output_variants(std::map<std::string, int32_t> & references_length
tmp.add_info("END", std::to_string(mate2_pos));
tmp.print(out_stream);
}
//Tandem Duplication
else if (distance >= args.min_var_length &&
distance <= args.max_var_length &&
clusters[i].get_common_tandem_dup_count() > 0 &&
insert_size >= args.min_var_length)
{
variant_record tmp{};
tmp.set_chrom(mate1.seq_name);
tmp.set_qual(cluster_size);
tmp.set_alt("<DUP:TANDEM>");
tmp.add_info("SVTYPE", "DUP");
// Increment position by 1 because VCF is 1-based
tmp.set_pos(mate1_pos + 1);
tmp.add_info("SVLEN", std::to_string(distance));
// Increment end by 1 because VCF is 1-based
tmp.add_info("END", std::to_string(mate2_pos + 1));
tmp.print(out_stream);
}
//Insertion
else if (distance == 1 &&
insert_size >= args.min_var_length)
Expand Down
2 changes: 1 addition & 1 deletion test/data/datasources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ declare_datasource (FILE output_err.txt
# copies file to <build>/data/output_res.txt
declare_datasource (FILE output_res.txt
URL ${CMAKE_SOURCE_DIR}/test/data/mini_example/output_res.txt
URL_HASH SHA256=7f52103b216002598f8a50bd3f27f430798de7ffc03ae26c92bf3281ed338164)
URL_HASH SHA256=81f861156dfdff027df053e996a1dfaeccf15131ce81c5ccb350148fc912a8c7)
1 change: 1 addition & 0 deletions test/data/mini_example/output_res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
chr1 57 . N <DEL> 9 PASS END=70;SVLEN=-13;SVTYPE=DEL GT ./.
chr1 97 . N <DEL> 1 PASS END=125;SVLEN=-28;SVTYPE=DEL GT ./.
chr1 125 . N <INS> 3 PASS END=125;SVLEN=15;SVTYPE=INS GT ./.
chr1 180 . N <DUP:TANDEM> 1 PASS END=188;SVLEN=8;SVTYPE=DUP GT ./.
chr1 266 . N <DEL> 4 PASS END=286;SVLEN=-20;SVTYPE=DEL GT ./.
chr1 282 . N <DEL> 1 PASS END=299;SVLEN=-17;SVTYPE=DEL GT ./.
chr1 336 . N <DEL> 4 PASS END=350;SVLEN=-14;SVTYPE=DEL GT ./.
Expand Down

0 comments on commit e37ebc5

Please sign in to comment.