sortDNAString {Biostrings}R Documentation

function to sort DNA strings

Description

This function sorts a given object of class "BioString" representing a vector of DNA strings in increasing order. The sorting can be done based only on a given number of letters at the begining of each string.

Usage

sortDNAString(x, prefixLength = max(nchar(x)))

Arguments

x an object of class "BioString" representing one or more DNA strings.
prefixLength the number of letters at the begining of each string that are used in the sorting.

Value

An object of class "BioString", with the strings from the argument sorted in increasing order. For the purpose of sorting, each string is assumed to be padded at the end with a letter lower in order than any letter in the alphabet of the string.

Author(s)

Saikat DebRoy

See Also

DNASuffixArray

Examples

data('yeastSEQCHR1')
yeast1 <- DNAString(yeastSEQCHR1)
x <- substring(yeast1, seq(1, by=10, length=30),
                    seq(10, by=10, length=30))
x
sortDNAString(x)
x <- substr(yeast1, 1, 30)
x
sortDNAString(substring(x, 1:30, 30)) # suffix array for x

[Package Biostrings version 1.4.0 Index]