Published August 4, 2021 | Version 0.1
Software Open

Pairwise Correlation Skew with NULL distribution R scripts

Authors/Creators

  • 1. Brigham and Women's Hospital

Description

From Lagomarsino, et al., 2021 (Neuron). This script was used for generation of Figure 3 and is part of an in-house R package hosted on github (https://github.com/genejockey33000/typGumbo). The primary script (pairwiseCorrSkew.R) takes two matrices as input. Each matrix has samples in columns and measurements (genes, transcripts, proteins, etc.) in rows. Samples and measurements must be strongly overlapping but need not be identical. For example, from the paper, RNAseq data from 49 postmortem brain samples is compared to RNAseq data from iPSC derived neurons (NGN2 induced "iNs"), generated from the same 49 human subjects. The script synchronizes rows and columns (sample names must agree between matrices). If an upper percentage variance restriction is specified, the script will isolate only measurements in that upper variance range (.5 for upper 50%itle, .25 for upper 25%ile, etc.). Note that because of this step, the best controlled matrix should be input as matrix x which is used for determining variant measurements. In the above example the induced neuron matrix, which was much more consistent than the brain data, was used as matrix x. The script then correlates remaining measurements from matrix x, to measurements in matrix y. Population level correlation skew is calculated. Finally, a NULL distribution is generated by permuting matrix y a specified number of times and calculating the skew for each permutation (a minimum of 1000 iterations is recommended). Script reports all sample correlations (with pval, FDR, and FWER corrections), measured skew, all NULL skews, NULL avg, NULL sd, Z score and pvalue, and a pdf with plot of observed skew relative to NULL distribution is generated.

Script is dependent on external R packages Hmisc, and dplyr and on internal script reportProgress.R which is included here.

Files

Files (7.8 kB)

Name Size Download all
md5:dabc1ad58c068c73e88862819e640434
6.3 kB Download
md5:caca2ef591e975e7a651d8d84eec8a8a
1.5 kB Download