title: How can I fit my data and question in a script for the ace function of the ape pakage in Rstudio?
body: <p>I have 96 amino acid sequences which I aligned with MAFFT and trimmed manually (FASTA format), choose the model of amino acid substitution with ProtTest (LG+I+G model), did the phylogenetic reconstruction with MEGAX (ML method, bootstrap test 1000 replicates, tree in Newick format) and the ancestral reconstruction with PAML, in a total of 664 final amino acid positions. However, my alignment has indels. I am naming each indel with a letter (A to T) and the respective amido acid positions range: A:89-92, B:66-67, C:181-186, D:208-208, E:214-219, F:244-250, G:237-296, H:278-280, I:295-295, J:329-334, K:345-349, L:371-375, M:390-425, N:432-433, O:440-443, P:480-480, Q:500-500, R:541-544, S:600-600. Both the initial and final parts of the sequences is very variable, so from positions 0 to 34 (initial) and 600 to 664 (final), each amino acid position may represent an indel.</p>
  <p>I want to know, at each ancestral node, what is the probability that each indel is present in the ancestral sequence. I was told that the R-studio &quot;ace&quot; function on the package &quot;ape - analysis of phylogenetics and evolution&quot; can perform this task. I have installed both &quot;ape&quot; and &quot;ggtree&quot;. I checked this webpage <a href="https://www.rdocumentation.org/packages/ape/versions/3.0-1/topics/ace" rel="nofollow noreferrer">https://www.rdocumentation.org/packages/ape/versions/3.0-1/topics/ace</a>, however, I have no idea how to construct the script. I am a biologist and newbie to R.</p>
  <p>Can someone please help? Would be greatly appreciated, thanks.</p>