68 static const bool kName =
false;
119 vector<Uint4>* blast_ambig = 0)
135 vector<TSeqPos>* badIdx,
143 vector<TSeqPos>* out_indices,
286 for (
size_t i=0;
i<size1;
i++)
386 vector<Uint4>* blast_ambig = 0)
504 vector<Uint4>* blast_ambig)
524 vector<Uint4>* blast_ambig)
595 vector<TSeqPos>* badIdx,
601 vector<TSeqPos>* badIdx,
607 vector<TSeqPos>* badIdx,
613 vector<TSeqPos>* badIdx,
674 vector<TSeqPos>* out_indices,
686 vector<TSeqPos>* out_indices,
893 const vector<char>** vec)
927 (in_seq, out_seq, to_code, uBeginIdx, uLength, bAmbig,
seed,
938 vector<Uint4>* blast_ambig)
942 17734276, total_length, out_seq_length, blast_ambig);
960 (in_seq, uBeginIdx, uLength);
966 vector<TSeqPos>* badIdx,
971 (in_seq, badIdx, uBeginIdx, uLength);
978 vector<TSeqPos>* out_indices,
984 (in_seq, out_seq, out_indices, to_code, uBeginIdx, uLength);
995 (in_seq, out_seq, uBeginIdx, uLength);
1006 (in_seq, uBeginIdx, uLength);
1021 in_seq1, uBeginIdx1, uLength1, in_seq2, uBeginIdx2, uLength2);
1031 (in_seq, uBeginIdx, uLength);
1042 (in_seq, out_seq, uBeginIdx, uLength);
1052 (in_seq, uBeginIdx, uLength);
1063 (in_seq, out_seq, uBeginIdx, uLength);
1073 (in_seq, uBeginIdx, uLength);
1084 (in_seq, out_seq, uBeginIdx, uLength);
1307 unique_ptr<CObjectIStream>
1314 *asn_codes_in >> *ptr_seq_code_set;
1317 return ptr_seq_code_set;
1329 list<CRef<CSeq_code_table> >::const_iterator i_ct;
1330 for(i_ct = code_list.begin(); i_ct != code_list.end(); ++i_ct)
1331 if((*i_ct)->GetCode() == code_type)
1335 if(i_ct == code_list.end())
1336 throw runtime_error(
"Requested code table not found");
1339 const list<CRef<CSeq_code_table::C_E> >& table_data = (*i_ct)->GetTable();
1341 int start_at = (*i_ct)->GetStart_at();
1345 for(
int i=0;
i<256;
i++)
1346 codeTable->m_Table[
i] =
'\xff';
1349 int nIdx = start_at;
1351 for(i_td = table_data.begin(); i_td != table_data.end(); ++i_td) {
1352 codeTable->m_Table[nIdx] = *((*i_td)->GetSymbol().c_str());
1353 if(codeTable->m_Table[nIdx] ==
'\x00')
1354 codeTable->m_Table[nIdx++] =
'\xff';
1373 list<CRef<CSeq_code_table> >::const_iterator i_ct;
1374 for(i_ct = code_list.begin(); i_ct != code_list.end(); ++i_ct)
1379 if(i_ct == code_list.end())
1380 throw runtime_error(
"Code table for Iupacna not found");
1383 if(!(*i_ct)->IsSetComps())
1384 throw runtime_error(
"Complement data is not set for iupacna table");
1387 const list<int>& comp_data = (*i_ct)->GetComps();
1388 int start_at = (*i_ct)->GetStart_at();
1394 for(
unsigned int i = 0;
i<256;
i++)
1395 compTable->m_Table[
i] = (
char) 255;
1398 list<int>::const_iterator i_comp;
1399 unsigned int nIdx = start_at;
1400 for(i_comp = comp_data.begin(); i_comp != comp_data.end(); ++i_comp)
1401 compTable->m_Table[nIdx++] = (*i_comp);
1418 list<CRef<CSeq_code_table> >::const_iterator i_ct;
1419 for(i_ct = code_list.begin(); i_ct != code_list.end(); ++i_ct)
1423 if(i_ct == code_list.end())
1424 throw runtime_error(
"Code table for Iupacna not found");
1427 if(!(*i_ct)->IsSetComps())
1428 throw runtime_error(
"Complement data is not set for ncbi2na table");
1431 const list<int>& comp_data = (*i_ct)->GetComps();
1432 int start_at = (*i_ct)->GetStart_at();
1439 int nIdx = start_at;
1440 list<int>::const_iterator i_comp;
1441 for(i_comp = comp_data.begin(); i_comp != comp_data.end(); ++i_comp)
1442 compArray[nIdx++] = (*i_comp);
1445 for(
unsigned int i = 0;
i < 4;
i++)
1446 for(
unsigned int j = 0; j < 4; j++)
1447 for(
unsigned int k = 0; k < 4; k++)
1448 for(
unsigned int l = 0;
l < 4;
l++)
1450 nIdx =
i<<6 | j<<4 | k<<2 |
l;
1451 char c1 = compArray[
i] << 6;
1452 char c2 = compArray[j] << 4;
1453 char c3 = compArray[k] << 2;
1454 char c4 = compArray[
l];
1455 compTable->m_Table[nIdx] = c1 | c2 | c3 | c4;
1473 list<CRef<CSeq_code_table> >::const_iterator i_ct;
1474 for(i_ct = code_list.begin(); i_ct != code_list.end(); ++i_ct)
1478 if(i_ct == code_list.end())
1479 throw runtime_error(
"Code table for Iupacna not found");
1482 if(!(*i_ct)->IsSetComps())
1483 throw runtime_error(
"Complement data is not set for iupacna table");
1486 const list<int>& comp_data = (*i_ct)->GetComps();
1487 int start_at = (*i_ct)->GetStart_at();
1495 int nIdx = start_at;
1496 list<int>::const_iterator i_comp;
1497 for(i_comp = comp_data.begin(); i_comp != comp_data.end(); ++i_comp)
1498 compArray[nIdx++] = (*i_comp);
1501 for(
unsigned int i = 0;
i<16;
i++)
1502 for(
unsigned int j = 0; j < 16; j++)
1505 char c1 = compArray[
i] << 4;
1506 char c2 = compArray[j];
1507 compTable->m_Table[nIdx] = c1 | c2;
1524 for(
unsigned int i = 0;
i < 4;
i++)
1525 for(
unsigned int j = 0; j < 4; j++)
1526 for(
unsigned int k = 0; k < 4; k++)
1527 for(
unsigned int l = 0;
l < 4;
l++)
1528 revTable->m_Table[64*
i + 16*j + 4*k +
l] =
1529 64*
l + 16*k + 4*j +
i;
1544 for(
unsigned int i = 0;
i < 16;
i++)
1545 for(
unsigned int j = 0; j < 16; j++)
1546 revTable->m_Table[16*
i + j] = 16*j +
i;
1565 list<CRef<CSeq_map_table> >::const_iterator i_mt;
1566 for(i_mt = map_list.begin(); i_mt != map_list.end(); ++i_mt)
1567 if((*i_mt)->GetFrom() == from_type && (*i_mt)->GetTo() == to_type)
1570 if(i_mt == map_list.end())
1571 throw runtime_error(
"Requested map table not found");
1574 const list<int>& table_data = (*i_mt)->GetTable();
1578 int start_at = (*i_mt)->GetStart_at();
1582 int nIdx = start_at;
1583 list<int>::const_iterator i_td;
1584 for(i_td = table_data.begin(); i_td != table_data.end(); ++i_td)
1586 mapTable->m_Table[nIdx++] = *i_td;
1630 unsigned char i, j, k,
l;
1632 for(
i = 0;
i < 4;
i++)
1633 for(j = 0; j < 4; j++)
1634 for(k = 0; k < 4; k++)
1635 for(
l = 0;
l < 4;
l++) {
1636 unsigned char aByte = (
i<<6) | (j<<4) | (k<<2) |
l;
1643 reinterpret_cast<char*
>(&fastTable->m_Table[aByte]);
1644 *(pt++) = (chi << 4) | chj;
1645 *pt = (
chk << 4) | chl;
1657 for(
i = 0;
i < 16;
i++)
1658 for(j = 0; j < 16; j++) {
1659 unsigned char aByte = (
i<<4) | j;
1665 char *pt =
reinterpret_cast<char*
>(&fastTable->m_Table[aByte]);
1680 for(
int ch = 0; ch < 256; ch++) {
1681 if((ch >= start_at) && (ch < (start_at +
size)))
1685 for(
unsigned int pos = 0; pos < 4; pos++)
1686 fastTable->m_Table[pos][ch] =
uch << (6-2*pos);
1689 for(
unsigned int pos = 0; pos < 4; pos++)
1690 fastTable->m_Table[pos][ch] =
'\x00';
1703 for(
int ch = 0; ch < 256; ch++) {
1704 if((ch >= start_at) && (ch < (start_at +
size)))
1707 for(
unsigned int pos = 0; pos < 2; pos++)
1708 fastTable->m_Table[pos][ch] =
uch << (4-4*pos);
1712 fastTable->m_Table[0][ch] = 0xF0;
1713 fastTable->m_Table[1][ch] = 0x0F;
1727 for(
int n1 = 0; n1 < 16; n1++)
1728 for(
int n2 = 0; n2 < 16; n2++) {
1729 int nIdx = 16*n1 + n2;
1730 unsigned char u1, u2;
1731 if((n1 >= start_at) && (n1 < start_at +
size))
1735 if((n2 >= start_at) && (n2 < start_at +
size))
1739 fastTable->m_Table[0][nIdx] = (u1<<6) | (u2<<4);
1740 fastTable->m_Table[1][nIdx] = (u1<<2) | u2;
1757 for (
unsigned int ii = 0; ii <
kNumCodes; ii++) {
1762 if (!found[
code-1]) {
1763 found[
code-1] =
true;
1765 (*it)->GetStart_at() : 0;
1771 (make_pair((*is)->GetSymbol(),
i++));
1773 if ( (*it)->IsSetComps() ) {
1774 ITERATE (list<int>, ic, (*it)->GetComps()) {
1789 unsigned int i, j, uCnt;
1790 unsigned char cVal, cRslt;
1795 static const unsigned char mask[16] = {
1796 0x11, 0x12, 0x14, 0x18,
1797 0x21, 0x22, 0x24, 0x28,
1798 0x41, 0x42, 0x44, 0x48,
1799 0x81, 0x82, 0x84, 0x88
1802 static const unsigned char maskUpper[4] = { 0x10, 0x20, 0x40, 0x80 };
1803 static const unsigned char maskLower[4] = { 0x01, 0x02, 0x04, 0x08 };
1807 for(
i = 0;
i < 256;
i++) {
1812 if(((cVal &
'\x0f') != 0) && ((cVal &
'\xf0') != 0))
1813 for(j = 0; j < 16; j++) {
1814 cRslt = cVal &
mask[j];
1815 if(cRslt ==
mask[j])
1816 aMask->m_Table[
i].cMask[uCnt++] =
mask[j];
1820 else if((cVal &
'\x0f') != 0)
1821 for(j = 0; j < 4; j++)
1823 cRslt = cVal & maskLower[j];
1824 if(cRslt == maskLower[j])
1825 aMask->m_Table[
i].cMask[uCnt++] = maskLower[j];
1830 else if((cVal &
'\xf0') != 0)
1831 for(j = 0; j < 4; j++)
1833 cRslt = cVal & maskUpper[j];
1834 if(cRslt == maskUpper[j])
1835 aMask->m_Table[
i].cMask[uCnt++] = maskUpper[j];
1840 aMask->m_Table[
i].cMask[uCnt++] =
'\x00';
1843 aMask->m_Table[
i].nMasks = uCnt;
1847 for(j = uCnt; j < 16 && uCnt > 0; j++)
1848 aMask->m_Table[
i].cMask[j] = aMask->m_Table[
i].cMask[j % uCnt];
1861 unsigned char low, high,
ambig;
1871 for(low = 0; low < 16; low++) {
1873 if((low == 1) || (low ==2) || (low == 4) || (low == 8))
1879 for(high = 0; high < 16; high++) {
1882 if((high != 1) && (high != 2) && (high != 4) && (high != 8))
1886 ambig_detect->m_Table[16*high + low] =
ambig;
1893 return ambig_detect;
1907 for(
unsigned int i = 0;
i<256;
i++)
1908 ambig_detect->m_Table[
i] = 0;
1912 ambig_detect->m_Table[66] = 1;
1913 ambig_detect->m_Table[68] = 1;
1914 ambig_detect->m_Table[72] = 1;
1915 ambig_detect->m_Table[75] = 1;
1916 ambig_detect->m_Table[77] = 1;
1917 ambig_detect->m_Table[78] = 1;
1918 ambig_detect->m_Table[82] = 1;
1919 ambig_detect->m_Table[83] = 1;
1920 ambig_detect->m_Table[86] = 1;
1921 ambig_detect->m_Table[87] = 1;
1922 ambig_detect->m_Table[89] = 1;
1924 return ambig_detect;
1977 vector<Uint4>* blast_ambig)
1983 throw std::runtime_error(
"to_code or from_code not set");
1986 throw std::runtime_error(
"to_code is not Ncbi2na");
1989 switch (from_code) {
1992 seed, total_length, out_seq_length,
1996 seed, total_length, out_seq_length,
1999 throw runtime_error(
"Requested conversion not implemented");
2019 vector<Uint4>* blast_ambig)
2025 if ( uLength == 0 ) {
2030 throw std::runtime_error(
"to_code or from_code not set");
2034 throw runtime_error(
"Requested conversion not implemented");
2040 return x_ConvertAmbig(in_seq, out_seq, to_code, uBeginIdx, uLength,
2041 seed, total_length, out_seq_length, blast_ambig);
2044 const string* in_str = 0;
2045 const vector<char>* in_vec = 0;
2050 if ( in_str != 0 ) {
2057 }
else if ( in_vec != 0 ) {
2065 return static_cast<TSeqPos>(retval);
2081 throw runtime_error(
"Unable tp pack requested coding");
2086 switch ( from_code ) {
2106 const string* in_str = 0;
2107 const vector<char>* in_vec = 0;
2111 vector<char> out_vec;
2115 if ( in_str != 0 ) {
2118 out_vec, coding, uLength);
2119 }
else if ( in_vec != 0 ) {
2122 out_vec, coding, uLength);
2149 switch (in_seq.
Which()) {
2163 throw runtime_error(
"Sequence could not be validated");
2173 vector<TSeqPos>* badIdx,
2178 switch (in_seq.
Which()) {
2196 throw runtime_error(
"Sequence could not be validated");
2208 vector<TSeqPos>* out_indices,
2216 switch (in_seq.
Which()) {
2221 uBeginIdx, uLength);
2229 uBeginIdx, uLength);
2250 switch (in_seq.
Which()) {
2265 (
"GetCopy() is not implemented for the requested sequence type");
2282 switch (in_seq->
Which()) {
2296 throw runtime_error(
"Cannot perform Keep on in_seq type.");
2315 throw runtime_error(
"Append in_seq types do not match.");
2323 switch (in_seq1.
Which()) {
2325 return AppendIupacna(out_seq, in_seq1, uBeginIdx1, uLength1,
2326 in_seq2, uBeginIdx2, uLength2);
2328 return AppendNcbi2na(out_seq, in_seq1, uBeginIdx1, uLength1,
2329 in_seq2, uBeginIdx2, uLength2);
2331 return AppendNcbi4na(out_seq, in_seq1, uBeginIdx1, uLength1,
2332 in_seq2, uBeginIdx2, uLength2);
2334 return AppendNcbieaa(out_seq, in_seq1, uBeginIdx1, uLength1,
2335 in_seq2, uBeginIdx2, uLength2);
2338 in_seq2, uBeginIdx2, uLength2);
2340 return AppendIupacaa(out_seq, in_seq1, uBeginIdx1, uLength1,
2341 in_seq2, uBeginIdx2, uLength2);
2343 throw runtime_error(
"Append for in_seq type not supported.");
2362 in_seq->
Assign(complement);
2378 if ( uLength == 0 ) {
2384 const string* in_str = 0;
2385 const vector<char>* in_vec = 0;
2394 }
else if (in_vec != 0) {
2395 vector<char> out_vec;
2400 return static_cast<TSeqPos>(retval);
2432 if ( uLength == 0 ) {
2439 const string* in_str = 0;
2440 const vector<char>* in_vec = 0;
2449 }
else if (in_vec !=
NULL) {
2450 vector<char> out_vec;
2455 return static_cast<TSeqPos>(retval);
2476 vector<char>* in_vec = 0;
2482 }
else if (in_vec !=
NULL) {
2485 return static_cast<TSeqPos>(retval);
2499 if ( uLength == 0 ) {
2506 const string* in_str = 0;
2507 const vector<char>* in_vec = 0;
2516 }
else if (in_vec !=
NULL) {
2517 vector<char> out_vec;
2523 return static_cast<TSeqPos>(retval);
2770 { 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 };
2791 : m_vAmbBuf(amb_buff)
2835 res[0] = (in_byte >> 4) & 0x0f;
2836 res[1] = in_byte & 0x0f;
2838 for (
int i = 0;
i < 2; ++
i, ++seq_pos) {
2879 vector<Uint4>* blast_ambig)
2884 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
2887 if (out_seq_length !=
nullptr && *out_seq_length == 0)
2893 if(uBeginIdx >= in_seq_data.size())
2898 if((uLenSav == 0) || ((uLenSav + uBeginIdx)) > in_seq_data.size())
2899 uLenSav = in_seq_length - uBeginIdx;
2904 Adjust(&uBeginIdx, &uLength, in_seq_length, 1, 4);
2910 if (out_seq_length) {
2911 out_seq_pos = *out_seq_length;
2912 *out_seq_length += uLenSav;
2914 TSeqPos rbit = 2*(out_seq_pos % 4);
2919 vector<char>::size_type nBytes = (out_seq_pos + uLenSav + 3) / 4;
2920 out_seq_data.resize(nBytes);
2924 unique_ptr<CAmbiguityContext> amb_context;
2930 vector<char>::iterator i_out;
2931 vector<char>::iterator i_out_begin = out_seq_data.begin() + out_seq_pos/4;
2932 vector<char>::iterator i_out_end = i_out_begin + uLength/4;
2935 string::const_iterator i_in = in_seq_data.begin() + uBeginIdx;
2938 const int kOneByteMask = 0xff;
2943 unsigned char c1, c2;
2957 for(i_out = i_out_begin; i_out != i_out_end; )
2962 [0][
static_cast<unsigned char>(*i_in)] |
2964 [1][
static_cast<unsigned char>(*(i_in+1))];
2969 [0][
static_cast<unsigned char>(*(i_in+2))]|
2971 [1][
static_cast<unsigned char>(*(i_in+3))];
2974 amb_context->AddAmbiguity(c1, out_seq_pos);
2975 amb_context->AddAmbiguity(c2, out_seq_pos);
2980 c1 &=
m_Masks->m_Table[c1].cMask[rv];
2982 c2 &=
m_Masks->m_Table[c2].cMask[rv];
2991 (*i_out) |= ((new_byte & kOneByteMask) >> rbit);
2996 (*i_out) = ((new_byte & kOneByteMask) << lbit);
3003 switch (uOverhang) {
3007 [0][
static_cast<unsigned char>(*i_in)];
3009 amb_context->AddAmbiguity(c1, out_seq_pos);
3011 c1 &=
m_Masks->m_Table[c1].cMask[rv];
3017 [0][
static_cast<unsigned char>(*i_in)] |
3019 [1][
static_cast<unsigned char>(*(i_in+1))];
3021 amb_context->AddAmbiguity(c1, out_seq_pos);
3023 c1 &=
m_Masks->m_Table[c1].cMask[rv];
3029 [0][
static_cast<unsigned char>(*i_in)] |
3031 [1][
static_cast<unsigned char>(*(i_in+1))];
3034 [0][
static_cast<unsigned char>(*(i_in+2))];
3036 amb_context->AddAmbiguity(c1, out_seq_pos);
3037 amb_context->AddAmbiguity(c2, out_seq_pos);
3040 c1 &=
m_Masks->m_Table[c1].cMask[rv];
3042 c2 &=
m_Masks->m_Table[c2].cMask[rv];
3058 if (uOverhang > 0) {
3059 (*i_out) |= ((new_byte & kOneByteMask) >> rbit);
3060 if (2*uOverhang > lbit) {
3062 (*i_out) = ((new_byte & kOneByteMask) << lbit);
3067 amb_context->Finish();
3072 for(i_out = i_out_begin; i_out != i_out_end; )
3076 [0][
static_cast<unsigned char>(*(i_in))] |
3078 [1][
static_cast<unsigned char>(*(i_in+1))] |
3080 [2][
static_cast<unsigned char>(*(i_in+2))] |
3082 [3][
static_cast<unsigned char>(*(i_in+3))];
3083 (*i_out) |= ((new_byte & kOneByteMask) >> rbit);
3088 (*i_out) = ((new_byte & kOneByteMask) << lbit);
3098 [
i][
static_cast<unsigned char>(*(i_in+
i))];
3100 (*i_out) |= ((new_byte & kOneByteMask) >> rbit);
3101 if (2*uOverhang > lbit) {
3103 (*i_out) = ((new_byte & kOneByteMask) << lbit);
3182 TSeqPos* out_seq_length, vector<Uint4>* blast_ambig)
3186 const vector<char>& in_seq_data = in_seq.
GetNcbi4na().
Get();
3187 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
3190 if (out_seq_length !=
nullptr && *out_seq_length == 0)
3196 TSeqPos uBeginSav = uBeginIdx;
3201 if(uBeginSav >= 2*in_seq_data.size())
3205 if((uLenSav == 0) || ((uBeginSav + uLenSav) > 2*in_seq_data.size()))
3206 uLenSav = 2*in_seq_length - uBeginSav;
3210 Adjust(&uBeginIdx, &uLength, in_seq_length, 2, 4);
3216 if (out_seq_length) {
3217 out_seq_pos = *out_seq_length;
3218 *out_seq_length += uLenSav;
3220 TSeqPos rbit = 2*(out_seq_pos % 4);
3225 vector<char>::size_type nBytes = (out_seq_pos + uLenSav + 3) / 4;
3226 out_seq_data.resize(nBytes);
3230 unique_ptr<CAmbiguityContext> amb_context;
3236 vector<char>::iterator i_out;
3237 vector<char>::iterator i_out_begin = out_seq_data.begin() + out_seq_pos/4;
3238 vector<char>::iterator i_out_end = i_out_begin + uLength/4;
3242 *i_out_begin &= (0xff << lbit);
3245 vector<char>::const_iterator i_in = in_seq_data.begin() + uBeginIdx/2;
3248 const int kOneByteMask = 0xff;
3256 for(i_out = i_out_begin; i_out != i_out_end; ) {
3258 unsigned char c1 =
static_cast<unsigned char>(*i_in);
3259 unsigned char c2 =
static_cast<unsigned char>(*(i_in+1));
3262 amb_context->AddAmbiguity(c1, out_seq_pos);
3263 amb_context->AddAmbiguity(c2, out_seq_pos);
3266 c1 &=
m_Masks->m_Table[c1].cMask[rv];
3268 c2 &=
m_Masks->m_Table[c2].cMask[rv];
3273 (*i_out) |= ((new_byte & kOneByteMask) >> rbit);
3278 (*i_out) = ((new_byte & kOneByteMask) << lbit);
3287 unsigned char c1 =
static_cast<unsigned char>(*i_in);
3293 amb_context->AddAmbiguity(c1, out_seq_pos);
3295 c1 &=
m_Masks->m_Table[c1].cMask[rv];
3301 if(uOverhang == 3) {
3304 unsigned char c1 =
static_cast<unsigned char>(*(++i_in)) & 0xf0;
3306 amb_context->AddAmbiguity(c1, out_seq_pos);
3308 c1 &=
m_Masks->m_Table[c1].cMask[rv];
3315 (*i_out) |= ((new_byte & kOneByteMask) >> rbit);
3316 if (2*uOverhang > lbit) {
3318 (*i_out) = ((new_byte & kOneByteMask) << lbit);
3323 amb_context->Finish();
3327 for(i_out = i_out_begin; i_out != i_out_end; ) {
3330 [0][
static_cast<unsigned char>(*i_in)] |
3332 [1][
static_cast<unsigned char>(*(i_in+1))];
3333 (*i_out) |= ((new_byte & kOneByteMask) >> rbit);
3338 (*i_out) = ((new_byte & kOneByteMask) << lbit);
3346 [0][
static_cast<unsigned char>(*i_in)];
3350 [1][
static_cast<unsigned char>(*(++i_in))];
3352 (*i_out) |= ((new_byte & kOneByteMask) >> rbit);
3353 if (2*uOverhang > lbit) {
3355 (*i_out) = ((new_byte & kOneByteMask) << lbit);
3360 TSeqPos keepidx = uBeginSav - uBeginIdx;
3633 if(uBeginIdx >= in_seq_data.size())
3637 Adjust(&uBeginIdx, &uLength,
static_cast<TSeqPos>(in_seq_data.size()),
3641 string::const_iterator itor;
3642 string::const_iterator b_itor = in_seq_data.begin() + uBeginIdx;
3643 string::const_iterator e_itor = b_itor + uLength;
3646 unsigned char ch =
'\x00';
3647 for(itor = b_itor; itor != e_itor; ++itor)
3648 ch |=
m_Iupacna->m_Table[
static_cast<unsigned char>(*itor)];
3665 if(uBeginIdx >= in_seq_data.size())
3669 Adjust(&uBeginIdx, &uLength,
static_cast<TSeqPos>(in_seq_data.size()),
3673 string::const_iterator itor;
3674 string::const_iterator b_itor = in_seq_data.begin() + uBeginIdx;
3675 string::const_iterator e_itor = b_itor + uLength;
3678 unsigned char ch =
'\x00';
3679 for(itor = b_itor; itor != e_itor; ++itor)
3680 ch |=
m_Ncbieaa->m_Table[
static_cast<unsigned char>(*itor)];
3698 if(uBeginIdx >= in_seq_data.size())
3702 Adjust(&uBeginIdx, &uLength,
static_cast<TSeqPos>(in_seq_data.size()),
3706 vector<char>::const_iterator itor;
3707 vector<char>::const_iterator b_itor = in_seq_data.begin() + uBeginIdx;
3708 vector<char>::const_iterator e_itor = b_itor + uLength;
3711 unsigned char ch =
'\x00';
3712 for(itor = b_itor; itor != e_itor; ++itor)
3713 ch |=
m_Ncbistdaa->m_Table[
static_cast<unsigned char>(*itor)];
3731 if(uBeginIdx >= in_seq_data.size())
3735 Adjust(&uBeginIdx, &uLength,
static_cast<TSeqPos>(in_seq_data.size()),
3739 string::const_iterator itor;
3740 string::const_iterator b_itor = in_seq_data.begin() + uBeginIdx;
3741 string::const_iterator e_itor = b_itor + uLength;
3744 unsigned char ch =
'\x00';
3745 for(itor=b_itor; itor!=e_itor; ++itor)
3746 ch |=
m_Iupacaa->m_Table[
static_cast<unsigned char>(*itor)];
3755 vector<TSeqPos>* badIdx,
3767 if(uBeginIdx >= in_seq_data.size())
3771 Adjust(&uBeginIdx, &uLength,
static_cast<TSeqPos>(in_seq_data.size()),
3775 string::const_iterator itor;
3776 string::const_iterator b_itor = in_seq_data.begin() + uBeginIdx;
3777 string::const_iterator e_itor = b_itor + uLength;
3781 for(itor = b_itor; itor != e_itor; ++itor)
3782 if(
m_Iupacna->m_Table[
static_cast<unsigned char>(*itor)] ==
char(255))
3783 badIdx->push_back(nIdx++);
3794 vector<TSeqPos>* badIdx,
3806 if(uBeginIdx >= in_seq_data.size())
3810 Adjust(&uBeginIdx, &uLength,
static_cast<TSeqPos>(in_seq_data.size()),
3814 string::const_iterator itor;
3815 string::const_iterator b_itor = in_seq_data.begin() + uBeginIdx;
3816 string::const_iterator e_itor = b_itor + uLength;
3820 for(itor = b_itor; itor != e_itor; ++itor)
3821 if(
m_Ncbieaa->m_Table[
static_cast<unsigned char>(*itor)] ==
char(255))
3822 badIdx->push_back(nIdx++);
3833 vector<TSeqPos>* badIdx,
3845 if(uBeginIdx >= in_seq_data.size())
3849 Adjust(&uBeginIdx, &uLength,
static_cast<TSeqPos>(in_seq_data.size()),
3853 vector<char>::const_iterator itor;
3854 vector<char>::const_iterator b_itor = in_seq_data.begin() + uBeginIdx;
3855 vector<char>::const_iterator e_itor = b_itor + uLength;
3859 for(itor=b_itor; itor!=e_itor; ++itor)
3860 if(
m_Ncbistdaa->m_Table[
static_cast<unsigned char>(*itor)]==
char(255))
3861 badIdx->push_back(nIdx++);
3872 vector<TSeqPos>* badIdx,
3884 if(uBeginIdx >= in_seq_data.size())
3888 Adjust(&uBeginIdx, &uLength,
static_cast<TSeqPos>(in_seq_data.size()),
3892 string::const_iterator itor;
3893 string::const_iterator b_itor = in_seq_data.begin() + uBeginIdx;
3894 string::const_iterator e_itor = b_itor + uLength;
3898 for(itor=b_itor; itor!=e_itor; ++itor)
3899 if(
m_Iupacaa->m_Table[
static_cast<unsigned char>(*itor)] ==
char(255))
3900 badIdx->push_back(nIdx++);
3922 const vector<char>& in_seq_data = in_seq.
GetNcbi2na().
Get();
3925 if(uBeginIdx >= 4 * in_seq_data.size())
3929 if( (uLength ==0) || ((uBeginIdx + uLength) > (4*in_seq_data.size() )) )
3930 uLength = 4 *
static_cast<TSeqPos>(in_seq_data.size()) - uBeginIdx;
3933 if((uLength % 4) == 0)
3934 out_seq_data.resize(uLength/4);
3936 out_seq_data.resize(uLength/4 + 1);
3939 vector<char>::iterator i_out = out_seq_data.begin() - 1;
3942 unsigned int lShift, rShift;
3943 lShift = 2*(uBeginIdx % 4);
3944 rShift = 8 - lShift;
3947 vector<char>::const_iterator i_in;
3948 vector<char>::const_iterator i_in_begin =
3949 in_seq_data.begin() + uBeginIdx/4;
3953 if((uLength % 4) != 0)
3957 bool bDoLastByte =
false;
3958 if((uBeginIdx/4 + uNumBytes) >= in_seq_data.size())
3960 uNumBytes = in_seq_data.size() - uBeginIdx/4 - 1;
3963 vector<char>::const_iterator i_in_end = i_in_begin + uNumBytes;
3967 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
3969 ((*i_in) << lShift) | (((*(i_in+1)) & 255) >> rShift);
3971 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
3972 (*(++i_out)) = (*i_in);
3976 (*(++i_out)) = (*i_in) << lShift;
3995 const vector<char>& in_seq_data = in_seq.
GetNcbi4na().
Get();
3998 if(uBeginIdx >= 2 * in_seq_data.size())
4002 if( (uLength ==0) || ((uBeginIdx + uLength) > (2*in_seq_data.size() )) )
4003 uLength = 2 *
static_cast<TSeqPos>(in_seq_data.size()) - uBeginIdx;
4006 if((uLength % 2) == 0)
4007 out_seq_data.resize(uLength/2);
4009 out_seq_data.resize(uLength/2 + 1);
4013 vector<char>::iterator i_out = out_seq_data.begin() - 1;
4016 unsigned int lShift, rShift;
4017 lShift = 4*(uBeginIdx % 2);
4018 rShift = 8 - lShift;
4021 vector<char>::const_iterator i_in;
4022 vector<char>::const_iterator i_in_begin =
4023 in_seq_data.begin() + uBeginIdx/2;
4027 if((uLength % 2) != 0)
4031 bool bDoLastByte =
false;
4032 if((uBeginIdx/2 + uNumBytes) >= in_seq_data.size())
4034 uNumBytes = in_seq_data.size() - uBeginIdx/2 - 1;
4037 vector<char>::const_iterator i_in_end = i_in_begin + uNumBytes;
4041 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
4043 ((*i_in) << lShift) | (((*(i_in+1)) & 255) >> rShift);
4045 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
4046 (*(++i_out)) = (*i_in);
4050 (*(++i_out)) = (*i_in) << lShift;
4072 if(uBeginIdx >= in_seq_data.size())
4076 if( (uLength ==0) || ((uBeginIdx + uLength) > (in_seq_data.size() )) )
4077 uLength =
static_cast<TSeqPos>(in_seq_data.size()) - uBeginIdx;
4080 out_seq_data.resize(uLength);
4083 string::iterator i_out = out_seq_data.begin() - 1;
4086 string::const_iterator i_in;
4087 string::const_iterator i_in_begin = in_seq_data.begin() + uBeginIdx;
4088 string::const_iterator i_in_end = i_in_begin + uLength;
4091 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
4092 (*(++i_out)) = (*i_in);
4114 if(uBeginIdx >= in_seq_data.size())
4118 if( (uLength ==0) || ((uBeginIdx + uLength) > (in_seq_data.size() )) )
4119 uLength =
static_cast<TSeqPos>(in_seq_data.size()) - uBeginIdx;
4122 out_seq_data.resize(uLength);
4125 string::iterator i_out = out_seq_data.begin() - 1;
4128 string::const_iterator i_in;
4129 string::const_iterator i_in_begin = in_seq_data.begin() + uBeginIdx;
4130 string::const_iterator i_in_end = i_in_begin + uLength;
4133 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
4134 (*(++i_out)) = (*i_in);
4156 if(uBeginIdx >= in_seq_data.size())
4160 if( (uLength ==0) || ((uBeginIdx + uLength) > (in_seq_data.size() )) )
4161 uLength =
static_cast<TSeqPos>(in_seq_data.size()) - uBeginIdx;
4164 out_seq_data.resize(uLength);
4167 vector<char>::iterator i_out = out_seq_data.begin() - 1;
4170 vector<char>::const_iterator i_in;
4171 vector<char>::const_iterator i_in_begin = in_seq_data.begin() + uBeginIdx;
4172 vector<char>::const_iterator i_in_end = i_in_begin + uLength;
4175 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
4176 (*(++i_out)) = (*i_in);
4198 if(uBeginIdx >= in_seq_data.size())
4202 if( (uLength ==0) || ((uBeginIdx + uLength) > (in_seq_data.size() )) )
4203 uLength =
static_cast<TSeqPos>(in_seq_data.size()) - uBeginIdx;
4206 out_seq_data.resize(uLength);
4209 string::iterator i_out = out_seq_data.begin() - 1;
4212 string::const_iterator i_in;
4213 string::const_iterator i_in_begin = in_seq_data.begin() + uBeginIdx;
4214 string::const_iterator i_in_end = i_in_begin + uLength;
4217 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
4218 (*(++i_out)) = (*i_in);
4239 *uLength = uInSeqsPerByte * uInSeqBytes;
4242 if(*uBeginIdx >= uInSeqsPerByte * uInSeqBytes)
4243 *uBeginIdx = uInSeqsPerByte * uInSeqBytes - uInSeqsPerByte;
4246 *uLength += *uBeginIdx % uInSeqsPerByte;
4247 *uBeginIdx = uInSeqsPerByte * (*uBeginIdx/uInSeqsPerByte);
4250 if(*uLength > uInSeqsPerByte * uInSeqBytes - *uBeginIdx)
4251 *uLength = uInSeqsPerByte * uInSeqBytes - *uBeginIdx;
4255 TSeqPos uOverhang = *uLength % uOutSeqsPerByte;
4256 *uLength = uOutSeqsPerByte * (*uLength / uOutSeqsPerByte);
4270 vector<TSeqPos>* out_indices,
4276 const vector<char>& in_seq_data = in_seq.
GetNcbi4na().
Get();
4283 if(uBeginIdx >= 2*in_seq_data.size())
4286 if((uLength == 0) || (((uBeginIdx + uLength) > 2*in_seq_data.size())))
4287 uLength = 2 *
static_cast<TSeqPos>(in_seq_data.size()) - uBeginIdx;
4290 TSeqPos uBeginSav = uBeginIdx;
4292 uLength += uBeginIdx % 2;
4293 uBeginIdx = 2*(uBeginIdx/2);
4300 out_seq_data.resize(uLength/2 + (uLength % 2));
4301 out_indices->resize(uLength);
4307 vector<char>::const_iterator i_in;
4308 vector<char>::const_iterator i_in_begin =
4309 in_seq_data.begin() + uBeginIdx/2;
4310 vector<char>::const_iterator i_in_end =
4311 i_in_begin + uLength/2 + (uLength % 2);
4314 vector<char>::iterator i_out_seq = out_seq_data.begin();
4315 vector<TSeqPos>::iterator i_out_idx = out_indices->begin();
4321 for(i_in = i_in_begin; i_in != i_in_end; ++i_in) {
4323 [
static_cast<unsigned char>(*i_in)]) {
4330 (*i_out_seq) |= (*i_in) &
'\x0f';
4336 (*i_out_seq) = (*i_in) << 4;
4339 (*i_out_idx) = uIdx + 1;
4351 (*i_out_seq) |= ((*i_in) >> 4) &
'\x0f';
4357 (*i_out_seq) = (*i_in) &
'\xf0';
4360 (*i_out_idx) = uIdx;
4375 (*i_out_seq) |= ((*i_in) >> 4) &
'\x0f';
4376 (*(++i_out_seq)) = (*i_in) << 4;
4385 (*i_out_seq) = (*i_in);
4390 (*i_out_idx) = uIdx;
4391 (*(++i_out_idx)) = uIdx + 1;
4404 out_indices->resize(uNumAmbigs);
4405 out_seq_data.resize(uNumAmbigs/2 + uNumAmbigs % 2);
4410 if((*out_indices)[0] < uBeginSav)
4413 out_indices->erase(out_indices->begin(), out_indices->begin() + 1);
4416 if((*out_indices)[out_indices->size()-1] >= uBeginSav + uLenSav)
4418 out_indices->pop_back();
4419 uKeepLen =
static_cast<TSeqPos>(out_indices->size());
4422 if((uKeepBeg != 0) || (uKeepLen != 0))
4423 uNumAmbigs =
KeepNcbi4na(out_seq, uKeepBeg, uKeepLen);
4437 vector<TSeqPos>* out_indices,
4450 if(uBeginIdx >= in_seq_data.size())
4453 if((uLength == 0) || ((uBeginIdx + uLength) > in_seq_data.size()))
4454 uLength =
static_cast<TSeqPos>(in_seq_data.size()) - uBeginIdx;
4459 out_seq_data.resize(uLength);
4460 out_indices->resize(uLength);
4466 string::const_iterator i_in;
4467 string::const_iterator i_in_begin = in_seq_data.begin() + uBeginIdx;
4468 string::const_iterator i_in_end = i_in_begin + uLength;
4471 string::iterator i_out_seq = out_seq_data.begin();
4472 vector<TSeqPos>::iterator i_out_idx = out_indices->begin();
4478 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
4481 [
static_cast<unsigned char>(*i_in)] == 1)
4483 (*i_out_seq) = (*i_in);
4485 (*i_out_idx) = uIdx;
4493 out_seq_data.resize(uNumAmbigs);
4494 out_indices->resize(uNumAmbigs);
4510 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
4513 if(uBeginIdx >= in_seq_data.size()*4)
4515 in_seq_data.clear();
4521 uLength = 4 * in_seq_length - uBeginIdx;
4526 if(uLength > (4*in_seq_data.size() - uBeginIdx))
4527 uLength = 4 * in_seq_length - uBeginIdx;
4530 if((uBeginIdx == 0) && (uLength >= 4*in_seq_data.size()))
4537 TSeqPos uStartInByte = 2 * (uBeginIdx % 4);
4540 unsigned char rightMask = 0xff << uStartInByte;
4541 unsigned char leftMask = ~rightMask;
4545 TSeqPos uEnd = (uBeginIdx + uLength - 1)/4;
4548 vector<char>::iterator i_write;
4551 vector<char>::iterator i_read = in_seq_data.begin() + uStart;
4552 vector<char>::iterator i_read_end = in_seq_data.begin() + uEnd;
4556 for(i_write = in_seq_data.begin(); i_read != i_read_end; ++i_write) {
4557 (*i_write) = (((*i_read) << uStartInByte) | leftMask) &
4558 (((*(i_read+1)) >> (8-uStartInByte)) | rightMask);
4563 (*i_write) = (*i_read) << uStartInByte;
4567 if((uLength % 4) != 0)
4569 in_seq_data.resize(uSize);
4585 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
4588 if(uBeginIdx >= in_seq_data.size()*2)
4590 in_seq_data.clear();
4596 uLength = 2 * in_seq_length - uBeginIdx;
4601 if(uLength > (2*in_seq_data.size() - uBeginIdx))
4602 uLength = 2 * in_seq_length - uBeginIdx;
4605 if((uBeginIdx == 0) && (uLength >= 2*in_seq_data.size()))
4612 unsigned int uStartInByte = 4 * (uBeginIdx % 2);
4615 unsigned char rightMask = 0xff << uStartInByte;
4616 unsigned char leftMask = ~rightMask;
4620 TSeqPos uEnd = (uBeginIdx + uLength - 1)/2;
4623 vector<char>::iterator i_write;
4626 vector<char>::iterator i_read = in_seq_data.begin() + uStart;
4627 vector<char>::iterator i_read_end = in_seq_data.begin() + uEnd;
4631 for(i_write = in_seq_data.begin(); i_read != i_read_end; ++i_write) {
4632 (*i_write) = (((*i_read) << uStartInByte) | leftMask) &
4633 (((*(i_read+1)) >> (8-uStartInByte)) | rightMask);
4638 (*i_write) = (*i_read) << uStartInByte;
4642 if((uLength % 2) != 0)
4644 in_seq_data.resize(uSize);
4660 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
4664 if(uBeginIdx >= in_seq_data.size())
4666 in_seq_data.erase();
4672 uLength = in_seq_length - uBeginIdx;
4675 if((uBeginIdx + uLength) > in_seq_data.size())
4676 uLength = in_seq_length - uBeginIdx;
4680 if((uBeginIdx == 0) && (uLength >= in_seq_data.size()))
4684 string::iterator i_read;
4685 string::iterator i_write;
4688 i_read = in_seq_data.begin() + uBeginIdx;
4689 string::iterator i_read_end = i_read + uLength;
4693 for(i_write = in_seq_data.begin(); i_read != i_read_end; ++i_write)
4695 (*i_write) = (*i_read);
4700 in_seq_data.resize(uLength);
4715 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
4719 if(uBeginIdx >= in_seq_data.size())
4721 in_seq_data.erase();
4727 uLength = in_seq_length - uBeginIdx;
4730 if((uBeginIdx + uLength) > in_seq_data.size())
4731 uLength = in_seq_length - uBeginIdx;
4735 if((uBeginIdx == 0) && (uLength >= in_seq_data.size()))
4739 string::iterator i_read;
4740 string::iterator i_write;
4743 i_read = in_seq_data.begin() + uBeginIdx;
4744 string::iterator i_read_end = i_read + uLength;
4748 for(i_write = in_seq_data.begin(); i_read != i_read_end; ++i_write) {
4749 (*i_write) = (*i_read);
4754 in_seq_data.resize(uLength);
4769 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
4772 if(uBeginIdx >= in_seq_data.size())
4774 in_seq_data.clear();
4780 uLength = in_seq_length - uBeginIdx;
4783 if((uBeginIdx + uLength) > in_seq_data.size())
4784 uLength = in_seq_length - uBeginIdx;
4788 if((uBeginIdx == 0) && (uLength >= in_seq_data.size()))
4792 vector<char>::iterator i_read;
4793 vector<char>::iterator i_write;
4796 i_read = in_seq_data.begin() + uBeginIdx;
4797 vector<char>::iterator i_read_end = i_read + uLength;
4801 for(i_write = in_seq_data.begin(); i_read != i_read_end; ++i_write) {
4802 (*i_write) = (*i_read);
4807 in_seq_data.resize(uLength);
4822 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
4826 if (uBeginIdx >= in_seq_data.size()) {
4827 in_seq_data.erase();
4833 uLength = in_seq_length - uBeginIdx;
4836 if((uBeginIdx + uLength) > in_seq_data.size())
4837 uLength = in_seq_length - uBeginIdx;
4841 if((uBeginIdx == 0) && (uLength >= in_seq_data.size()))
4845 string::iterator i_read;
4846 string::iterator i_write;
4849 i_read = in_seq_data.begin() + uBeginIdx;
4850 string::iterator i_read_end = i_read + uLength;
4854 for(i_write = in_seq_data.begin(); i_read != i_read_end; ++i_write) {
4855 (*i_write) = (*i_read);
4860 in_seq_data.resize(uLength);
4883 string::iterator i_data;
4886 string::iterator i_data_end = in_seq_data.end();
4889 for(i_data = in_seq_data.begin(); i_data != i_data_end; ++i_data)
4910 vector<char>::iterator i_data;
4913 vector<char>::iterator i_data_end = in_seq_data.end();
4916 for(i_data = in_seq_data.begin(); i_data != i_data_end; ++i_data)
4937 vector<char>::iterator i_data;
4940 vector<char>::iterator i_data_end = in_seq_data.end();
4943 for(i_data = in_seq_data.begin(); i_data != i_data_end; ++i_data)
5010 reverse(in_seq_data.begin(), in_seq_data.end());
5024 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
5027 if(uBeginIdx >= 4*in_seq_data.size())
5029 in_seq_data.erase(in_seq_data.begin(), in_seq_data.end());
5035 uLength = 4 * in_seq_length - uBeginIdx;
5038 if((uBeginIdx + uLength) > (4 * in_seq_data.size()))
5039 uLength = 4 * in_seq_length - uBeginIdx;
5043 TSeqPos uEnd = uStart + (uLength - 1 +(uBeginIdx % 4))/4 + 1;
5046 vector<char>::iterator i_in;
5047 vector<char>::iterator i_in_begin = in_seq_data.begin() + uStart;
5048 vector<char>::iterator i_in_end = in_seq_data.begin() + uEnd;
5051 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
5052 (*i_in) =
m_Ncbi2naRev->m_Table[
static_cast<unsigned char>(*i_in)];
5055 reverse(i_in_begin, i_in_end);
5058 TSeqPos uJagged = 3 - ((uBeginIdx + uLength - 1) % 4) + 4*uStart;
5071 TSeqPos in_seq_length =
static_cast<TSeqPos>(in_seq_data.size());
5074 if(uBeginIdx >= 2*in_seq_data.size())
5076 in_seq_data.erase(in_seq_data.begin(), in_seq_data.end());
5082 uLength = 2 * in_seq_length - uBeginIdx;
5085 if((uBeginIdx + uLength) > (2 * in_seq_data.size()))
5086 uLength = 2 * in_seq_length - uBeginIdx;
5090 TSeqPos uEnd = uStart + (uLength - 1 +(uBeginIdx % 2))/2 + 1;
5093 vector<char>::iterator i_in;
5094 vector<char>::iterator i_in_begin = in_seq_data.begin() + uStart;
5095 vector<char>::iterator i_in_end = in_seq_data.begin() + uEnd;
5098 for(i_in = i_in_begin; i_in != i_in_end; ++i_in)
5099 (*i_in) =
m_Ncbi4naRev->m_Table[
static_cast<unsigned char>(*i_in)];
5102 reverse(i_in_begin, i_in_end);
5105 TSeqPos uJagged = 1 - ((uBeginIdx + uLength - 1) % 2) + 2*uStart;
5120 TSeqPos uIdx1 = 0, uIdx2 = uLength;
5134 TSeqPos uIdx1 = 0, uIdx2 = uLength;
5148 TSeqPos uIdx1 = 0, uIdx2 = uLength;
5258 if((uBeginIdx1 >= in_seq1_data.size()) &&
5259 (uBeginIdx2 >= in_seq2_data.size()))
5262 if(((uBeginIdx1 + uLength1) > in_seq1_data.size()) || uLength1 == 0)
5263 uLength1 =
static_cast<TSeqPos>(in_seq1_data.size()) - uBeginIdx1;
5265 if(((uBeginIdx2 + uLength2) > in_seq2_data.size()) || uLength2 == 0)
5266 uLength2 =
static_cast<TSeqPos>(in_seq2_data.size()) - uBeginIdx2;
5269 out_seq_data.append(in_seq1_data.substr(uBeginIdx1,uLength1));
5270 out_seq_data.append(in_seq2_data.substr(uBeginIdx2,uLength2));
5272 return uLength1 + uLength2;
5287 const vector<char>& in_seq1_data = in_seq1.
GetNcbi2na().
Get();
5288 const vector<char>& in_seq2_data = in_seq2.
GetNcbi2na().
Get();
5295 if((uBeginIdx1 >= 4*in_seq1_data.size()) &&
5296 (uBeginIdx2 >= 4*in_seq2_data.size()))
5300 if(uBeginIdx1 >= 4*in_seq1_data.size())
5304 if(uBeginIdx2 >= 4*in_seq2_data.size())
5308 if(((uBeginIdx1 + uLength1) > 4*in_seq1_data.size()) || uLength1 == 0)
5309 uLength1 = 4 *
static_cast<TSeqPos>(in_seq1_data.size()) - uBeginIdx1;
5311 if(((uBeginIdx2 + uLength2) > 4*in_seq2_data.size()) || uLength2 == 0)
5312 uLength2 = 4 *
static_cast<TSeqPos>(in_seq2_data.size()) - uBeginIdx2;
5316 TSeqPos uTotalLength = uLength1 + uLength2;
5317 if((uTotalLength % 4) == 0)
5318 out_seq_data.resize(uTotalLength/4);
5320 out_seq_data.resize(uTotalLength/4 + 1);
5323 unsigned int lShift1 = 2*(uBeginIdx1 % 4);
5324 unsigned int rShift1 = 8 - lShift1;
5327 unsigned int lShift2, rShift2, uCase;
5328 unsigned int uVacantIdx = 2*(uLength1 % 4);
5329 unsigned int uStartIdx = 2*(uBeginIdx2 % 4);
5330 if((uVacantIdx < uStartIdx) && (uVacantIdx > 0))
5333 lShift2 = uStartIdx - uVacantIdx;
5334 rShift2 = 8 - lShift2;
5336 else if((uVacantIdx < uStartIdx) && (uVacantIdx == 0))
5339 lShift2 = uStartIdx;
5340 rShift2 = 8 - lShift2;
5342 else if((uVacantIdx == uStartIdx) && (uVacantIdx > 0))
5348 else if((uVacantIdx == uStartIdx) && (uVacantIdx == 0))
5357 rShift2 = uVacantIdx - uStartIdx;
5358 lShift2 = 8 - rShift2;
5363 TSeqPos uStart1 = uBeginIdx1/4;
5365 if(((uBeginIdx1 + uLength1) % 4) == 0)
5366 uEnd1 = (uBeginIdx1 + uLength1)/4;
5368 uEnd1 = (uBeginIdx1 + uLength1)/4 + 1;
5370 TSeqPos uStart2 = uBeginIdx2/4;
5372 if(((uBeginIdx2 + uLength2) % 4) == 0)
5373 uEnd2 = (uBeginIdx2 + uLength2)/4;
5375 uEnd2 = (uBeginIdx2 + uLength2)/4 + 1;
5378 vector<char>::const_iterator i_in1_begin = in_seq1_data.begin() + uStart1;
5379 vector<char>::const_iterator i_in1_end = in_seq1_data.begin() + uEnd1 - 1;
5380 vector<char>::const_iterator i_in2_begin = in_seq2_data.begin() + uStart2;
5381 vector<char>::const_iterator i_in2_end = in_seq2_data.begin() + uEnd2;
5384 vector<char>::iterator i_out = out_seq_data.begin() - 1;
5385 vector<char>::const_iterator i_in1;
5386 vector<char>::const_iterator i_in2;
5389 for(i_in1 = i_in1_begin; i_in1 != i_in1_end; ++i_in1)
5390 (*(++i_out)) = ((*i_in1) << lShift1) | ((*(i_in1+1) & 255) >> rShift1);
5394 if((uLength1 % 4) == 0)
5395 uEndOutByte = uLength1/4 - 1;
5397 uEndOutByte = uLength1/4;
5398 if(i_out != (out_seq_data.begin() + uEndOutByte))
5399 (*(++i_out)) = (*i_in1) << lShift1;
5402 unsigned char uMask1 = 255 << (8 - 2*(uLength1 % 4));
5403 unsigned char uMask2 = 255 >> (2*(uBeginIdx2 % 4));
5408 if((i_in2_begin + 1) == i_in2_end)
5411 (*i_out) |= ((*i_in2_begin) & uMask2) << lShift2;
5412 return uTotalLength;
5418 (((*i_in2_begin) & uMask2) << lShift2) |
5419 (((*(i_in2_begin+1)) & 255) >> rShift2);
5423 if((i_in2_begin + 1) == i_in2_end)
5425 (*(++i_out)) = (*i_in2_begin) << lShift2;
5426 return uTotalLength;
5431 ((*i_in2_begin) << lShift2) |
5432 (((*(i_in2_begin+1)) & 255) >> rShift2);
5437 (*i_out) |= (*i_in2_begin) & uMask2;
5438 if((i_in2_begin + 1) == i_in2_end)
5439 return uTotalLength;
5442 (*(++i_out)) = (*i_in2_begin);
5443 if((i_in2_begin + 1) == i_in2_end)
5444 return uTotalLength;
5447 if((i_in2_begin + 1) == i_in2_end)
5450 (*i_out) |= ((*i_in2_begin) & uMask2) >> rShift2;
5451 if(++i_out != out_seq_data.end())
5452 (*i_out) = (*i_in2_begin) << lShift2;
5453 return uTotalLength;
5459 (((*i_in2_begin) & uMask2) >> rShift2) |
5460 ((*(i_in2_begin+1) & ~uMask2) << lShift2);
5467 for(i_in2 = i_in2_begin+uSeq2Inc; (i_in2 != i_in2_end) &&
5468 ((i_in2+1) != i_in2_end); ++i_in2) {
5469 (*(++i_out)) = ((*i_in2) << lShift2) | ((*(i_in2+1) & 255) >> rShift2);
5473 if((++i_out != out_seq_data.end()) && (i_in2 != i_in2_end))
5474 (*i_out) = (*i_in2) << lShift2;
5476 return uLength1 + uLength2;
5491 const vector<char>& in_seq1_data = in_seq1.
GetNcbi4na().
Get();
5492 const vector<char>& in_seq2_data = in_seq2.
GetNcbi4na().
Get();
5499 if((uBeginIdx1 >= 4*in_seq1_data.size()) &&
5500 (uBeginIdx2 >= 4*in_seq2_data.size()))
5504 if(uBeginIdx1 >= 4*in_seq1_data.size())
5508 if(uBeginIdx2 >= 4*in_seq2_data.size())
5512 if(((uBeginIdx1 + uLength1) > 2*in_seq1_data.size()) || uLength1 == 0)
5513 uLength1 = 2 *
static_cast<TSeqPos>(in_seq1_data.size()) - uBeginIdx1;
5515 if(((uBeginIdx2 + uLength2) > 2*in_seq2_data.size()) || uLength2 == 0)
5516 uLength2 = 2 *
static_cast<TSeqPos>(in_seq2_data.size()) - uBeginIdx2;
5519 TSeqPos uTotalLength = uLength1 + uLength2;
5520 if((uTotalLength % 2) == 0)
5521 out_seq_data.resize(uTotalLength/2);
5523 out_seq_data.resize(uTotalLength/2 + 1);
5526 unsigned int lShift1 = 4*(uBeginIdx1 % 2);
5527 unsigned int rShift1 = 8 - lShift1;
5530 unsigned int lShift2, rShift2, uCase;
5531 unsigned int uVacantIdx = 4*(uLength1 % 2);
5532 unsigned int uStartIdx = 4*(uBeginIdx2 % 2);
5533 if((uVacantIdx < uStartIdx))
5536 lShift2 = uStartIdx;
5537 rShift2 = 8 - lShift2;
5539 else if((uVacantIdx == uStartIdx) && (uVacantIdx > 0))
5545 else if((uVacantIdx == uStartIdx) && (uVacantIdx == 0))
5554 rShift2 = uVacantIdx - uStartIdx;
5555 lShift2 = 8 - rShift2;
5560 TSeqPos uStart1 = uBeginIdx1/2;
5562 if(((uBeginIdx1 + uLength1) % 2) == 0)
5563 uEnd1 = (uBeginIdx1 + uLength1)/2;
5565 uEnd1 = (uBeginIdx1 + uLength1)/2 + 1;
5567 TSeqPos uStart2 = uBeginIdx2/2;
5569 if(((uBeginIdx2 + uLength2) % 2) == 0)
5570 uEnd2 = (uBeginIdx2 + uLength2)/2;
5572 uEnd2 = (uBeginIdx2 + uLength2)/2 + 1;
5575 vector<char>::const_iterator i_in1_begin = in_seq1_data.begin() + uStart1;
5576 vector<char>::const_iterator i_in1_end = in_seq1_data.begin() + uEnd1 - 1;
5577 vector<char>::const_iterator i_in2_begin = in_seq2_data.begin() + uStart2;
5578 vector<char>::const_iterator i_in2_end = in_seq2_data.begin() + uEnd2;
5581 vector<char>::iterator i_out = out_seq_data.begin() - 1;
5582 vector<char>::const_iterator i_in1;
5583 vector<char>::const_iterator i_in2;
5586 for(i_in1 = i_in1_begin; i_in1 != i_in1_end; ++i_in1)
5587 (*(++i_out)) = ((*i_in1) << lShift1) | ((*(i_in1+1) & 255) >> rShift1);
5591 if((uLength1 % 2) == 0)
5592 uEndOutByte = uLength1/2 - 1;
5594 uEndOutByte = uLength1/2;
5595 if(i_out != (out_seq_data.begin() + uEndOutByte))
5596 (*(++i_out)) = (*i_in1) << lShift1;
5599 unsigned char uMask1 = 255 << (8 - 4*(uLength1 % 2));
5600 unsigned char uMask2 = 255 >> (4*(uBeginIdx2 % 2));
5605 if((i_in2_begin+1) == i_in2_end)
5607 (*(++i_out)) = (*i_in2_begin) << lShift2;
5608 return uTotalLength;
5613 ((*i_in2_begin) << lShift2) |
5614 (((*(i_in2_begin+1)) & 255) >> rShift2);
5619 (*i_out) |= (*i_in2_begin) & uMask2;
5620 if((i_in2_begin+1) == i_in2_end)
5621 return uTotalLength;
5624 (*(++i_out)) = (*i_in2_begin);
5625 if((i_in2_begin+1) == i_in2_end)
5626 return uTotalLength;
5629 if((i_in2_begin+1) == i_in2_end)
5632 (*i_out) |= ((*i_in2_begin) & uMask2) >> rShift2;
5633 if(++i_out != out_seq_data.end())
5634 (*i_out) = (*i_in2_begin) << lShift2;
5635 return uTotalLength;
5641 (((*i_in2_begin) & uMask2) >> rShift2) |
5642 ((*(i_in2_begin+1) & ~uMask2) << lShift2);
5649 for(i_in2 = i_in2_begin+uSeq2Inc; (i_in2 != i_in2_end) &&
5650 ((i_in2+1) != i_in2_end); ++i_in2) {
5652 ((*i_in2) << lShift2) | ((*(i_in2+1) & 255) >> rShift2);
5656 if((++i_out != out_seq_data.end()) && (i_in2 != i_in2_end))
5657 (*i_out) = (*i_in2) << lShift2;
5659 return uTotalLength;
5682 if((uBeginIdx1 >= in_seq1_data.size()) &&
5683 (uBeginIdx2 >= in_seq2_data.size()))
5688 if(((uBeginIdx1 + uLength1) > in_seq1_data.size()) || uLength1 == 0)
5689 uLength1 =
static_cast<TSeqPos>(in_seq1_data.size()) - uBeginIdx1;
5691 if(((uBeginIdx2 + uLength2) > in_seq2_data.size()) || uLength2 == 0)
5692 uLength2 =
static_cast<TSeqPos>(in_seq2_data.size()) - uBeginIdx2;
5695 out_seq_data.append(in_seq1_data.substr(uBeginIdx1,uLength1));
5696 out_seq_data.append(in_seq2_data.substr(uBeginIdx2,uLength2));
5698 return uLength1 + uLength2;
5721 if((uBeginIdx1 >= in_seq1_data.size()) &&
5722 (uBeginIdx2 >= in_seq2_data.size()))
5725 if(((uBeginIdx1 + uLength1) > in_seq1_data.size()) || uLength1 == 0)
5726 uLength1 =
static_cast<TSeqPos>(in_seq1_data.size()) - uBeginIdx1;
5728 if(((uBeginIdx2 + uLength2) > in_seq2_data.size()) || uLength2 == 0)
5729 uLength2 =
static_cast<TSeqPos>(in_seq2_data.size()) - uBeginIdx2;
5732 vector<char>::const_iterator i_in1_begin =
5733 in_seq1_data.begin() + uBeginIdx1;
5734 vector<char>::const_iterator i_in1_end = i_in1_begin + uLength1;
5735 vector<char>::const_iterator i_in2_begin =
5736 in_seq2_data.begin() + uBeginIdx2;
5737 vector<char>::const_iterator i_in2_end = i_in2_begin + uLength2;
5740 out_seq_data.insert(out_seq_data.end(), i_in1_begin, i_in1_end);
5741 out_seq_data.insert(out_seq_data.end(), i_in2_begin, i_in2_end);
5743 return uLength1 + uLength2;
5766 if((uBeginIdx1 >= in_seq1_data.size()) &&
5767 (uBeginIdx2 >= in_seq2_data.size()))
5772 if(((uBeginIdx1 + uLength1) > in_seq1_data.size()) || uLength1 == 0)
5773 uLength1 =
static_cast<TSeqPos>(in_seq1_data.size()) - uBeginIdx1;
5775 if(((uBeginIdx2 + uLength2) > in_seq2_data.size()) || uLength2 == 0)
5776 uLength2 =
static_cast<TSeqPos>(in_seq2_data.size()) - uBeginIdx2;
5779 out_seq_data.append(in_seq1_data.substr(uBeginIdx1,uLength1));
5780 out_seq_data.append(in_seq2_data.substr(uBeginIdx2,uLength2));
5782 return uLength1 + uLength2;
5808 if((*i_ct)->GetCode() == code_type) {
5831 if((*i_ct)->GetCode() == code_type) {
5832 if ( (*i_ct)->IsSetStart_at() ) {
5833 p.first =
static_cast<TIndex>((*i_ct)->GetStart_at());
5837 p.second = p.first +
static_cast<TIndex>((*i_ct)->GetNum() - 1);
5993 if (from_idx - (*Map).m_StartAt >= (
TIndex)(*Map).m_Size) {
5995 from_idx -
static_cast<TIndex>((*Map).m_StartAt),
6000 return (*Map).m_Table[from_idx];
6009 const vector<char>** vec)
6015 switch (
data.Which() ) {
6017 *
str = &(
data.GetIupacna().Get());
6021 *vec = &(
data.GetNcbi2na().Get());
6025 *vec = &(
data.GetNcbi4na().Get());
6029 *vec = &(
data.GetNcbi8na().Get());
6033 *
str = &(
data.GetIupacaa().Get());
6037 *vec = &(
data.GetNcbi8aa().Get());
6041 *
str = &(
data.GetNcbieaa().Get());
6045 *vec = &(
data.GetNcbistdaa().Get());
6067 switch (
data.Which() ) {
6069 *
str = &(
data.SetIupacna().Set());
6073 *vec = &(
data.SetNcbi2na().Set());
6077 *vec = &(
data.SetNcbi4na().Set());
6081 *vec = &(
data.SetNcbi8na().Set());
6085 *
str = &(
data.SetIupacaa().Set());
6089 *vec = &(
data.SetNcbi8aa().Set());
6093 *
str = &(
data.SetNcbieaa().Set());
6097 *vec = &(
data.SetNcbistdaa().Set());
6116 "-- This is the set of NCBI sequence code tables\n",
6117 "-- J.Ostell 10/18/91\n",
6120 "Seq-code-set ::= {\n",
6121 " codes { -- codes\n",
6123 " code iupacna ,\n",
6124 " num 25 , -- continuous 65-89\n",
6125 " one-letter TRUE , -- all one letter codes\n",
6126 " start-at 65 , -- starts with A, ASCII 65\n",
6128 " { symbol \"A\", name \"Adenine\" },\n",
6129 " { symbol \"B\" , name \"G or T or C\" },\n",
6130 " { symbol \"C\", name \"Cytosine\" },\n",
6131 " { symbol \"D\", name \"G or A or T\" },\n",
6132 " { symbol \"\", name \"\" },\n",
6133 " { symbol \"\", name \"\" },\n",
6134 " { symbol \"G\", name \"Guanine\" },\n",
6135 " { symbol \"H\", name \"A or C or T\" } ,\n",
6136 " { symbol \"\", name \"\" },\n",
6137 " { symbol \"\", name \"\" },\n",
6138 " { symbol \"K\", name \"G or T\" },\n",
6139 " { symbol \"\", name \"\"},\n",
6140 " { symbol \"M\", name \"A or C\" },\n",
6141 " { symbol \"N\", name \"A or G or C or T\" } ,\n",
6142 " { symbol \"\", name \"\" },\n",
6143 " { symbol \"\", name \"\" },\n",
6144 " { symbol \"\", name \"\"},\n",
6145 " { symbol \"R\", name \"G or A\"},\n",
6146 " { symbol \"S\", name \"G or C\"},\n",
6147 " { symbol \"T\", name \"Thymine\"},\n",
6148 " { symbol \"\", name \"\"},\n",
6149 " { symbol \"V\", name \"G or C or A\"},\n",
6150 " { symbol \"W\", name \"A or T\" },\n",
6151 " { symbol \"\", name \"\"},\n",
6152 " { symbol \"Y\", name \"T or C\"}\n",
6153 " } , -- end of table\n",
6154 " comps { -- complements\n",
6183 " code iupacaa ,\n",
6184 " num 26 , -- continuous 65-90\n",
6185 " one-letter TRUE , -- all one letter codes\n",
6186 " start-at 65 , -- starts with A, ASCII 65\n",
6188 " { symbol \"A\", name \"Alanine\" },\n",
6189 " { symbol \"B\" , name \"Asp or Asn\" },\n",
6190 " { symbol \"C\", name \"Cysteine\" },\n",
6191 " { symbol \"D\", name \"Aspartic Acid\" },\n",
6192 " { symbol \"E\", name \"Glutamic Acid\" },\n",
6193 " { symbol \"F\", name \"Phenylalanine\" },\n",
6194 " { symbol \"G\", name \"Glycine\" },\n",
6195 " { symbol \"H\", name \"Histidine\" } ,\n",
6196 " { symbol \"I\", name \"Isoleucine\" },\n",
6197 " { symbol \"J\", name \"Leu or Ile\" },\n",
6198 " { symbol \"K\", name \"Lysine\" },\n",
6199 " { symbol \"L\", name \"Leucine\" },\n",
6200 " { symbol \"M\", name \"Methionine\" },\n",
6201 " { symbol \"N\", name \"Asparagine\" } ,\n",
6202 " { symbol \"O\", name \"Pyrrolysine\" },\n",
6203 " { symbol \"P\", name \"Proline\" },\n",
6204 " { symbol \"Q\", name \"Glutamine\"},\n",
6205 " { symbol \"R\", name \"Arginine\"},\n",
6206 " { symbol \"S\", name \"Serine\"},\n",
6207 " { symbol \"T\", name \"Threonine\"},\n",
6208 " { symbol \"U\", name \"Selenocysteine\"}, -- was empty\n",
6209 " { symbol \"V\", name \"Valine\"},\n",
6210 " { symbol \"W\", name \"Tryptophan\" },\n",
6211 " { symbol \"X\", name \"Undetermined or atypical\"},\n",
6212 " { symbol \"Y\", name \"Tyrosine\"},\n",
6213 " { symbol \"Z\", name \"Glu or Gln\" }\n",
6214 " } -- end of table \n",
6217 " code ncbieaa ,\n",
6218 " num 49 , -- continuous 42-90\n",
6219 " one-letter TRUE , -- all one letter codes\n",
6220 " start-at 42 , -- starts with *, ASCII 42\n",
6222 " { symbol \"*\", name \"Termination\" } ,\n",
6223 " { symbol \"\", name \"\" } ,\n",
6224 " { symbol \"\", name \"\" } ,\n",
6225 " { symbol \"-\", name \"Gap\" } ,\n",
6226 " { symbol \"\", name \"\" } ,\n",
6227 " { symbol \"\", name \"\" } ,\n",
6228 " { symbol \"\", name \"\" } ,\n",
6229 " { symbol \"\", name \"\" } ,\n",
6230 " { symbol \"\", name \"\" } ,\n",
6231 " { symbol \"\", name \"\" } ,\n",
6232 " { symbol \"\", name \"\" } ,\n",
6233 " { symbol \"\", name \"\" } ,\n",
6234 " { symbol \"\", name \"\" } ,\n",
6235 " { symbol \"\", name \"\" } ,\n",
6236 " { symbol \"\", name \"\" } ,\n",
6237 " { symbol \"\", name \"\" } ,\n",
6238 " { symbol \"\", name \"\" } ,\n",
6239 " { symbol \"\", name \"\" } ,\n",
6240 " { symbol \"\", name \"\" } ,\n",
6241 " { symbol \"\", name \"\" } ,\n",
6242 " { symbol \"\", name \"\" } ,\n",
6243 " { symbol \"\", name \"\" } ,\n",
6244 " { symbol \"\", name \"\" } ,\n",
6245 " { symbol \"A\", name \"Alanine\" },\n",
6246 " { symbol \"B\" , name \"Asp or Asn\" },\n",
6247 " { symbol \"C\", name \"Cysteine\" },\n",
6248 " { symbol \"D\", name \"Aspartic Acid\" },\n",
6249 " { symbol \"E\", name \"Glutamic Acid\" },\n",
6250 " { symbol \"F\", name \"Phenylalanine\" },\n",
6251 " { symbol \"G\", name \"Glycine\" },\n",
6252 " { symbol \"H\", name \"Histidine\" } ,\n",
6253 " { symbol \"I\", name \"Isoleucine\" },\n",
6254 " { symbol \"J\", name \"Leu or Ile\" },\n",
6255 " { symbol \"K\", name \"Lysine\" },\n",
6256 " { symbol \"L\", name \"Leucine\" },\n",
6257 " { symbol \"M\", name \"Methionine\" },\n",
6258 " { symbol \"N\", name \"Asparagine\" } ,\n",
6259 " { symbol \"O\", name \"Pyrrolysine\" },\n",
6260 " { symbol \"P\", name \"Proline\" },\n",
6261 " { symbol \"Q\", name \"Glutamine\"},\n",
6262 " { symbol \"R\", name \"Arginine\"},\n",
6263 " { symbol \"S\", name \"Serine\"},\n",
6264 " { symbol \"T\", name \"Threonine\"},\n",
6265 " { symbol \"U\", name \"Selenocysteine\"},\n",
6266 " { symbol \"V\", name \"Valine\"},\n",
6267 " { symbol \"W\", name \"Tryptophan\" },\n",
6268 " { symbol \"X\", name \"Undetermined or atypical\"},\n",
6269 " { symbol \"Y\", name \"Tyrosine\"},\n",
6270 " { symbol \"Z\", name \"Glu or Gln\" }\n",
6271 " } -- end of table \n",
6274 " code iupacaa3 ,\n",
6275 " num 28 , -- continuous 0-27\n",
6276 " one-letter FALSE , -- all 3 letter codes\n",
6278 " { symbol \"---\", name \"Gap\" } ,\n",
6279 " { symbol \"Ala\", name \"Alanine\" },\n",
6280 " { symbol \"Asx\" , name \"Asp or Asn\" },\n",
6281 " { symbol \"Cys\", name \"Cysteine\" },\n",
6282 " { symbol \"Asp\", name \"Aspartic Acid\" },\n",
6283 " { symbol \"Glu\", name \"Glutamic Acid\" },\n",
6284 " { symbol \"Phe\", name \"Phenylalanine\" },\n",
6285 " { symbol \"Gly\", name \"Glycine\" },\n",
6286 " { symbol \"His\", name \"Histidine\" } ,\n",
6287 " { symbol \"Ile\", name \"Isoleucine\" },\n",
6288 " { symbol \"Lys\", name \"Lysine\" },\n",
6289 " { symbol \"Leu\", name \"Leucine\" },\n",
6290 " { symbol \"Met\", name \"Methionine\" },\n",
6291 " { symbol \"Asn\", name \"Asparagine\" } ,\n",
6292 " { symbol \"Pro\", name \"Proline\" },\n",
6293 " { symbol \"Gln\", name \"Glutamine\"},\n",
6294 " { symbol \"Arg\", name \"Arginine\"},\n",
6295 " { symbol \"Ser\", name \"Serine\"},\n",
6296 " { symbol \"Thr\", name \"Threonine\"},\n",
6297 " { symbol \"Val\", name \"Valine\"},\n",
6298 " { symbol \"Trp\", name \"Tryptophan\" },\n",
6299 " { symbol \"Xxx\", name \"Undetermined or atypical\"},\n",
6300 " { symbol \"Tyr\", name \"Tyrosine\"},\n",
6301 " { symbol \"Glx\", name \"Glu or Gln\" },\n",
6302 " { symbol \"Sec\", name \"Selenocysteine\"},\n",
6303 " { symbol \"Ter\", name \"Termination\" },\n",
6304 " { symbol \"Pyl\", name \"Pyrrolysine\"},\n",
6305 " { symbol \"Xle\", name \"Leu or Ile\"}\n",
6306 " } -- end of table \n",
6308 " { -- NCBIstdaa\n",
6309 " code ncbistdaa ,\n",
6310 " num 28 , -- continuous 0-27\n",
6311 " one-letter TRUE , -- all one letter codes\n",
6313 " { symbol \"-\", name \"Gap\" } , -- 0\n",
6314 " { symbol \"A\", name \"Alanine\" }, -- 1\n",
6315 " { symbol \"B\" , name \"Asp or Asn\" }, -- 2\n",
6316 " { symbol \"C\", name \"Cysteine\" }, -- 3\n",
6317 " { symbol \"D\", name \"Aspartic Acid\" }, -- 4\n",
6318 " { symbol \"E\", name \"Glutamic Acid\" }, -- 5\n",
6319 " { symbol \"F\", name \"Phenylalanine\" }, -- 6\n",
6320 " { symbol \"G\", name \"Glycine\" }, -- 7\n",
6321 " { symbol \"H\", name \"Histidine\" } , -- 8\n",
6322 " { symbol \"I\", name \"Isoleucine\" }, -- 9\n",
6323 " { symbol \"K\", name \"Lysine\" }, -- 10\n",
6324 " { symbol \"L\", name \"Leucine\" }, -- 11\n",
6325 " { symbol \"M\", name \"Methionine\" }, -- 12\n",
6326 " { symbol \"N\", name \"Asparagine\" } , -- 13\n",
6327 " { symbol \"P\", name \"Proline\" }, -- 14\n",
6328 " { symbol \"Q\", name \"Glutamine\"}, -- 15\n",
6329 " { symbol \"R\", name \"Arginine\"}, -- 16\n",
6330 " { symbol \"S\", name \"Serine\"}, -- 17\n",
6331 " { symbol \"T\", name \"Threoine\"}, -- 18\n",
6332 " { symbol \"V\", name \"Valine\"}, -- 19\n",
6333 " { symbol \"W\", name \"Tryptophan\" }, -- 20\n",
6334 " { symbol \"X\", name \"Undetermined or atypical\"}, -- 21\n",
6335 " { symbol \"Y\", name \"Tyrosine\"}, -- 22\n",
6336 " { symbol \"Z\", name \"Glu or Gln\" }, -- 23\n",
6337 " { symbol \"U\", name \"Selenocysteine\"}, -- 24 \n",
6338 " { symbol \"*\", name \"Termination\" }, -- 25\n",
6339 " { symbol \"O\", name \"Pyrrolysine\" }, -- 26\n",
6340 " { symbol \"J\", name \"Leu or Ile\" } -- 27\n",
6341 " } -- end of table \n",
6344 " code ncbi2na ,\n",
6345 " num 4 , -- continuous 0-3\n",
6346 " one-letter TRUE , -- all one letter codes\n",
6348 " { symbol \"A\", name \"Adenine\" },\n",
6349 " { symbol \"C\", name \"Cytosine\" },\n",
6350 " { symbol \"G\", name \"Guanine\" },\n",
6351 " { symbol \"T\", name \"Thymine/Uracil\"}\n",
6352 " } , -- end of table \n",
6353 " comps { -- complements\n",
6361 " code ncbi4na ,\n",
6362 " num 16 , -- continuous 0-15\n",
6363 " one-letter TRUE , -- all one letter codes\n",
6365 " { symbol \"-\", name \"Gap\" } ,\n",
6366 " { symbol \"A\", name \"Adenine\" },\n",
6367 " { symbol \"C\", name \"Cytosine\" },\n",
6368 " { symbol \"M\", name \"A or C\" },\n",
6369 " { symbol \"G\", name \"Guanine\" },\n",
6370 " { symbol \"R\", name \"G or A\"},\n",
6371 " { symbol \"S\", name \"G or C\"},\n",
6372 " { symbol \"V\", name \"G or C or A\"},\n",
6373 " { symbol \"T\", name \"Thymine/Uracil\"},\n",
6374 " { symbol \"W\", name \"A or T\" },\n",
6375 " { symbol \"Y\", name \"T or C\"} ,\n",
6376 " { symbol \"H\", name \"A or C or T\" } ,\n",
6377 " { symbol \"K\", name \"G or T\" },\n",
6378 " { symbol \"D\", name \"G or A or T\" },\n",
6379 " { symbol \"B\" , name \"G or T or C\" },\n",
6380 " { symbol \"N\", name \"A or G or C or T\" }\n",
6381 " } , -- end of table \n",
6382 " comps { -- complements\n",
6401 " } , -- end of codes\n",
6404 " from iupacna ,\n",
6436 " from iupacna ,\n",
6441 " 0, -- @ used by FastaToSeqEntry to convert hyphen to gap\n",
6469 " from ncbi2na ,\n",
6479 " from ncbi2na ,\n",
6489 " from ncbi4na ,\n",
6493 " 78, -- gap -> N\n",
6511 " from ncbi4na ,\n",
6515 " 3, -- gap -> T\n",
6533 " from iupacaa ,\n",
6538 " 65 , -- they map directly\n",
6547 " 74, -- J - was 255\n",
6552 " 79, -- O - was 255\n",
6558 " 85, -- U - was 255\n",
6566 " from ncbieaa ,\n",
6571 " 88 , -- termination -> X\n",
6574 " 88, -- Gap -> X\n",
6594 " 65 , -- from here they map directly\n",
6603 " 74, -- J - was 255\n",
6608 " 79, -- O - was 255\n",
6614 " 85, -- U was -> X 88\n",
6622 " from iupacaa ,\n",
6623 " to ncbistdaa ,\n",
6627 " 1 , -- they map directly\n",
6636 " 27, -- J - was 255\n",
6641 " 26, -- O - was 255\n",
6647 " 24, -- U - was 255\n",
6655 " from ncbieaa ,\n",
6656 " to ncbistdaa ,\n",
6660 " 25, -- termination\n",
6683 " 1 , -- they map directly\n",
6692 " 27, -- J - was 255\n",
6697 " 26, -- O - was 255\n",
6711 " from ncbistdaa ,\n",
6716 " 65 , -- they map directly with holes for O and J\n",
6741 " 79, -- O - new\n",
6742 " 74} -- J - new\n",
6745 " from ncbistdaa ,\n",
6749 " 255 , -- \"-\"\n",
6750 " 65 , -- they map directly with holes for O and J\n",
6773 " 85, -- U - was 88\n",
6775 " 79, -- O - new\n",
6776 " 74} -- J - new\n",
6779 "-- end of seq-code-set -- }",
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void AddAmbiguity(char in_byte, TSeqPos &seq_pos)
char m_LastAmbChar
Last previous ambiguity character.
CAmbiguityContext(vector< Uint4 > &amb_buff, int seq_length)
vector< Uint4 > & m_vAmbBuf
Ambiguity buffer to fill.
static SIZE_TYPE Pack(const string &src, TCoding src_coding, vector< char > &dst, TCoding &dst_coding, TSeqPos length=ncbi::numeric_limits< TSeqPos >::max())
static SIZE_TYPE Convert(const CTempString &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst, TCoding dst_coding)
static SIZE_TYPE Reverse(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
static SIZE_TYPE ReverseComplement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
static SIZE_TYPE Complement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
CWrapper_2D(size_t size1, int start1, size_t size2, int start2)
CWrapper_table(size_t size, size_t start)
const string & GetIupacaa3(TIndex ncbistdaa)
CRef< CMap_table > m_Ncbi2naNcbi4na
CRef< CFast_table2 > InitFastNcbi4naIupacna()
TSeqPos GetNcbistdaaCopy(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos AppendNcbi4na(CSeq_data *out_seq, const CSeq_data &in_seq1, TSeqPos uBeginIdx1, TSeqPos uLength1, const CSeq_data &in_seq2, TSeqPos uBeginIdx2, TSeqPos uLength2) const
TSeqPos GetIupacnaCopy(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos Reverse(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CCode_comp > m_Ncbi4naComplement
CRef< CCode_table > m_Ncbieaa
TSeqPos AppendIupacaa(CSeq_data *out_seq, const CSeq_data &in_seq1, TSeqPos uBeginIdx1, TSeqPos uLength1, const CSeq_data &in_seq2, TSeqPos uBeginIdx2, TSeqPos uLength2) const
CRef< CMap_table > m_IupacaaNcbistdaa
CRef< CMap_table > InitMaps(ESeq_code_type from_type, ESeq_code_type to_type)
TSeqPos KeepNcbi4na(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CCode_comp > InitIupacnaComplement()
CRef< CFast_4_1 > InitFastIupacnaNcbi2na()
CRef< CCode_comp > InitNcbi2naComplement()
TSeqPos GetNcbi2naCopy(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos GetCopy(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos KeepIupacna(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos ComplementIupacna(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CCode_table > m_Ncbistdaa
CRef< CMap_table > m_NcbistdaaIupacaa
CRef< CFast_2_1 > InitFastNcbi4naNcbi2na()
CRef< CAmbig_detect > InitAmbigNcbi4naNcbi2na()
TSeqPos ReverseNcbi4na(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CWrapper_table< char > CCode_table
TSeqPos KeepNcbi2na(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
bool FastValidateNcbieaa(const CSeq_data &in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos AppendNcbieaa(CSeq_data *out_seq, const CSeq_data &in_seq1, TSeqPos uBeginIdx1, TSeqPos uLength1, const CSeq_data &in_seq2, TSeqPos uBeginIdx2, TSeqPos uLength2) const
CSeqportUtil::TPair TPair
TSeqPos ReverseComplement(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CMap_table > m_IupacnaNcbi2na
vector< map< string, TIndex > > m_StringIndex
CRef< CMap_table > m_Ncbi2naIupacna
bool IsCodeAvailable(CSeq_data::E_Choice code_type)
CRef< CCode_comp > m_Ncbi2naComplement
CRef< CCode_table > m_Iupacna
TSeqPos GetNcbieaaCopy(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos ReverseComplementNcbi4na(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CMap_table > m_NcbieaaNcbistdaa
vector< TIndex > m_StartAt
vector< vector< TIndex > > m_IndexComplement
CWrapper_2D< unsigned char > CFast_4_1
CRef< CMap_table > m_IupacaaNcbieaa
TSeqPos GetAmbigs(const CSeq_data &in_seq, CSeq_data *out_seq, vector< TSeqPos > *out_indices, CSeq_data::E_Choice to_code, TSeqPos uBeginIdx, TSeqPos uLength) const
const string & GetCodeOrName(CSeq_data::E_Choice code_type, TIndex idx, bool get_code)
TPair GetCodeIndexFromTo(CSeq_data::E_Choice code_type)
CRef< CSeq_code_set > m_SeqCodeSet
vector< vector< string > > m_IndexString[2]
CWrapper_2D< unsigned char > CFast_2_1
CRef< CCode_comp > InitNcbi4naComplement()
CWrapper_table< int > CMap_table
CRef< CCode_rev > InitNcbi2naRev()
CRef< CSeq_code_set > Init()
TSeqPos KeepIupacaa(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CWrapper_table< char > CCode_rev
CRef< CAmbig_detect > m_DetectAmbigNcbi4naNcbi2na
CRef< SMasksArray > m_Masks
TSeqPos ComplementNcbi4na(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
size_t Pack(CSeq_data *in_seq, TSeqPos uLength) const
bool FastValidateIupacaa(const CSeq_data &in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
void ValidateIupacna(const CSeq_data &in_seq, vector< TSeqPos > *badIdx, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CMap_table > m_Ncbi4naNcbi2na
CRef< CCode_rev > InitNcbi4naRev()
TIndex GetIndexComplement(CSeq_data::E_Choice code_type, TIndex idx)
TSeqPos ReverseNcbi2na(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CCode_comp > m_Iupacna_complement
CSeqportUtil::TIndex TIndex
CSeqportUtil_implementation()
TSeqPos ReverseIupacna(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CWrapper_table< unsigned short > CFast_table2
TIndex GetMapToIndex(CSeq_data::E_Choice from_type, CSeq_data::E_Choice to_type, TIndex from_idx)
CRef< CFast_2_1 > m_FastNcbi4naNcbi2na
CRef< CCode_table > InitCodes(ESeq_code_type code_type)
CRef< CFast_4_1 > m_FastIupacnaNcbi2na
CRef< CFast_2_1 > m_FastIupacnaNcbi4na
CRef< CMap_table > m_Ncbi4naIupacna
TSeqPos Keep(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CAmbig_detect > InitAmbigIupacnaNcbi2na()
TSeqPos GetAmbigs_iupacna_ncbi2na(const CSeq_data &in_seq, CSeq_data *out_seq, vector< TSeqPos > *out_indices, TSeqPos uBeginIdx, TSeqPos uLength) const
void Validate(const CSeq_data &in_seq, vector< TSeqPos > *badIdx, TSeqPos uBeginIdx, TSeqPos uLength) const
void ValidateNcbieaa(const CSeq_data &in_seq, vector< TSeqPos > *badIdx, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos GetAmbigs_ncbi4na_ncbi2na(const CSeq_data &in_seq, CSeq_data *out_seq, vector< TSeqPos > *out_indices, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos ReverseComplementIupacna(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos Adjust(TSeqPos *uBeginIdx, TSeqPos *uLength, TSeqPos uInSeqBytes, TSeqPos uInSeqsPerByte, TSeqPos uOutSeqsPerByte) const
TIndex GetIndex(CSeq_data::E_Choice code_type, const string &code)
CRef< CMap_table > m_NcbistdaaNcbieaa
TSeqPos Complement(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CWrapper_table< string > CCode_table_str
static const char * sm_StrAsnData[]
CRef< CCode_table > m_Iupacaa
CRef< CCode_rev > m_Ncbi2naRev
TSeqPos AppendNcbi2na(CSeq_data *out_seq, const CSeq_data &in_seq1, TSeqPos uBeginIdx1, TSeqPos uLength1, const CSeq_data &in_seq2, TSeqPos uBeginIdx2, TSeqPos uLength2) const
TSeqPos AppendNcbistdaa(CSeq_data *out_seq, const CSeq_data &in_seq1, TSeqPos uBeginIdx1, TSeqPos uLength1, const CSeq_data &in_seq2, TSeqPos uBeginIdx2, TSeqPos uLength2) const
bool FastValidateNcbistdaa(const CSeq_data &in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos Append(CSeq_data *out_seq, const CSeq_data &in_seq1, TSeqPos uBeginIdx1, TSeqPos uLength1, const CSeq_data &in_seq2, TSeqPos uBeginIdx2, TSeqPos uLength2) const
CWrapper_table< unsigned int > CFast_table4
TSeqPos Convert(const CSeq_data &in_seq, CSeq_data *out_seq, CSeq_data::E_Choice to_code, TSeqPos uBeginIdx, TSeqPos uLength, bool bAmbig, CRandom::TValue seed, TSeqPos total_length=0, TSeqPos *out_seq_length=0, vector< Uint4 > *blast_ambig=0) const
TSeqPos KeepNcbieaa(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CWrapper_table< unsigned char > CAmbig_detect
bool FastValidateIupacna(const CSeq_data &in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos ComplementNcbi2na(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos AppendIupacna(CSeq_data *out_seq, const CSeq_data &in_seq1, TSeqPos uBeginIdx1, TSeqPos uLength1, const CSeq_data &in_seq2, TSeqPos uBeginIdx2, TSeqPos uLength2) const
void ValidateIupacaa(const CSeq_data &in_seq, vector< TSeqPos > *badIdx, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos x_ConvertAmbig(const CSeq_data &in_seq, CSeq_data *out_seq, CSeq_data::E_Choice to_code, TSeqPos uBeginIdx, TSeqPos uLength, CRandom::TValue seed, TSeqPos total_length=0, TSeqPos *out_seq_length=0, vector< Uint4 > *blast_ambig=0) const
CRef< CMap_table > m_IupacnaNcbi4na
CRef< CFast_2_1 > InitFastIupacnaNcbi4na()
CWrapper_table< char > CCode_comp
void x_GetSeqFromSeqData(const CSeq_data &data, const string **str, const vector< char > **vec) const
bool FastValidate(const CSeq_data &in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos GetNcbi4naCopy(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
TSeqPos MapIupacnaToNcbi2na(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength, bool bAmbig, CRandom::TValue seed, TSeqPos total_length, TSeqPos *out_seq_length, vector< Uint4 > *blast_ambig) const
CRef< CMap_table > m_NcbieaaIupacaa
TSeqPos ReverseComplementNcbi2na(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CAmbig_detect > m_DetectAmbigIupacnaNcbi2na
~CSeqportUtil_implementation()
TSeqPos GetIupacaaCopy(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
void ValidateNcbistdaa(const CSeq_data &in_seq, vector< TSeqPos > *badIdx, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< SMasksArray > InitMasks()
TSeqPos MapNcbi4naToNcbi2na(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength, bool bAmbig, CRandom::TValue seed, TSeqPos total_length, TSeqPos *out_seq_length, vector< Uint4 > *blast_ambig) const
CRef< CFast_table2 > InitFastNcbi2naNcbi4na()
TSeqPos KeepNcbistdaa(CSeq_data *in_seq, TSeqPos uBeginIdx, TSeqPos uLength) const
CRef< CCode_rev > m_Ncbi4naRev
static CSeqportUtil_implementation & x_GetImplementation(void)
static TPair GetCodeIndexFromTo(CSeq_data::E_Choice code_type)
static TSeqPos Reverse(CSeq_data *in_seq, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static const string & GetName(CSeq_data::E_Choice code_type, TIndex idx)
static bool IsCodeAvailable(CSeq_data::E_Choice code_type)
static bool FastValidate(const CSeq_data &in_seq, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static TSeqPos Convert(const CSeq_data &in_seq, CSeq_data *out_seq, CSeq_data::E_Choice to_code, TSeqPos uBeginIdx=0, TSeqPos uLength=0, bool bAmbig=false, Uint4 seed=17734276)
static TIndex GetIndex(CSeq_data::E_Choice code_type, const string &code)
static TIndex GetIndexComplement(CSeq_data::E_Choice code_type, TIndex idx)
static TSeqPos ConvertWithBlastAmbig(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx, TSeqPos uLength, TSeqPos total_length, TSeqPos *out_seq_length, vector< Uint4 > *blast_ambig)
static TSeqPos GetAmbigs(const CSeq_data &in_seq, CSeq_data *out_seq, vector< TSeqPos > *out_indices, CSeq_data::E_Choice to_code=CSeq_data::e_Ncbi2na, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static TIndex GetMapToIndex(CSeq_data::E_Choice from_type, CSeq_data::E_Choice to_type, TIndex from_idx)
static TSeqPos GetCopy(const CSeq_data &in_seq, CSeq_data *out_seq, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static TSeqPos Complement(CSeq_data *in_seq, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static TSeqPos Keep(CSeq_data *in_seq, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static TSeqPos ReverseComplement(CSeq_data *in_seq, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static const string & GetCode(CSeq_data::E_Choice code_type, TIndex idx)
pair< TIndex, TIndex > TPair
static void Validate(const CSeq_data &in_seq, vector< TSeqPos > *badIdx, TSeqPos uBeginIdx=0, TSeqPos uLength=0)
static const string & GetIupacaa3(TIndex ncbistdaa)
static TSeqPos Pack(CSeq_data *in_seq, TSeqPos uLength=ncbi::numeric_limits< TSeqPos >::max())
static TSeqPos Append(CSeq_data *out_seq, const CSeq_data &in_seq1, TSeqPos uBeginIdx1, TSeqPos uLength1, const CSeq_data &in_seq2, TSeqPos uBeginIdx2, TSeqPos uLength2)
container_type::const_iterator const_iterator
static void chk(int check, const char *fmt,...)
static const char * str(char *buf, int n)
CRange< Position > Map(const CRange< Position > &target, const CRange< Position > &range)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
const TPrim & Get(void) const
@ eSerial_AsnText
ASN.1 text.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
uint32_t Uint4
4-byte (32-bit) unsigned integer
Uint4 TValue
Type of the generated integer value and/or the seed value.
TValue GetRand(void)
Get the next random number in the interval [0..GetMax()] (inclusive)
void SetSeed(TValue seed)
Seed the random number generator with "seed".
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_STD::string::size_type SIZE_TYPE
list< CRef< C_E_Table > > TTable
list< CRef< CSeq_code_table > > TCodes
const TMaps & GetMaps(void) const
Get the Maps member data.
ESeq_code_type
sequence representations
const TCodes & GetCodes(void) const
Get the Codes member data.
@ eSeq_code_type_ncbi2na
2 bit nucleic acid code
@ eSeq_code_type_ncbistdaa
consecutive codes for std aas, 0-25
@ eSeq_code_type_ncbi4na
4 bit nucleic acid code
@ eSeq_code_type_ncbieaa
extended ASCII 1 letter aa codes
@ eSeq_code_type_ncbipaa
amino acid probabilities
@ eSeq_code_type_ncbi8aa
8 bit extended amino acid codes
@ eSeq_code_type_ncbi8na
8 bit extended nucleic acid code
@ eSeq_code_type_ncbipna
nucleic acid probabilities
@ eSeq_code_type_iupacaa3
3 letter code only for display
@ eSeq_code_type_iupacaa
IUPAC 1 letter amino acid code.
@ eSeq_code_type_iupacna
IUPAC 1 letter nuc acid code.
const TIupacaa & GetIupacaa(void) const
Get the variant data.
const TIupacna & GetIupacna(void) const
Get the variant data.
const TNcbipaa & GetNcbipaa(void) const
Get the variant data.
const TNcbi8aa & GetNcbi8aa(void) const
Get the variant data.
TNcbieaa & SetNcbieaa(void)
Select the variant.
TIupacna & SetIupacna(void)
Select the variant.
const TNcbieaa & GetNcbieaa(void) const
Get the variant data.
const TNcbistdaa & GetNcbistdaa(void) const
Get the variant data.
TNcbistdaa & SetNcbistdaa(void)
Select the variant.
const TNcbi4na & GetNcbi4na(void) const
Get the variant data.
TNcbi2na & SetNcbi2na(void)
Select the variant.
const TNcbi2na & GetNcbi2na(void) const
Get the variant data.
TNcbi4na & SetNcbi4na(void)
Select the variant.
TIupacaa & SetIupacaa(void)
Select the variant.
virtual void Reset(void)
Reset the whole object.
E_Choice Which(void) const
Which variant is currently selected.
@ e_not_set
No variant selected.
@ e_Ncbipna
nucleic acid probabilities
@ e_Ncbieaa
extended ASCII 1 letter aa codes
@ e_Ncbistdaa
consecutive codes for std aas
@ e_Ncbi2na
2 bit nucleic acid code
@ e_Iupacna
IUPAC 1 letter nuc acid code.
@ e_Ncbipaa
amino acid probabilities
@ e_Ncbi8na
8 bit extended nucleic acid code
@ e_Ncbi4na
4 bit nucleic acid code
@ e_Iupacaa
IUPAC 1 letter amino acid code.
@ e_Ncbi8aa
8 bit extended amino acid codes
const struct ncbi::grid::netcache::search::fields::SIZE size
Static variables safety - create on demand, destroy on application termination.
static const unsigned int kNumCodes
static ESeq_code_type EChoiceToESeq(CSeq_data::E_Choice from_type)
static const char kAmbig4na[16]
static CSafeStatic< CSeqportUtil_implementation > sx_Implementation
static const bool kSymbol
static CSeqUtil::TCoding s_SeqDataToSeqUtil[]
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static bool ambig(char c)