truncate_alignment: Truncate an annotated Stockholm alignment file with secondary...

truncate_alignmentR Documentation

Truncate an annotated Stockholm alignment file with secondary structure

Description

Simply truncating a Stockholm alignment file that includes secondary structure annotations may result in invalid base pairing, when only one half of a pair is removed. This function converts these half-pairs to "X", indicating unpairable bases.

Usage

truncate_alignment(aln, outfile = NULL, start = 1L, stop = 1000000L)

Arguments

aln

(character filename, connection, or StockholmMultipleAlignment) the stockholm alignment to be truncated.

outfile

(character filename or connection) path or connection to output the truncated alignment to. The default, NULL, instead returns the truncated alignment as an R object.

start

(integer scalar) first base to include in the truncated alignment.

stop

(integer scalar) last base to include in the truncated alignment.

Value

the truncated alignment as a StockholmMultipleAlignment object, or if outfile is given then NULL (invisibly).

Examples

aln <- system.file(file.path("extdata", "fungi_32S.stk"), package = "LSUx")
truncate_alignment(aln, tempfile("trunc", fileext = ".stk"), 1, 500)

brendanf/LSUx documentation built on Oct. 10, 2024, 1:31 p.m.