Entering edit mode
3.9 years ago
Ankit
▴
500
Hi everyone,
I have a matrix of gene expression. I want to apply prop.test function in r for each row and obtain p.values only. How to to do that in R ?
My attempts are as follows:
1.
myout <- purrr::pmap(countmatrix,~{prop.test(x = countmatrix$x, n = countmatrix$n, correct = "FALSE")})
It gives estimates and the object is huge and difficult to find p.values.
2.
myout <-Map(prop.test,x =countmatrix$x, n= countmatrix$n)
It gives the summary report of prop.test, but how to get p.values directly as I dont see any myout$p.value
I would appreciate any help. And if somebody has better suggestions will be useful.
Thank you
for now I tried to use this, if it make sense
It will help if you show the structure of your input data (the gene expression matrix)
Here is the normalized count matrix:
Hmm...
prop.test
is a procedure to test for differences in proportions in categorical data (like a chi-squared test). You show a matrix with continuous gene expression data. Maybe I'm missing something here, but what is the hypothesis, comparison... that you want to test?Also, if the matrix you show is your
countmatrix
in the question, I don't see any$n
or$x
columns which you use in your script.The concept is to see allelic differences. Basically to get statistically significant genes expression between two alleles i.e allele1 and allele2.
For replicate 1,
$n = sample1.sum
$x = sample1.allele1
For replicate 2,
$n = sample2.sum
$x = sample2.allele1