File: splitseq.Rd

package info (click to toggle)
r-cran-seqinr 3.4-5-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,876 kB
  • sloc: ansic: 1,987; makefile: 14
file content (41 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
\name{splitseq}
\alias{splitseq}
\title{ split a sequence into sub-sequences }
\description{
 Split a sequence into sub-sequences of 3 (the default size) with no overlap between the sub-sequences. 
}
\usage{
splitseq(seq, frame = 0, word = 3)
}
\arguments{
  \item{seq}{ a vector of chars }
  \item{frame}{ an integer (0, 1, 2) giving the starting position to split the sequence }
  \item{word}{ an integer giving the size of the sub-sequences }
}
\value{
  This function returns a vector which contains the sub-sequences.
}
\references{
\code{citation("seqinr")}
\cr
}
\author{J.R. Lobry}
\seealso{ \code{\link{split}} }
\examples{
cds <- s2c("aacgttgcaggtcgctcgctacgtagctactgttt")
#
# To obtain the codon sequence in frame 0:
#
stopifnot(identical(splitseq(cds), 
  c("aac", "gtt", "gca", "ggt", "cgc", "tcg", "cta", "cgt", "agc", "tac", "tgt")))
#
# Show the effect of frame and word with a ten char sequence:
#
(tenchar <- s2c("1234567890"))
splitseq(tenchar, frame = 0)
splitseq(tenchar, frame = 1)
splitseq(tenchar, frame = 2)
splitseq(tenchar, frame = 0, word = 2)
splitseq(tenchar, frame = 0, word = 1)
}
\keyword{ manip }