corrOrthologTE: Estimate correlation comparing orthologs and TEs

View source: R/corrOrthologTE.R

corrOrthologTER Documentation

Estimate correlation comparing orthologs and TEs

Description

To estimate correlation comparing orthologs and TEs one-by-one from inputs. You can specify the correlation and adjusted p-value methods (see details in parameters). If you want to save your outputs instead of just returning them, please specify the fileDir and fileName with the extension .csv. The default fileName is TEKRABber_geneTECorrReusult.csv.

Usage

corrOrthologTE(geneInput, teInput, corrMethod = "pearson", 
padjMethod = "fdr", numCore=1, fileDir=NULL, 
fileName="TEKRABber_geneTECorrResult.csv")

Arguments

geneInput

gene count input for correlation from using DECorrInputs()

teInput

te count input for correlation from using DECorrInputs()

corrMethod

correlation method, including pearson, kendall, spearman. Default is pearson.

padjMethod

method to return adjusted p-value, and default is fdr. See ?p.adjust

numCore

number of cores to run parallel. Default is 1. You can use detectCores() to get how many cores you can use.

fileDir

the name of directory for saving output files. Default is NULL.

fileName

the name for saving output files. Default is "TEKRABber_geneTECorrResult.csv"

Value

a dataframe includes correlation coefficient, pvalue, padj

Examples

data(ctInputDE)
geneInputDE <- ctInputDE$gene
teInputDE <- ctInputDE$te

metaExp <- data.frame(experiment = c(rep("control", 5), rep("treatment", 5)))
rownames(metaExp) <- colnames(geneInputDE)
metaExp$experiment <- factor(
    metaExp$experiment, 
    levels = c("control", "treatment")
)

resultDE <- DEgeneTE(
    geneTable = geneInputDE,
    teTable = teInputDE,
    metadata = metaExp,
    expDesign = FALSE
)

controlCorr <- corrOrthologTE(
    geneInput = resultDE$geneCorrInputRef[c(1:10),],
    teInput = resultDE$teCorrInputRef[c(1:10),],
    numCore = 1,
    corrMethod = "pearson",
    padjMethod = "fdr"
)


ferygood/TEKRABber documentation built on July 31, 2024, 6:36 p.m.