Disambiguate: Expand Ambiguities into All Permutations of a DNAStringSet

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Disambiguate.R

Description

Performs the inverse function of ConsensusSequence by expanding any ambiguities present in sequences.

Usage

1
Disambiguate(myXStringSet)

Arguments

myXStringSet

A DNAStringSet or RNAStringSet object of sequences.

Details

Ambiguity codes in the IUPAC_CODE_MAP can be used to represent multiple nucleotides at a single position. Using these letters, multiple oligonucleotide permutations can be represented with a single ambiguous sequence. This function expands each sequence in the DNAStringSet input into all of its permutations. Note that sequences with many ambiguities can result in a very large number of potential permutations.

Value

A DNAStringSetList or RNAStringSetList with one element for each sequence in myXStringSet.

Author(s)

Erik Wright eswright@pitt.edu

See Also

ConsensusSequence

Examples

1
2
3
4
5
6
7
8
9
dna <- DNAStringSet(c("ACST", "NNN"))
dna_list <- Disambiguate(dna)
dna_list[[1]]
dna_list[[2]]
unlist(dna_list)

rna <- RNAStringSet(c("ACGU", "AGAU")) # 2 permutations
rna <- ConsensusSequence(rna) # "ASRU"
Disambiguate(rna) # 4 permutations

Example output

Loading required package: Biostrings
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: IRanges
Loading required package: XVector

Attaching package: 'Biostrings'

The following object is masked from 'package:base':

    strsplit

Loading required package: RSQLite
  A DNAStringSet instance of length 2
    width seq
[1]     4 ACCT
[2]     4 ACGT
  A DNAStringSet instance of length 64
     width seq
 [1]     3 AAA
 [2]     3 CCC
 [3]     3 GGG
 [4]     3 TTT
 [5]     3 ACA
 ...   ... ...
[60]     3 TCG
[61]     3 ATT
[62]     3 CAA
[63]     3 GCC
[64]     3 TGG
  A DNAStringSet instance of length 66
     width seq
 [1]     4 ACCT
 [2]     4 ACGT
 [3]     3 AAA
 [4]     3 CCC
 [5]     3 GGG
 ...   ... ...
[62]     3 TCG
[63]     3 ATT
[64]     3 CAA
[65]     3 GCC
[66]     3 TGG
RNAStringSetList of length 1
[[1]] ACAU AGGU ACGU AGAU

DECIPHER documentation built on Nov. 8, 2020, 8:30 p.m.