<p>I had a quick blast of the example sequences and this is the <em>Acacia</em> so ancient vascular plant. It forms a locus within the protein in the first part of the question. This protein is comprises a large repeat amino acid motif (check NCBI), the second &quot;issue sequence&quot; described in the question was close to the size of the repeat locus, but start/stop of the locus is not in accordance with the repeat structure. Thus I don't think the repeat locus is part of the issue.</p>
<p><strong>Genome assemblies</strong> I noted the examples you gave were all draft genomes and this suggest the problem was with the original genome assemblies. If this was true the way to overcome this would be to reassemble the sequence using a reference genome, <em>bwa-mem2</em> type thing. Thus, here the error is occurring way before the sequences is even downloaded. Just to note, repeat structures can often be collapsed on a draft genome assembly, but I don't think thats happened here.</p>
<p><strong>Reading frame</strong> what I think you are doing is performing an alignment in the proteins and then using that alignment as the template which is then transferred to the sequence data. So now the nucleotide data is nicely aligned including all indels. That appears to be the goal of <em>pal2nal</em>. A common error here is reading frame error, particularly at the beginning of the sequence. I use <em>transalign</em> regularly for this purpose and do encounter that error. I don't know how <em>pal2nal</em> deals with reading frame errors so I can't comment, but thats why I wanted to see the nucleotide input to <em>pal2nal</em> to check this.</p>
<p><strong>Trees</strong> the reason this is taking place is because <em>iqtree</em> doesn't permit a tree. That I can help with, I know about tree building. If you post your <em>iqtree</em> command as a separate question , together with the <em>iqtree</em> error, I can probably answer that. What I'll identify is how to build a tree, this likely to exclude sequence, or could be addressed as two trees. Dunno, but if the bottleneck is can't build a tree - thats easily fixable. In this case, is the sequence issue an assembly error, reading frame error ... something else. There's not enough data that I could point to as the underlying source.</p>

CC BY-SA 4.0
2023-06-27T02:36:06.950Z
2023-06-27T02:42:00.060Z
2023-06-27T02:42:00.060Z
M__
<p>I did sequence alignment of a large peptide multi-fasta (n= 4991 sequences). The peptide alignment has sequences with the same length and pal2nal went through just fine... except some of the codon sequences are at half length. If average is X then some sequences are X/2. This is choking IQ-Tree.</p>
<p>I have tried both MUSCLE super5 and MAFFT. The error remain the same (i.e. MUSCLE or MAFFT both lead to some sequences having half of average length) except for different average lengths and average half length in MUSCLE and MAFFT codon sequences. I have pulled out and played with the sequences causing the issue and they seem to be in frame.</p>
<p>Example of peptide sequence not causing an issue: <code>RKVEAFLLFKEMGERGCQPNVHTYTVLIDSFCKERNLDDARKLFDDMFKKGLVPSVVTYNALIDGYCKEGMTEAALEILGMMESKKCNPNARTYNELICGFCKAK</code></p>
<p>corresponding cds
<code>AGGAAAGTGGAAGCTTTTCTACTTTTTAAAGAAATGGGTGAAAGAGGTTGTCAGCCTAATGTTCATACATACACTGTGCTTATTGATTCCTTCTGTAAGGAAAGGAATCTTGATGATGCCAGGAAATTGTTTGATGACATGTTTAAGAAAGGTTTGGTTCCCAGTGTGGTCACTTATAATGCTTTAATTGATGGGTATTGTAAAGAGGGAATGACTGAAGCTGCATTAGAAATTTTAGGTATGATGGAATCAAAGAAATGCAACCCTAATGCTCGGACCTACAATGAATTGATCTGTGGATTTTGTAAAGCTAAA</code>'</p>
<p>Example of peptide causing issue:</p>
<p><code>GLCKGGRLNDAWEIFQYLLAKGYQLNVHTYNAMVHGFCKEGLLDEAISLLYKMEENGCVPNSVTFNVVL</code></p>
<p>corresponding cds
<code>GGTTTGTGCAAAGGTGGTAGATTAAATGATGCGTGGGAGATTTTTCAGTATCTTTTAGCGAAAGGTTATCAACTAAATGTCCATACATATAATGCGATGGTTCATGGTTTTTGCAAAGAAGGTTTGCTTGATGAAGCAATCTCCCTGCTTTATAAAATGGAAGAGAATGGTTGTGTCCCTAATTCTGTAACTTTTAATGTAGTCCTT</code></p>
<p>Any idea what might be going on?</p>

CC BY-SA 4.0
2023-06-25T23:22:26.633Z
The example looks fine to me. The peptide causing an issue is 69 residues in length and the cds is 207, which is correct. If the peptide is supposed to be ~140 residues we'd need to see the full length peptide and/or nucleotide. BTW what is the proportion of half lengths against full transcripts?
M__
CC BY-SA 4.0
2023-06-26T02:29:24.357Z
The peptides are equal in length once they are aligned alongside their orthologs/homologs (i.e. on the other side of sequence alignment). With MAFFT the peptides become something like 31k (including gaps) characters long. Post translation the sequences are something like 93k long and the ones out of whack are about 54k (all of them, the same exact length). Sorry for the confusion, the peptides are not supposed to be the same length per-alignment.
Sudoh
CC BY-SA 4.0
2023-06-26T13:32:42.180Z
I can see whats happening that the 'issue' sequence is a locus within the full gene for *Acacia spp.*. The thing is I can't see the original sequences, i.e. before Pal2Nal. The reality I can probably solve this with all the information. At present I can make a guess, but it's no better than a guess.
M__
CC BY-SA 4.0
2023-06-26T16:22:54.747Z
I am happy to provide the original data, it's all open-source. Do you have a preferred way to receive them?
Sudoh
CC BY-SA 4.0
2023-06-26T16:35:04.457Z
I don't want to wade through 5K sequences. What I am really asking for is a reproducible example. The example provided doesn't help understand the issue, it's the input into pal2nal I'm looking for. What I want to do is compare the input vs the output.
M__
CC BY-SA 4.0
2023-06-26T17:22:52.060Z
The first 8 sequences, containing both 'working' vs 'issue' sequences are [here](https://wormhole.app/pQ3qd#ZY7iuT8B1Rps04PktzkMwA). It's a fork of Firefox send, I can use something else if you are uncomfortable with that. By locus if you mean alternate splicing then it is possible that that is what is at play.
Sudoh
CC BY-SA 4.0
2023-06-26T17:48:35.620Z
Not a problem, doing global alignment on a phylogeny that spans a billion-years was a gamble to begin with. I am grateful you took the time to look at it. I suspect these homo-logs are not real or if they are then the global alignment algorithms we have might not be ready to work on something a phylogeny this deep.
Sudoh
<phylogenetics><phylogeny><proteins><codon>
Pal2nal translation of large multi-fasta files produces a codon translated file where some sequences half length of the average
# Pal2nal translation of large multi-fasta files produces a codon translated file where some sequences half length of the average

(Asked by: username_0 on 2023-06-25)

I did sequence alignment of a large peptide multi-fasta (n= 4991 sequences). The peptide alignment has sequences with the same length and pal2nal went through just fine... except some of the codon sequences are at half length. If average is X then some sequences are X/2. This is choking IQ-Tree.

I have tried both MUSCLE super5 and MAFFT. The error remain the same (i.e. MUSCLE or MAFFT both lead to some sequences having half of average length) except for different average lengths and average half length in MUSCLE and MAFFT codon sequences. I have pulled out and played with the sequences causing the issue and they seem to be in frame.

Example of peptide sequence not causing an issue: `RKVEAFLLFKEMGERGCQPNVHTYTVLIDSFCKERNLDDARKLFDDMFKKGLVPSVVTYNALIDGYCKEGMTEAALEILGMMESKKCNPNARTYNELICGFCKAK`

corresponding cds
`AGGAAAGTGGAAGCTTTTCTACTTTTTAAAGAAATGGGTGAAAGAGGTTGTCAGCCTAATGTTCATACATACACTGTGCTTATTGATTCCTTCTGTAAGGAAAGGAATCTTGATGATGCCAGGAAATTGTTTGATGACATGTTTAAGAAAGGTTTGGTTCCCAGTGTGGTCACTTATAATGCTTTAATTGATGGGTATTGTAAAGAGGGAATGACTGAAGCTGCATTAGAAATTTTAGGTATGATGGAATCAAAGAAATGCAACCCTAATGCTCGGACCTACAATGAATTGATCTGTGGATTTTGTAAAGCTAAA`'

Example of peptide causing issue:

`GLCKGGRLNDAWEIFQYLLAKGYQLNVHTYNAMVHGFCKEGLLDEAISLLYKMEENGCVPNSVTFNVVL`

corresponding cds
`GGTTTGTGCAAAGGTGGTAGATTAAATGATGCGTGGGAGATTTTTCAGTATCTTTTAGCGAAAGGTTATCAACTAAATGTCCATACATATAATGCGATGGTTCATGGTTTTTGCAAAGAAGGTTTGCTTGATGAAGCAATCTCCCTGCTTTATAAAATGGAAGAGAATGGTTGTGTCCCTAATTCTGTAACTTTTAATGTAGTCCTT`

Any idea what might be going on?

**Tags:** phylogenetics, phylogeny, proteins, codon
> **Comments:**
> **username_1**: The example looks fine to me. The peptide causing an issue is 69 residues in length and the cds is 207, which is correct. If the peptide is supposed to be ~140 residues we'd need to see the full length peptide and/or nucleotide. BTW what is the proportion of half lengths against full transcripts?  
> **username_0**: The peptides are equal in length once they are aligned alongside their orthologs/homologs (i.e. on the other side of sequence alignment). With MAFFT the peptides become something like 31k (including gaps) characters long. Post translation the sequences are something like 93k long and the ones out of whack are about 54k (all of them, the same exact length). Sorry for the confusion, the peptides are not supposed to be the same length per-alignment.  
> **username_1**: I can see whats happening that the 'issue' sequence is a locus within the full gene for *Acacia spp.*. The thing is I can't see the original sequences, i.e. before Pal2Nal. The reality I can probably solve this with all the information. At present I can make a guess, but it's no better than a guess.  
> **username_0**: I am happy to provide the original data, it's all open-source. Do you have a preferred way to receive them?  
> **username_1**: I don't want to wade through 5K sequences. What I am really asking for is a reproducible example. The example provided doesn't help understand the issue, it's the input into pal2nal I'm looking for. What I want to do is compare the input vs the output.  
> **username_0**: The first 8 sequences, containing both 'working' vs 'issue' sequences are [here](https://wormhole.app/pQ3qd#ZY7iuT8B1Rps04PktzkMwA). It's a fork of Firefox send, I can use something else if you are uncomfortable with that. By locus if you mean alternate splicing then it is possible that that is what is at play.  
> **username_0**: Not a problem, doing global alignment on a phylogeny that spans a billion-years was a gamble to begin with. I am grateful you took the time to look at it. I suspect these homo-logs are not real or if they are then the global alignment algorithms we have might not be ready to work on something a phylogeny this deep.  

---

## 1 answers

### Answer by username_1 on 2023-06-27. Score: 1

I had a quick blast of the example sequences and this is the *Acacia* so ancient vascular plant. It forms a locus within the protein in the first part of the question. This protein is comprises a large repeat amino acid motif (check NCBI), the second "issue sequence" described in the question was close to the size of the repeat locus, but start/stop of the locus is not in accordance with the repeat structure. Thus I don't think the repeat locus is part of the issue.

**Genome assemblies** I noted the examples you gave were all draft genomes and this suggest the problem was with the original genome assemblies. If this was true the way to overcome this would be to reassemble the sequence using a reference genome, *bwa-mem2* type thing. Thus, here the error is occurring way before the sequences is even downloaded. Just to note, repeat structures can often be collapsed on a draft genome assembly, but I don't think thats happened here.

**Reading frame** what I think you are doing is performing an alignment in the proteins and then using that alignment as the template which is then transferred to the sequence data. So now the nucleotide data is nicely aligned including all indels. That appears to be the goal of *pal2nal*. A common error here is reading frame error, particularly at the beginning of the sequence. I use *transalign* regularly for this purpose and do encounter that error. I don't know how *pal2nal* deals with reading frame errors so I can't comment, but thats why I wanted to see the nucleotide input to *pal2nal* to check this.

**Trees** the reason this is taking place is because *iqtree* doesn't permit a tree. That I can help with, I know about tree building. If you post your *iqtree* command as a separate question , together with the *iqtree* error, I can probably answer that. What I'll identify is how to build a tree, this likely to exclude sequence, or could be addressed as two trees. Dunno, but if the bottleneck is can't build a tree - thats easily fixable. In this case, is the sequence issue an assembly error, reading frame error ... something else. There's not enough data that I could point to as the underlying source.


---

