Entering edit mode
8.7 years ago
kandoigaurav
▴
150
I've two large matrices with p-values and correlation coefficients for lncRNA vs mRNA genes (both matrix have same structure, one has p-values while the other has corresponding correlation coefficients). I would like to extract all lncRNA-mRNA gene pairs for which the p-value is less than 0.05 and their corresponding correlation coefficients as well.
I'm using the following R script which gives me the row and column number, but I also want the names, i.e lncRNA and mRNA gene names:
Pmatrix = read.csv ("pmatrix.csv", header = FALSE) ##read the matrix with pvalues
sig_values <- which(Pmatrix<0.05, arr.in=TRUE) ##extract values less than 0.05
sig_values #list all (row,col) pairs with pvalues less than 0.05
Corr_Matrix = read.csv("corr_matrix.csv", header = FALSE) ##read the matrix with correlation values
Corr_Matrix[sig_values] ##list correlation values corresponding to pvalues less than 0.05.
This gives me a list of row and column numbers, but how can I get the names?