toDNAcopyObj(fastseg)
toDNAcopyObj()所属R语言包:fastseg
Function to create a DNAcopy object for plot functions.
功能创建一个图职能DNAcopy对象。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Function to create a DNAcopy object for plot functions.
功能创建一个图职能DNAcopy对象。
用法----------Usage----------
toDNAcopyObj(segData, chrom, maploc, genomdat,
sampleNames)
参数----------Arguments----------
参数:segData
The results of the segmentation.
分割的结果。
参数:chrom
The vector of the chromosomes from the original data.
从原始数据向量的染色体。
参数:maploc
A vector with the physical positions of the original data.
一个向量与原始数据的物理位置。
参数:genomdat
A matrix with the original data.
与原始数据矩阵。
参数:sampleNames
The sample names of the original data.
原始数据样本名。
值----------Value----------
An DNAcopy equivalent object.
相当于一个DNAcopy对象。
作者(S)----------Author(s)----------
Andreas Mitterecker
举例----------Examples----------
library(fastseg)
#####################################################################[################################################## ##################]
### the data[#数据]
#####################################################################[################################################## ##################]
data(coriell)
head(coriell)
samplenames <- colnames(coriell)[4:5]
data <- as.matrix(coriell[4:5])
data[is.na(data)] <- median(data, na.rm=TRUE)
chrom <- coriell$Chromosome
maploc <- coriell$Position
###########################################################[################################################## ########]
## GRanges[#农庄]
###########################################################[################################################## ########]
library("GenomicRanges")
## with both individuals[不论是个人#]
gr <- GRanges(seqnames=chrom,
ranges=IRanges(maploc, end=maploc))
elementMetadata(gr) <- data
colnames(elementMetadata(gr)) <- samplenames
res <- fastseg(gr)
segres <- toDNAcopyObj(
segData = res,
chrom = as.character(seqnames(gr)),
maploc = as.numeric(start(gr)),
genomdat = data,
sampleNames = samplenames)
## with one individual[#一个人]
gr2 <- gr
data2 <- as.matrix(data[, 1])
colnames(data2) <- "sample1"
elementMetadata(gr2) <- data2
res <- fastseg(gr2)
segres <- toDNAcopyObj(
segData = res,
chrom = as.character(seqnames(gr)),
maploc = as.numeric(start(gr)),
genomdat = as.matrix(data2),
sampleNames = unique(elementMetadata(res)$ID))
###########################################################[################################################## ########]
## vector[#向量]
###########################################################[################################################## ########]
data2 <- data[, 1]
res <- fastseg(data2)
segres <- toDNAcopyObj(
segData = res,
chrom = rep(1, length(data2)),
maploc = 1:length(data2),
genomdat = as.matrix(data2),
sampleNames = "sample1")
###########################################################[################################################## ########]
## matrix[#矩阵]
###########################################################[################################################## ########]
data2 <- data[1:400, ]
res <- fastseg(data2)
segres <- toDNAcopyObj(
segData = res,
chrom = rep(1, nrow(data2)),
maploc = 1:nrow(data2),
genomdat = as.matrix(data2),
sampleNames = colnames(data2))
###########################################################[################################################## ########]
## Expression set object[#表达集对象]
###########################################################[################################################## ########]
library(oligo)
eSet <- new("ExpressionSet")
assayData(eSet) <- list(intensity=data)
featureData(eSet) <- new("AnnotatedDataFrame",
data=data.frame(
chrom = chrom,
start = maploc,
end = maploc))
phenoData(eSet) <- new("AnnotatedDataFrame",
data=data.frame(samples=samplenames))
sampleNames(eSet) <- samplenames
res <- fastseg(eSet)
segres <- toDNAcopyObj(
segData = res,
chrom = rep(1, nrow(data)),
maploc = maploc,
genomdat = as.matrix(data),
sampleNames = colnames(data))
#####################################################################[################################################## ##################]
### plot the segments[#绘制分部的]
#####################################################################[################################################## ##################]
library(DNAcopy)
plot(segres)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|