## Chunk 1
|
|||
mychar = c("as", "soon", "as possible")
|
|||
## Chunk 2
|
|||
x=character(0) #length 0 character vector
|
|||
## Chunk 3
|
|||
substr(x, 2, 4)
|
|||
## Chunk 4
|
|||
rD = randDNA(102)
|
|||
|
|||
## Chunk 6
|
|||
substring(x, 2, 4) = "abc"
|
|||
## Chunk 7
|
|||
paste(1:3, "+", 4:5)
|
|||
## Chunk 8
|
|||
paste(1:4, collapse="=")
|
|||
## Chunk 9
|
|||
strsplit(c("ab", "cde", "XYZ"), c("Y", ""))
|
|||
## Chunk 10
|
|||
x <- paste(readLines(file.path(R.home(), "COPYING")), collapse = "\n")
|
|||
## Chunk 11
|
|||
dna2rna = function(inputStr) {
|
|||
## Chunk 12
|
|||
compSeq = function(x)
|
|||
|
|||
|
|||
|
|||
## Chunk 16
|
|||
set.seed(123)
|
|||
## Chunk 17
|
|||
exT = c("Intron", "Exon", "Example", "Chromosome")
|
|||
## Chunk 18
|
|||
pmatch("E", exT)
|
|||
## Chunk 19
|
|||
pmatch(c("I", "Int"), exT)
|
|||
## Chunk 20
|
|||
pmatch(c("ab"), c("ab", "ab"))
|
|||
## Chunk 21
|
|||
'I\'m a string'
|
|||
## Chunk 22
|
|||
s = "I'm a backslash: \\"
|
|||
## Chunk 23
|
|||
cat(s)
|
|||
## Chunk 24
|
|||
noquote(s)
|
|||
## Chunk 25
|
|||
nchar(s)
|
|||
## Chunk 26
|
|||
fn = "c:\\My Documents\\foo.bar"
|
|||
## Chunk 27
|
|||
old = "\\"
|
|||
## Chunk 28
|
|||
gsub("\\\\", new, fn)
|
|||
## Chunk 29
|
|||
v1 = parse(text="mean(1:10)")
|
|||
## Chunk 30
|
|||
## Sys.getlocale()
|
|||
|
|||
## Chunk 32
|
|||
gregexpr("\\<", "my first anchor")
|
|||
## Chunk 33
|
|||
gregexpr("\\b", "once upon a time")
|
|||
## Chunk 34
|
|||
regexpr("r[^r]", "asffrb", perl=TRUE)
|
|||
## Chunk 35
|
|||
gregexpr("([A-Z])\\1", "ABBBZZ")
|
|||
## Chunk 36
|
|||
regexpr("AB{2,4}?", "ABBBBB")
|
|||
## Chunk 37
|
|||
regexpr("foo|foobar", "myfoobar")
|
|||
## Chunk 38
|
|||
testS = "ACTACCACTACCACT"
|
|||
## Chunk 39
|
|||
regexpr("\\d\\d\\/\\d\\d\\/\\d\\d\\d\\d",
|
|||
|
|||
## Chunk 41
|
|||
strwhite = function(x, lead=TRUE, trail=TRUE) {
|
|||
## Chunk 42
|
|||
prositeM = "[RK]-x(2,3)-[DE]-x(2,3)-Y."
|
|||
## Chunk 43
|
|||
testP = "ACRDRACDTUYACRD"
|
|||
## Chunk 44
|
|||
library("Biobase")
|
|||
## Chunk 45
|
|||
library("Rlibstree")
|
|||
## Chunk 46
|
|||
st1 = RNAString("UCUCCCAACCCUUGUACCAGUG")
|
|||
## Chunk 47
|
|||
library("matchprobes")
|
|||
|
|||
## Chunk 49
|
|||
## library("BSgenome.Hsapiens.UCSC.hg18")
|
|||
## Chunk 50
|
|||
chr22NoN <- mask(Hsapiens$chr22, "N")
|
|||
## Chunk 51
|
|||
TATA="TATAAAA"
|
|||
## Chunk 52
|
|||
mmT = matchPattern(TATA, chr22NoN, max.mismatch=1)
|
|||
## Chunk 53
|
|||
library(hgu95av2probe)
|
|||
## Chunk 54
|
|||
dict[count_index == max(count_index)]
|
|||
## Chunk 55
|
|||
chr22_pals = findPalindromes(chr22NoN, min.armlength = 40,
|
|||
|
|||
|
|||
## Chunk 58
|
|||
Lpattern <- "CTCCGAG"
|
|||
## Chunk 59
|
|||
|
|||
## Chunk 60
|
|||
oldD = setwd(system.file("extdata", package="Biostrings"))
|
|||
## Chunk 61
|
|||
dnaAlign2 = needwunsQS(Sc, Sp, mat, gappen=6)
|
|||
|
|||
## Chunk 63
|
|||
library("Rlibstree")
|
|||
## Chunk 64
|
|||
consmat(dnaAlign1)[, 1:20]
|
|||