posSort: Numerical Sort of Alignment Positions that Contain Indels

View source: R/accessoryFunctions.R

posSortR Documentation

Numerical Sort of Alignment Positions that Contain Indels

Description

Sorts sequence alignment positions that contain indels in numerical order; e.g., three indels following position X are are identified as X.1, X.2 and X.3.

Positions are validated against a specified locus for a specified alignment type. Positions that do not exist for that locus-alignment combination are not returned.

Usage

posSort(posVec, alignType, locus)

Arguments

posVec

A character vector of variant positions.

alignType

A character string describing the type of alignment the positions are found in. The values 'prot', 'codon', 'nuc' and 'gen' are valid options. Only one 'alignType' value is allowed.

locus

A character string describing a locus in the HLAalignments object for the specified alignType.

Value

A character string of the correctly sorted sequence.

Note

Indel positions must be text-formatted (e.g. "607.12"). C.f., posSort(c(2,4,3,1,5), "nuc","DRB1") vs posSort(c("607.23","607.10","607.3","607.4"),"nuc","DRB1").


HLAtools documentation built on June 8, 2025, 12:24 p.m.