Skip to content

Commit

Permalink
fix end
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Sep 25, 2023
1 parent 73d7b10 commit 0550ee4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modvcf.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ vcfParse(TConfig const& c, bam_hdr_t* hd, std::vector<TStructuralVariantRecord>&
if (svRec.svt < DELLY_SVT_TRANS) {
// Intra-chromosomal SV
if (bcf_get_info_int32(hdr, rec, "END", &svend, &nsvend) > 0) svRec.svEnd = *svend;
svRec.svEnd += 1;
} else {
// Inter-chromosomal SV
if (bcf_get_info_string(hdr, rec, "CHR2", &chr2, &nchr2) > 0) {
Expand Down Expand Up @@ -525,6 +526,7 @@ vcfOutput(TConfig const& c, std::vector<TStructuralVariantRecord> const& svs, TJ
int32_t svStartPos = svIter->svStart - 1;
if (svStartPos < 1) svStartPos = 1;
int32_t svEndPos = svIter->svEnd;
if (svIter->chr == svIter->chr2) --svEndPos; // To match VCF spec
if (svEndPos < 1) svEndPos = 1;
if (svEndPos >= (int32_t) bamhd->target_len[svIter->chr2]) svEndPos = bamhd->target_len[svIter->chr2] - 1;
rec->pos = svStartPos;
Expand Down

0 comments on commit 0550ee4

Please sign in to comment.