Clean an alignment for codon analysis
codon.clean.msa(x, refseq = NULL, strand = "+")
An object of type msa
The name of the reference sequence to be used. If given,
strip all columns which contain gaps in refseq. Once this is done,
alignment should be in frame. If refseq==NULL
then alignment
should be in frame as it is sent in (no gaps are stripped).
Either "+" or "-". If "-", reverse complement the alignment.
An object of type msa
. It will be the same as the
original msa, with the following modifications:
If refseq is not NULL, columns with gaps in refseq will be stripped.
If strand is "-", the new msa will be the reverse complement of the original.
After the gap stripping and reverse complementing steps, each sequence is searched for stop codons. If encountered, the stop codon and the rest of the sequence to follow is converted to missing data. The resulting msa has a length equal to the longest remaining sequence (end columns with all missing data are removed).