Error in formation of correlation matrix-(corrupt matrix -- dims not not match length)

I am working on a script to create a correlation matrix and mutual_rank matrix from RNAseq gene counts for 57992 genes in 7027 samples. I have already tested this script for a smaller file (for 10,000 genes) and it is working, however, when I am running this script on my final input file, it is giving the following error:

 corrupt matrix -- dims not not match length (this error comes after gene to
gene correlation step)


Script which i am running is:

E <- read.table("mdat_human_test.txt", header = TRUE, row.names=1)

# gene-to-gene correlation
C <- cor (t(E))
write.table(C, "human_correlation_genes_mdat.txt", quote=FALSE, sep="\t",
row.names=TRUE)

# correlation rank matrix
R <- t(apply(1-C, 1, rank))
write.table(R, "human_rank_genes_mdat.txt", quote=FALSE, sep="\t",
row.names=TRUE)

# mutual rank matrix
M <- sqrt(R * t(R))
write.table(M, "human_mutual_rank_genes_mdat.txt", quote=FALSE, sep="\t",
row.names=TRUE)

q()

• What is your biological question of interest ? Why are you doing this correlations? In addition to Devon's answer, I would like to point out that if you are using all the human annotated genes you might need to filter and normalize them. You'll presumably will have 25% of "genes" which are poorly described and/or with few counts are you really interested in keeping those ?
– llrs
Mar 6 '19 at 13:40