From 67b04fbef3daa636631782cf2084b569295741dc Mon Sep 17 00:00:00 2001 From: Hao Hou Date: Fri, 5 Jun 2020 10:37:09 -0600 Subject: [PATCH] Fix issue #832 --- .../FileReaders/SingleLineDelimTextFileReader.cpp | 2 +- src/utils/FileRecordTools/Records/VcfRecord.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/FileRecordTools/FileReaders/SingleLineDelimTextFileReader.cpp b/src/utils/FileRecordTools/FileReaders/SingleLineDelimTextFileReader.cpp index 054f86f3b..e4e645dfc 100644 --- a/src/utils/FileRecordTools/FileReaders/SingleLineDelimTextFileReader.cpp +++ b/src/utils/FileRecordTools/FileReaders/SingleLineDelimTextFileReader.cpp @@ -187,5 +187,5 @@ CHRPOS SingleLineDelimTextFileReader::getVcfSVlen() { } } // not found - return INT_MIN; + return 1; } diff --git a/src/utils/FileRecordTools/Records/VcfRecord.cpp b/src/utils/FileRecordTools/Records/VcfRecord.cpp index 54bf2ae27..c95128a44 100644 --- a/src/utils/FileRecordTools/Records/VcfRecord.cpp +++ b/src/utils/FileRecordTools/Records/VcfRecord.cpp @@ -23,7 +23,9 @@ bool VcfRecord::initFromFile(SingleLineDelimTextFileReader *fileReader) if (_varAlt[0] == '<') { // this is a structural variant. Need to parse the tags to find the endpos, // UNLESS it's an insertion. - if (!(_varAlt[1] == 'I' && _varAlt[2] == 'N' && _varAlt[3] == 'S')) { + if (memcmp(_varAlt.c_str(), "<*>", 3) == 0) { + _endPos = _startPos + 1; + } else if (memcmp(_varAlt.c_str(), "", 5) != 0) { _endPos = _startPos + fileReader->getVcfSVlen(); } else { //for insertions, treat as zero-length records