Learn R Programming

rtfbs (version 0.3.15)

groupByGC.ms: Group sequences by GC

Description

Group sequences in an MS object by their GC content.

Usage

groupByGC.ms(ms, ngroups)

Arguments

ms

MS object, containing at least ngroups sequences.

ngroups

Number of quantiles to group sequences into.

Value

List of MS objects, where element i represents the i'th quantile according to GC content.

See Also

read.ms

Examples

Run this code
# NOT RUN {
require("rtfbs")
exampleArchive <- system.file("extdata", "NRSF.zip", package="rtfbs")
seqFile <- "input.fas"
unzip(exampleArchive, seqFile)
# Read in FASTA file "input.fas" from the examples into an 
#   MS (multiple sequences) object
seqs <- read.ms(seqFile)
# Group sequences from the "seqs" MS object based on each 
#   sequences's GC content into 4 new MS objects, one for
#   each GC content range
groups <- groupByGC.ms(seqs, 4)
sapply(groups, length)
sapply(groups, function(x) {range(gcContent.ms(x))})
unlink("input.fas")

# }

Run the code above in your browser using DataLab