Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 使用flowViz的flowSet的多个闸门_R_Bioinformatics_Bioconductor - Fatal编程技术网

R 使用flowViz的flowSet的多个闸门

R 使用flowViz的flowSet的多个闸门,r,bioinformatics,bioconductor,R,Bioinformatics,Bioconductor,我想在流程集上使用多个椭球门,并绘制结果 我设法用每帧一个门来绘制flowSet,但无法正确构造filtersList对象。我得到以下警告: 警告消息: 1:“筛选器”必须是筛选器列表、筛选器结果列表或单个 筛选对象或筛选对象的命名列表。 2:“筛选器”必须是筛选器列表、筛选器结果列表或单个 筛选对象或筛选对象的命名列表。 set.seed(1) library(flowViz) # Graphical parameters flowViz.par.set("gate", list(lwd =

我想在
流程集上使用多个椭球门
,并绘制结果

我设法用每帧一个门来绘制
flowSet
,但无法正确构造
filtersList
对象。我得到以下警告:

警告消息:
1:“筛选器”必须是筛选器列表、筛选器结果列表或单个
筛选对象或筛选对象的命名列表。
2:“筛选器”必须是筛选器列表、筛选器结果列表或单个
筛选对象或筛选对象的命名列表。

set.seed(1)
library(flowViz)
# Graphical parameters
flowViz.par.set("gate", list(lwd = 8))
gp <- flowViz.par.get()

# First set of data
data1 <- matrix(c(rnorm(10000), rlnorm(10000)), ncol = 2)
colnames(data1) <- c("M1", "M2")
rownames(data1) <- 1:10000

# Second set of data
data2 <- matrix(c(rnorm(10000), rlnorm(10000)), ncol = 2)
colnames(data2) <- c("M1", "M2")
rownames(data2) <- 1:10000

# Constructing the flowFrames
frame1 <- new("flowFrame", exprs = data1)
frame2 <- new("flowFrame", exprs = data2)

# Gating 
covar1 <- matrix(c(1,0.001,0.001,5), ncol = 2)
colnames(covar1) <- c("M1", "M2")
rownames(covar1) <- c("M1", "M2")
covar2 <- covar1 

means1 <- c(M1 = 0, M2 = 2.5)
means2 <- c(M1 = 0, M2 = 10)

eg1 <- ellipsoidGate(.gate = covar1, mean = means1)
eg2 <- ellipsoidGate(.gate = covar2, mean = means2)

egs <- filters(list(gate1 = eg1, gate2 = eg2))

# Plotting only one flowFrame
xyplot(`M2`~`M1`, frame1, xlab = "M2", ylab = "M1", xlim = c(-4,4), 
ylim = c(0,30), smooth = FALSE, filter = egs)

现在我想构造一个
过滤器列表
,为我的
流集
的每个
流框
使用多个门

# Constructing the filtersList
myFilters <- filtersList(list(plot1 = egs, plot2 = egs))

xyplot(`M2`~`M1`|name, fs, xlab = "M2", ylab = "M1", xlim = c(-4,4), 
ylim = c(0,30), 
       panel = function(x,y,...){
         panel.xyplot.flowset(x = x, frames = fs, channel.x.name = "M1",
 channel.y.name = "M2", gp = gp, smooth = FALSE,  filter = myFilters)
       })
#构建过滤器列表

我的过滤器我解决了这个问题。您只需从您的门列表中构造
过滤器
对象

然后重复该对象,以获得与
流集
长度相同的
过滤器列表,并将
列表
元素命名为与
流集
元素相同的名称

但是您只能使用相同类型的门,因此不能组合
矩形门
椭球门
对象

# Constructing the filtersList  
myFilters <- filters(list(eg1,eg2))  
myFilters <- rep(list(myFilters),2)  
names(myFilters) <- sampleNames(fs)  

xyplot(`M2`~`M1`|name, fs, xlab = "M2", ylab = "M1", xlim = c(-4,4),  
      ylim = c(0,30),  
      panel = function(x,y,...){  
        panel.xyplot.flowset(x = x, frames = fs, channel.x.name = "M1",  
                             channel.y.name = "M2", gp = gp, smooth = FALSE,  
                             filter = myFilters)  
      })
#构建过滤器列表
我的过滤器
# Constructing the filtersList  
myFilters <- filters(list(eg1,eg2))  
myFilters <- rep(list(myFilters),2)  
names(myFilters) <- sampleNames(fs)  

xyplot(`M2`~`M1`|name, fs, xlab = "M2", ylab = "M1", xlim = c(-4,4),  
      ylim = c(0,30),  
      panel = function(x,y,...){  
        panel.xyplot.flowset(x = x, frames = fs, channel.x.name = "M1",  
                             channel.y.name = "M2", gp = gp, smooth = FALSE,  
                             filter = myFilters)  
      })