Skip to content

Commit

Permalink
Merge branch 'last-reviews-before-publication' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Mayer committed Aug 17, 2022
2 parents 388c2f8 + 65a5323 commit 07ab0c9
Show file tree
Hide file tree
Showing 13 changed files with 1,205 additions and 630 deletions.
37 changes: 20 additions & 17 deletions CSequence_Mol2_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class CSequence_Mol
num = local_num;
}

/*
// Reads line of data and removes only white spaces
void getRawLine_toupper(CFile& infile)
{
Expand All @@ -318,11 +319,12 @@ class CSequence_Mol
c = infile.getchar();
continue;
}
addCharToData(toupper(c));
// addCharToData(toupper(c));
c = infile.getchar();
}
toupper_this_sequence();
}

*/

// Called e.g. indirectly from Phobos
void getLineOfDNA_toupper_ambig2N_removegaps (CFile& infile, unsigned &pos_in_seq)
Expand All @@ -338,7 +340,7 @@ class CSequence_Mol
// if the char is a space or something we do not count, we subtract this further below
++number_raw_original_length;

c = toupper(c);
c = toupper_char(c);

if ( c == 'A' || c == 'T' || c == 'G' || c == 'C')
{
Expand Down Expand Up @@ -433,7 +435,7 @@ class CSequence_Mol

// ++pos;
c = infile.getchar();
c_upper = toupper(c);
c_upper = toupper_char(c);
while (!infile.fail() && c != '\n')
{
// if the char is a space or something we do not count, we subtract this further below
Expand Down Expand Up @@ -462,7 +464,7 @@ class CSequence_Mol
if (c <='Z') // i.e. lower case.
addCharToData( tolower(local_general_ambig) );
else
addCharToData( toupper(local_general_ambig) );
addCharToData( toupper_char(local_general_ambig) );

++number_of_DNARNA_amgibs; // includes N and '?'
if (local_general_ambig == '?' )
Expand Down Expand Up @@ -548,7 +550,7 @@ class CSequence_Mol
break;
}
c = infile.getchar();
c_upper = toupper(c);
c_upper = toupper_char(c);
++pos;
}
pos_in_seq = pos;
Expand All @@ -574,11 +576,11 @@ class CSequence_Mol
// character is upper or lower case, as specified.

if (convert_toupper_bool)
local_general_ambig = toupper(general_ambig);
local_general_ambig = toupper_char(general_ambig);

// ++pos;
c = infile.getchar();
c_upper = toupper(c);
c_upper = toupper_char(c);
while (!infile.fail() && c != '\n')
{
// if the char is a space or something we do not count, we subtract this further below
Expand Down Expand Up @@ -662,7 +664,7 @@ class CSequence_Mol
break;
}
c = infile.getchar();
c_upper = toupper(c);
c_upper = toupper_char(c);
++pos;
}
pos_in_seq = pos;
Expand All @@ -673,15 +675,15 @@ class CSequence_Mol
{
char c;
unsigned pos = pos_in_seq;
char local_general_ambig = toupper(general_ambig);
char local_general_ambig = toupper_char(general_ambig);

// ++pos;
c = infile.getchar();
while (!infile.fail() && c != '\n')
{
// if the char is a space or something we do not count, we subtract this further below
++number_raw_original_length;
c = toupper(c);
c = toupper_char(c);

if ( c == 'A' || c == 'T' || c == 'G' || c == 'C')
{
Expand Down Expand Up @@ -754,13 +756,13 @@ class CSequence_Mol

// ++pos;
c = infile.getchar();
char local_general_ambig = toupper(general_ambig);
char local_general_ambig = toupper_char(general_ambig);

while (!infile.fail() && c != '\n')
{
// if the char is a space or something we do not count, we subtract this further below
++number_raw_original_length;
c = toupper(c);
c = toupper_char(c);

if (c == 'X' || c=='?')
{
Expand Down Expand Up @@ -818,7 +820,7 @@ class CSequence_Mol
// if the char is a space or something we do not count, we subtract this further below
++number_raw_original_length;

c = toupper(c);
c = toupper_char(c);

if ( c == 'A' || c == 'T' || c == 'G' || c == 'C')
{
Expand Down Expand Up @@ -973,7 +975,7 @@ class CSequence_Mol
while (it != it_end)
{
char c = *it;
char c_upper = toupper(c);
char c_upper = toupper_char(c);

if ( c_upper == 'R' || c_upper == 'Y' || c_upper == 'K' || c_upper == 'M' ||
c_upper == 'S' || c_upper == 'W' || c_upper == 'B' || c_upper == 'D' ||
Expand Down Expand Up @@ -1836,7 +1838,7 @@ class CSequence_Mol
while (beg != end)
{
char c = *beg;
char c_toupper = toupper(c);
char c_toupper = toupper_char(c);

if (c_toupper == 'N' || c_toupper == 'X')
{
Expand Down Expand Up @@ -2419,9 +2421,10 @@ class CSequence_Mol
while ( !infile.fail() && c != '>' )
{
// std::cerr << data.capacity() << std::endl;
getRawLine_toupper(infile);
getRawLine(infile);
c = infile.peekchar();
}
toupper_this_sequence();
if (data.length() > 0)
infile.clear(infile.rdstate() & ~CFile::__fail_flag); // Unset the fail flag.
}
Expand Down
Loading

0 comments on commit 07ab0c9

Please sign in to comment.