Hi. I am doing exercises of Bioconductor to get started with it. I am looking forward to finding the proportion of genes, whose pvalue from biological replicates are above 0.05. I have tried to use the following code:
BiocManager::install("genomicsclass/maPooling")
##Here, I just obtain the data
library(Biobase)
library(maPooling)
data(maPooling)
pd=pData(maPooling)
##now, I will create the base to create pool and indiv in the following lines. Pool will contain pooled samples(technical replicates) and indiv the individual samples (biological replicates)
pooled=which(rowSums(pd)==12)
individuals=which(rowSums(pd)==1)
##I am removing replicates
individuals=individuals[-grep("tr",names(individuals))]
pool = exprs(maPooling)[,pooled]
indiv = exprs(maPooling)[,individuals]
strain = ifelse(grepl("a",rownames(pData(maPooling))),0,1)
g_pool = strain[pooled]
g_indiv = strain[individuals]
After that, I computed ttests for the pool variable and then I obtained qvalues, with the code
library(genefilter)
library(qvalue)
pvals = rowttests(pool,factor(g_pool))$p.value
qvals = qvalue(pvals)$qvalue
sum(qvals < 0.05)
2169
So far, all of this is good. No errors. Now, I just need pvalues for indiv, but for the genes that I found out to be <0.05(only the 2169 genes that match the condition). I don't know how to filter these genes whose qvalues were in the desired condition, and then obtain pvalues via rowttests only for those genes. I hope I made myself clear. If not, let me know, but some advice would be welcome.