2

I have a sequence of strings like so: ["123-5", "1-45", "--345"]. In result is perfect to get 12345. So sometimes I know that in certain position I have symbol, but do not know which. From examples I get this code.

typedef String<char> TSequence;                 // sequence type
typedef Align<TSequence, ArrayGaps> TAlign;     // align type

unsigned int plate_count = plates.size();

TAlign align;
resize(rows(align), plate_count);
for (unsigned int i = 0; i < plate_count; ++i)
    assignSource(row(align, i), plates[i]);

globalMsaAlignment(align, SimpleScore(5, -3, -1, -3));

// create the profile string
String<ProfileChar<char> > profile;
resize(profile, length(row(align, 0)));
for (unsigned rowNo = 0; rowNo < plate_count; ++rowNo)
    for (unsigned i = 0; i < length(row(align, rowNo)); ++i)
        profile[i].count[ordValue(row(align, rowNo)[i])] += 1;

// call consensus from this string
String<char> consensus;
for (unsigned i = 0; i < length(profile); ++i)
{
    char idx = (char)getMaxIndex(profile[i]);
    if (idx == '-') {
       int bck = profile[i].count[ordValue('-')];
       profile[i].count[ordValue('-')] = 0;
       idx = (char)getMaxIndex(profile[i]);
       if (profile[i].count[ordValue(idx)] == 1) { // ignore single recognitions
          idx = '@';
       }
       profile[i].count[ordValue('-')] = bck;
    }
    appendValue(consensus, idx);
}

return string(toCString(consensus));

How can I tell Seqan that there is a symbol in specific position?

Gralex
  • 4,285
  • 7
  • 26
  • 47

0 Answers0