[Seqan-dev] Consensus protein sequence


I am trying to generate a consensus sequence from a list of protein sequences. I think there is a nice tutorial for nucleotide sequences here
https://seqan.readthedocs.io/en/seqan-v2.0.2/Tutorial/MultipleSequenceAlignment.html

Here is the following code I came up with, but it is giving lots of error. Could anyone take a look and let me know what is wrong with this?

globalMsaAlignment(align, Blosum80(-1, -11));

   std::cout << align << std::endl; 

   String<ProfileChar<AminoAcid> > profile;

    resize(profile, length(row(align, 0)));

    for (unsigned rowNo = 0; rowNo < 20u; ++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<AminoAcid> consensus;

    for (unsigned i = 0; i < length(profile); ++i)

    {

        int idx = getMaxIndex(profile[i]);

        if (idx < 20)  // is not gap 

            appendValue(consensus, AminoAcid(getMaxIndex(profile[i])));

    }