R fl<;-as.系数(sml)和;gset$说明代码配对不起作用-数据集的行太多

R fl<;-as.系数(sml)和;gset$说明代码配对不起作用-数据集的行太多,r,bioinformatics,bioconductor,R,Bioinformatics,Bioconductor,我在尝试修复错误时遇到了一个小问题。我的数据集有30个样本,具有38.830个特征。我复制并粘贴了产生以下错误的程序代码: > colnames(pData(pehnoData(gset)))[1:40] "At positions 39 & 40 the output results are both NA & NA" > pData(phenoData(gset))[ , c(11,12)] characteristics_ch1.1

我在尝试修复错误时遇到了一个小问题。我的数据集有30个样本,具有38.830个特征。我复制并粘贴了产生以下错误的程序代码:

> colnames(pData(pehnoData(gset)))[1:40]
"At positions 39 & 40 the output results are both NA & NA"

> pData(phenoData(gset))[ , c(11,12)]

           characteristics_ch1.1        characteristics_ch1.2
GSM1690577       tissue: Tonsils cell type: mononuclear cells
GSM1690578       tissue: Tonsils cell type: mononuclear cells
GSM1690579       tissue: Tonsils cell type: mononuclear cells
GSM1690580       tissue: Tonsils cell type: mononuclear cells
GSM1690581       tissue: Tonsils cell type: mononuclear cells
GSM1690582       tissue: Tonsils cell type: mononuclear cells
GSM1690583       tissue: Tonsils cell type: mononuclear cells
GSM1690584       tissue: Tonsils cell type: mononuclear cells
GSM1690585       tissue: Tonsils cell type: mononuclear cells
GSM1690586       tissue: Tonsils cell type: mononuclear cells
GSM1690587       tissue: Tonsils cell type: mononuclear cells
GSM1690588       tissue: Tonsils cell type: mononuclear cells
GSM1690589       tissue: Tonsils cell type: mononuclear cells
GSM1690590       tissue: Tonsils cell type: mononuclear cells
GSM1690591       tissue: Tonsils cell type: mononuclear cells
GSM1690592       tissue: Tonsils cell type: mononuclear cells
GSM1690593       tissue: Tonsils cell type: mononuclear cells
GSM1690594       tissue: Tonsils cell type: mononuclear cells
GSM1690595       tissue: Tonsils cell type: mononuclear cells
GSM1690596       tissue: Tonsils cell type: mononuclear cells
GSM1690597       tissue: Tonsils cell type: mononuclear cells
GSM1690598       tissue: Tonsils cell type: mononuclear cells
GSM1690599       tissue: Tonsils cell type: mononuclear cells
GSM1690600       tissue: Tonsils cell type: mononuclear cells
GSM1690601       tissue: Tonsils cell type: mononuclear cells
GSM1690602       tissue: Tonsils cell type: mononuclear cells
GSM1690603       tissue: Tonsils cell type: mononuclear cells
GSM1690604       tissue: Tonsils cell type: mononuclear cells
GSM1690605       tissue: Tonsils cell type: mononuclear cells
GSM1690606       tissue: Tonsils cell type: mononuclear cells

> tr <- levels(unique(pData(phenoData(gset))[12])[,1])

> tr1 <- gsub("b-cell subset: ","", tr[1])
> tr2 <- gsub("b-cell subset: ","", tr[2])
> tr3 <- gsub("b-cell subset: ","", tr[3])

> sml <- c("C0","C0","C0","C0","C1","C1","C1","C1","C2","C2","C2","C2");
> ex <- exprs(gset)
> qx <-as.numeric(quantile(ex, c(0., 0.25, 0.5, 0.75, 0.99, 1.0), na.rm=T))

> LogC <- (qx[5] > 100) || (qx[6] - qx[1] > 50 && qx[2] > 0) || (qx[2] > 0 && qx[2] < 1 && qx[4] > 1 && qx[4] < 2)
> if (LogC) {ex[which(ex <= 0)] <- NaNexprs(gset) <- log2(ex) }

> par(mfrow=c(1,2))
> hist(2^exprs(gset), breaks=25)
> hist(exprs(gset), breaks=25)

> fl <- as.factor(sml)
> gset$description <- fl

Error in `[[<-.data.frame`(`*tmp*`, i, value = c(1L, 1L, 1L, 1L, 2L, 2L,  : 
  replacement has 12 rows, data has 30
>colnames(pData(pehnoData(gset))[1:40]
“在位置39和40处,输出结果均为NA和NA”
>pData(phenoData(gset))[,c(11,12)]
特性\u ch1.1特性\u ch1.2
GSM1690577组织:扁桃体细胞类型:单核细胞
GSM1690578组织:扁桃体细胞类型:单核细胞
GSM1690579组织:扁桃体细胞类型:单核细胞
GSM1690580组织:扁桃体细胞类型:单核细胞
GSM1690581组织:扁桃体细胞类型:单核细胞
GSM1690582组织:扁桃体细胞类型:单核细胞
GSM1690583组织:扁桃体细胞类型:单核细胞
GSM1690584组织:扁桃体细胞类型:单核细胞
GSM1690585组织:扁桃体细胞类型:单核细胞
GSM1690586组织:扁桃体细胞类型:单核细胞
GSM1690587组织:扁桃体细胞类型:单核细胞
GSM1690588组织:扁桃体细胞类型:单核细胞
GSM1690589组织:扁桃体细胞类型:单核细胞
GSM1690590组织:扁桃体细胞类型:单核细胞
GSM1690591组织:扁桃体细胞类型:单核细胞
GSM1690592组织:扁桃体细胞类型:单核细胞
GSM1690593组织:扁桃体细胞类型:单核细胞
GSM1690594组织:扁桃体细胞类型:单核细胞
GSM1690595组织:扁桃体细胞类型:单核细胞
GSM1690596组织:扁桃体细胞类型:单核细胞
GSM1690597组织:扁桃体细胞类型:单核细胞
GSM1690598组织:扁桃体细胞类型:单核细胞
GSM1690599组织:扁桃体细胞类型:单核细胞
GSM1690600组织:扁桃体细胞类型:单核细胞
GSM1690601组织:扁桃体细胞类型:单核细胞
GSM1690602组织:扁桃体细胞类型:单核细胞
GSM1690603组织:扁桃体细胞类型:单核细胞
GSM1690604组织:扁桃体细胞类型:单核细胞
GSM1690605组织:扁桃体细胞类型:单核细胞
GSM1690606组织:扁桃体细胞类型:单核细胞
>tr tr1 tr2 tr3 sml ex qx LogC 100)| |(qx[6]-qx[1]>50&&qx[2]>0)| |(qx[2]>0&&qx[2]<1&&qx[4]>1&&qx[4]<2)
>if(LogC){ex[其中(exhist)(exprs(gset),breaks=25)

>fl gset$description我无法解决所有这些问题,因为我无法从代码中找出您试图执行的操作。当您定义
sml
时,它是一个长度为12的向量。我们可以用多种方式定义它,但它总是长度为12:

# equivalent definitions for `sml`, if you like them better:
sml <- rep(c("C0", "C1", "C2"), each = 4)
sml <- paste0("C", rep(0:2, each = 4)) 

其他一切对
sml
fl
gset
都没有影响。而
gset正是我试图做的。我在遵循一个R程序微阵列基因表达教程,代码处理与您提到的类似,但在教程中没有准确描述,为什么要使用它们。我将尝试这种方法o看看它是否有效(可能会),我会在为我正在分析的数据创建更准确的教程时提及你所说的话。再次感谢你,非常成功!
# equivalent definitions for `sml`, if you like them better:
sml <- rep(c("C0", "C1", "C2"), each = 4)
sml <- paste0("C", rep(0:2, each = 4)) 
sml <- c("C0","C0","C0","C0","C1","C1","C1","C1","C2","C2","C2","C2") # can be rewritten as above
fl <- as.factor(sml)
gset$description <- fl