tolower-methods, toupper-methods {haplotypes} | R Documentation |
Convert sequence characters from upper to lower case or vice versa
Description
Convert sequence characters in a Dna
object from upper to lower case or vice versa.
Usage
## S4 method for signature 'Dna'
tolower(x)
## S4 method for signature 'Dna'
toupper(x)
Arguments
x |
an object of class |
Value
an object of class Dna
.
Methods
signature(x = "Dna")
Examples
## Coercing a list to a 'Dna' object.
seq1<-c("?","A","C","g","t","-","0","1")
seq2<-c("?","A","C","g","t","-","0","1","2")
seq3<-c("?","A","C","g","t","-","0","1","2","3")
x<-list(seq1=seq1,seq2=seq2,seq3=seq3)
dna.obj<-as.dna(x)
#characters in Dna object
table(as.matrix(dna.obj))
##all lower case
lowc<-tolower(dna.obj)
#characters
table(as.matrix(lowc))
##all upper case
upc<-toupper(dna.obj)
#characters
table(as.matrix(upc))
[Package haplotypes version 1.1.3.1 Index]