Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/75.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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 微生物群标准化,TMM_R - Fatal编程技术网

R 微生物群标准化,TMM

R 微生物群标准化,TMM,r,R,关于微生物群数据的标准化(TMM方法)。我真的不知道该怎么做。下面是一个例子。因此,每个组都会正常化。但如果我有一个“数据集”(见下文),我希望每个值都正常化。如何获得该数据的输出?但我可能误解了如何使用它。感谢你的帮助 #prepare example control_1 <- rep(10, 50) control_2 <- rep(10, 50) patient_1 <- c(rep(20, 25),rep(0,25)) patient_

关于微生物群数据的标准化(TMM方法)。我真的不知道该怎么做。下面是一个例子。因此,每个组都会正常化。但如果我有一个“数据集”(见下文),我希望每个值都正常化。如何获得该数据的输出?但我可能误解了如何使用它。感谢你的帮助

 #prepare example
    control_1 <- rep(10, 50)
    control_2 <- rep(10, 50)
    patient_1 <- c(rep(20, 25),rep(0,25))
    patient_2 <- c(rep(20, 25),rep(0,25))

df <- data.frame(c1=control_1,
                 c2=control_2,
                 p1=patient_1,
                 p2=patient_2)

#create group vector
group <- c('control','control','patient','patient')

#create DGEList object
library(edgeR)
d <- DGEList(counts=df, group=group)
d <- calcNormFactors(d)

#"Dataset", want to normalize this dataset with TMM
  a <- sample(100,10)
b <- sample(100,10)
c <- sample(100,10)
d <- sample(100,10)
trt <-rep(1:2,5)
id <- rep(1:5, each=2)
df <- data.frame(id,trt,a,b,c,d)
df
#准备示例
控制单元1