Skip to content

Commit

Permalink
PD-4755 calling fusion2geneSymbols() for a mutation protein
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav Brover committed Oct 2, 2023
1 parent ccf119c commit ec148fc
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 194 deletions.
5 changes: 3 additions & 2 deletions amr_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ struct BlastAlignment : Alignment
}
public:
string fusion2geneSymbols () const
{ ASSERT (! isMutationProt ());
{ ASSERT (! isMutationProt ());
if (fusions. empty ())
return getGeneSymbol ();
string s;
Expand Down Expand Up @@ -1102,6 +1102,7 @@ struct BlastAlignment : Alignment
)
if ( ! targetProt
|| ( ! isMutationProt () // PD-4722
&& ! other. isMutationProt () // PD-4755
&& fusion2geneSymbols () != other. fusion2geneSymbols ()
)
) // PD-4687
Expand Down Expand Up @@ -1397,7 +1398,7 @@ struct Batch
}
catch (const exception &e)
{
throw runtime_error ("Cannot read " + famFName +", line " + toString (f. lineNum) + "\n" + e. what ());
throw runtime_error ("Cannot read " + famFName +", " + f. lineStr () + "\n" + e. what ());
}
}
{
Expand Down
3 changes: 2 additions & 1 deletion amrfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
* gunzip (optional)
*
* Release changes:
* 3.11.21 10/02/2023 PD-4755 bug: calling fusion2geneSymbols() for a mutation protein
* 3.11.20 09/06/2023 PD-4722 bug: calling fusion2geneSymbols() for a mutation protein
* TERM codes are printed only when output is to screen
* color codes are printed only when output is to screen
* 3.11.19 08/09/2023 PD-4698 if a pseudogene is overlapped by a different gene on the length >= 20 aa with the same gene symbol then the pseudogene is not reported
* 08/04/2023 PD-4706 protein match overrides a nucleotide match for point mutations
* 3.11.18 07/25/2023 parameter order in instruction; "can be gzipped" is added to help
Expand Down
130 changes: 52 additions & 78 deletions common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ void copyText (const string &inFName,
QC_ASSERT (os. good ());
LineInput li (inFName);
while (li. nextLine ())
if (li. lineNum > skipLines)
if ((size_t) li. lineNum > skipLines)
os << li. line << endl;
}

Expand Down Expand Up @@ -2044,6 +2044,31 @@ void Progress::report () const



// TextPos

void TextPos::inc (bool eol_arg)
{
if (eol ())
lineNum++;
if (eol_arg)
charNum = eol_pos;
else
charNum++;
ASSERT (eol_arg == eol ());
}



void TextPos::dec ()
{
if (! charNum)
lineNum--;
charNum--;
}




// Input

Input::Input (const string &fName,
Expand Down Expand Up @@ -2099,7 +2124,11 @@ bool LineInput::nextLine ()
try
{
getline (*is, line); // faster than readLine(*is,line)
eof = is->eof ();

eof = is->eof ();
if (! eof)
lineNum++;

const bool end = line. empty () && eof;

if (! commentStart. empty ())
Expand All @@ -2110,8 +2139,6 @@ bool LineInput::nextLine ()
}
//trimTrailing (line);

lineNum++;

if (! end)
prog ();

Expand All @@ -2126,91 +2153,38 @@ bool LineInput::nextLine ()



// ObjectInput

bool ObjectInput::next (Root &row)
{
QC_ASSERT (is);

row. clear ();

if (eof)
return false;

row. read (*is);
row. qc ();
lineNum++;

eof = is->eof ();
if (eof)
{
ASSERT (row. empty ());
return false;
}

prog ();

ASSERT (is->peek () == '\n');

skipLine (*is);

return true;
}



// CharInput

char CharInput::get ()
{
ASSERT (is);
QC_ASSERT (! eof);

ungot = false;
ASSERT (is);

const char c = (char) is->get ();
const char c = (char) is->get ();

eof = is->eof ();
QC_ASSERT (eof == (c == (char) EOF));
if (! eof)
tp. inc (c == '\n'); // UNIX
ungot = false;

if (eol) // previous char
{
lineNum++;
charNum = 0;
}
else
charNum++;

eol_prev = eol;
eol = (eof || c == '\n'); // UNIX
if (eol)
if (tp. eol ())
prog ();

#if 0
PRINT (c);
PRINT (lineNum);
PRINT (charNum);
#endif

return c;
}



void CharInput::unget ()
{
ASSERT (is);
QC_ASSERT (! ungot);
QC_ASSERT (! eof);

ungot = true;

is->unget ();
charNum--; // May be (uint) (-1)
eof = false;
eol = eol_prev;
if (eol)
lineNum--;
QC_ASSERT (! eof);

ASSERT (is);
is->unget ();
tp. dec ();

ungot = true;
}


Expand All @@ -2221,7 +2195,7 @@ string CharInput::getLine ()
while (! eof)
{
const char c = get ();
if (eol)
if (tp. eol ())
break;
s += c;
}
Expand All @@ -2247,7 +2221,7 @@ void Token::readInput (CharInput &in,
if (in. eof)
return;

charNum = in. charNum;
tp = in. tp;

if ( c == '\''
|| c == '\"'
Expand All @@ -2261,7 +2235,7 @@ void Token::readInput (CharInput &in,
c = in. get ();
if (in. eof && (! consecutiveQuotesInText || ! prevQuote))
in. error ("Text is not finished: end of file", false);
if (in. eol)
if (in. tp. eol ())
continue;
if (c == quote)
{
Expand Down Expand Up @@ -2340,7 +2314,7 @@ void Token::readInput (CharInput &in,
qc ();

if (verbose ())
cout << type2str (type) << ' ' << *this << ' ' << charNum + 1 << endl;
cout << type2str (type) << ' ' << *this << ' ' << tp. str () << endl;
}


Expand Down Expand Up @@ -2518,7 +2492,7 @@ Token TokenInput::getXmlText ()


Token t;
t. charNum = ci. charNum;
t. tp = ci. tp;
size_t htmlTags = 0;
bool prevSlash = false;
for (;;)
Expand Down Expand Up @@ -2633,7 +2607,7 @@ Token TokenInput::getXmlComment ()
QC_ASSERT (ci. get () == '-');

Token t;
t. charNum = ci. charNum;
t. tp = ci. tp;
array<char,4> lastChars {{'-', '-', '\0', '\0'}};
size_t i = 2;
for (;;)
Expand Down Expand Up @@ -2676,7 +2650,7 @@ Token TokenInput::getXmlProcessingInstruction ()
// Embedded processing instructions ??

Token t;
t. charNum = ci. charNum;
t. tp = ci. tp;
for (;;)
{
char c = ci. get ();
Expand Down Expand Up @@ -2707,7 +2681,7 @@ Token TokenInput::getXmlMarkupDeclaration ()
QC_ASSERT (last. empty ());

Token t;
t. charNum = ci. charNum;
t. tp = ci. tp;
for (;;)
{
char c = ci. get ();
Expand Down
Loading

0 comments on commit ec148fc

Please sign in to comment.