correlateGenesWithin | R Documentation |
Provides a quick way to check for the range of correlations in a given data matrix. If no limits are supplied, will return a histogram of all correlations present. When limits are supplied, a data frame is returned detailing all gene pair correlations that are more negatively correlated than the lower limit and more positively correlated than the upper limit.
correlateGenesWithin(data, limits = NULL, nbreaks = 20, method = "pearson",
NA.handling = "pairwise.complete.obs")
data |
numeric data matrix with samples/observations in the columns and genes/variables in the rows |
limits |
vector of two numbers, giving the lower and upper bounds of the returned correlations. If NULL (the default) will return a histogram of all correlations in the data. When limits are provided, correlations below the lower limit and above the upper limit will be returned. |
nbreaks |
number of breaks for the histogram if limits is set to NULL |
method |
method to be used to calculate the correlation. Accepts values to be passed to cor() such as "pearson" (default), "spearman", and "kendall". |
NA.handling |
how missing values should be handled in the case of correlations, passed to the "use" argument of cor() |
If limits are not provided, returns a plot histogram. If limits are provided, returns a data frame with three columns where the first two columns indicate the gene pair and the third column gives the correlation between them.
~~Alison Moss~~
See Also as corrs2Gene for comparisons against a single gene of interest. Similar to correlateGenesAcross which allows for correlations across two supplied data sets as opposed to searching for correlations within a single dataset.
##initiate parameters
initiate_params()
##histogram showing range of gene correlations
correlateGenesWithin(RAGP_norm)
##return correlation pairs above lower limit and above upper limit
cors <- correlateGenesWithin(RAGP_norm, limits=c(-0.5, 0.85))
head(cors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.