# NOT RUN {
# Example data
data(tb.flow)
# Format expression data to align with flow data
gene.data <- data.frame(t(tb.expr[1:100, ]))
rownames(gene.data) <- paste0(tb.design$monkey_id, "_", tb.design$timepoint)
flow.data <- data.frame(t(tb.flow))
flow.data <- flow.data[match(rownames(gene.data), rownames(flow.data), nomatch = 0), ]
gene.data <- gene.data[match(rownames(flow.data), rownames(gene.data), nomatch = 0), ]
# Create time variable
time <- tb.flow.des$timepoint[match(rownames(flow.data),tb.flow.des$columnname,nomatch = 0)]
# Run correlations and format for BART
corrs <- crossCorr(x = gene.data, y = flow.data, by = time, by.name = "days",
description = "Genes vs Flow", x.var = "Genes",
y.var = "Flow", method = "spearman")
# }
Run the code above in your browser using DataLab