align_rm_gaps_invars: Remove gaps and invariant sites from an alignment matrix

View source: R/align_rm_gaps_invars.R

align_rm_gaps_invarsR Documentation

Remove gaps and invariant sites from an alignment matrix

Description

Provide a sequence alignment in matrix format and remove gaps and/or invariant sites.

Usage

align_rm_gaps_invars(alignMat, removeGaps, removeInvars)

Arguments

alignMat

Matrix: A sequence alignment converted into a matrix, with positions in columns, samples in rows, and cells being DNA nucleotides or amino acids. Row names should be names of samples.

removeGaps

Logical: Should gaps be removed? 'TRUE' or 'FALSE'.

removeInvars

Logical: Should invariant sites be removed? 'TRUE' or 'FALSE'.

Details

Gaps will be removed before invariant sites. Removal of gaps occurs for any columns in ‘alignMat' that possess a '’_''. Removal of invariant sites occurs for any column in 'alignMat' where 'length(unique(x))' does not evaluate to >2. Note, this will also include gaps if you do not remove them.

Value

Returns a matrix with same number of rows as 'alignMat', but with any columns removed that are gaps and/or invariant sites. Columns are relabeled as ''pos.X'‘, with ’X', being the relative position in the original alignment.


j-a-thia/genomalicious documentation built on April 13, 2025, 9:41 a.m.