Clustal Omega uses different approaches to align sequences that already aligned and not-aligned sequences.
If a user opens sequences without gaps in the Alignment Editor and then exports the data to another file, the trailing gaps are also written to the exported file.
The same happens in case ClustalO is run: a temporary file of the Clustal format is created (*.aln) that contains sequences with the trailing gaps and ClustalO is launched with this file. Thus, ClustalO uses the approach for the aligned sequences, the final result alignment differs from the expected one.
The following should be fixed:
- Remove trailing gaps in the temporary file.
- Save the temporary file in FASTA format instead of Clustal, as the Clustal format required sequences to be of the same length - the trailing gaps are added otherwise.