Learn R Programming

rphast (version 1.6.9)

codon.clean.msa: Clean an alignment for codon analysis

Description

Clean an alignment for codon analysis

Usage

codon.clean.msa(x, refseq = NULL, strand = "+")

Arguments

x

An object of type msa

refseq

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).

strand

Either "+" or "-". If "-", reverse complement the alignment.

Value

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).