correlation kidney & brain
shared DEGs
# Shapiro-Wilk normality test
shapiro.test(shared$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: shared$logFC.x
## W = 0.9411, p-value = 1.315e-10
shapiro.test(shared$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: shared$logFC.y
## W = 0.94667, p-value = 5.848e-10
# correlation test
res <- cor.test(shared$logFC.x, shared$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = shared, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(shared$logFC.x),
ymin = max(shared$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(shared$logFC.x),
ymin = 0,
ymax = min(shared$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -2,
y = 5,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "Shared DEGs between brain and kidney",
x = "kidney",
y = "brain"
)
ggplotly(p)
## Warning: `gather_()` was deprecated in tidyr 1.2.0.
## Please use `gather()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
write table
# difference between fold change
shared$logFC_difference <- (shared$logFC.x - shared$logFC.y)
# add direction information.
# Is the gene down-regulated or up-regulated in both the mouse and pig data sets
shared$direction_value <- shared$logFC.x * shared$logFC.y
df_shared <- shared %>%
mutate(direction_status = if_else(shared$direction_value < 0, "opposite", "same"))
# now reformat the whole dataframe to be pretty and legible
df_shared <-
df_shared[, c(1, 14, 18, 32, 36, 38, 40)]
# rename columns
data.table::setnames(
df_shared,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'kidney_logFC',
'kidney_adj.P.Val',
'brain_logFC',
'brain_adj.P.Val'
)
)
write.table(
df_shared,
"../../results/star/comparion_correlation/df_shared_kidney_brain.txt",
sep = "\t",
quote = F,
row.names = F
)
unique to kidney DEGs
shapiro.test(uniqueToKidney$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: uniqueToKidney$logFC.x
## W = 0.95525, p-value < 2.2e-16
shapiro.test(uniqueToKidney$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: uniqueToKidney$logFC.y
## W = 0.94302, p-value < 2.2e-16
res <- cor.test(uniqueToKidney$logFC.x, uniqueToKidney$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = uniqueToKidney, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(uniqueToKidney$logFC.x),
ymin = max(uniqueToKidney$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(uniqueToKidney$logFC.x),
ymin = 0,
ymax = min(uniqueToKidney$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -2,
y = 1.5,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "DEGs unique to kidney",
x = "kidney",
y = "brain"
)
ggplotly(p)
uniqueToKidney$logFC_difference <- (uniqueToKidney$logFC.x - uniqueToKidney$logFC.y)
uniqueToKidney$direction_value <- uniqueToKidney$logFC.x * uniqueToKidney$logFC.y
df_uniqueToKidney <- uniqueToKidney %>%
mutate(direction_status = if_else(uniqueToKidney$direction_value < 0, "opposite", "same"))
df_uniqueToKidney <-
df_uniqueToKidney[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_uniqueToKidney,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'kidney_logFC',
'kidney_adj.P.Val',
'brain_logFC',
'brain_adj.P.Val'
)
)
write.table(
df_uniqueToKidney,
"../../results/star/comparion_correlation/df_uniqueToKidney_kidney_brain.txt",
sep = "\t",
quote = F,
row.names = F
)
unique to brain DEGs
shapiro.test(uniqueToBrain$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: uniqueToBrain$logFC.x
## W = 0.95056, p-value = 1.92e-06
shapiro.test(uniqueToBrain$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: uniqueToBrain$logFC.y
## W = 0.96226, p-value = 3.194e-05
res <- cor.test(uniqueToBrain$logFC.x, uniqueToBrain$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = uniqueToBrain, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(uniqueToBrain$logFC.x),
ymin = max(uniqueToBrain$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(uniqueToBrain$logFC.x),
ymin = 0,
ymax = min(uniqueToBrain$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -2,
y = 2,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "DEGs unique to brain",
x = "kidney",
y = "brain"
)
ggplotly(p)
uniqueToBrain$logFC_difference <- (uniqueToBrain$logFC.x - uniqueToBrain$logFC.y)
uniqueToBrain$direction_value <- uniqueToBrain$logFC.x * uniqueToBrain$logFC.y
df_uniqueToBrain <- uniqueToBrain %>%
mutate(direction_status = if_else(uniqueToBrain$direction_value < 0, "opposite", "same"))
df_uniqueToBrain <-
df_uniqueToBrain[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_uniqueToBrain,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'kidney_logFC',
'kidney_adj.P.Val',
'brain_logFC',
'brain_adj.P.Val'
)
)
write.table(
df_uniqueToBrain,
"../../results/star/comparion_correlation/df_uniqueToBrain_kidney_brain.txt",
sep = "\t",
quote = F,
row.names = F
)
correlation
shared DEGs
shared <- shared[!duplicated(shared[,c("gene_name")]),]
shapiro.test(shared$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: shared$logFC.x
## W = 0.95565, p-value = 3.59e-06
shapiro.test(shared$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: shared$logFC.y
## W = 0.96513, p-value = 4.194e-05
res <- cor.test(shared$logFC.x, shared$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = shared, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(shared$logFC.x),
ymin = max(shared$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(shared$logFC.x),
ymin = 0,
ymax = min(shared$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -2,
y = 5,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "Shared DEGs between brain and blood",
x = "blood",
y = "brain"
)
ggplotly(p)
shared$logFC_difference <- (shared$logFC.x - shared$logFC.y)
shared$direction_value <- shared$logFC.x * shared$logFC.y
df_shared <- shared %>%
mutate(direction_status = if_else(shared$direction_value < 0, "opposite", "same"))
df_shared <-
df_shared[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_shared,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'blood_logFC',
'blood_adj.P.Val',
'brain_logFC',
'brain_adj.P.Val'
)
)
write.table(
df_shared,
"../../results/star/comparion_correlation/df_shared_blood_brain.txt",
sep = "\t",
quote = F,
row.names = F
)
shared$logFC_difference <- (shared$logFC.x - shared$logFC.y)
shared$direction_value <- shared$logFC.x * shared$logFC.y
df_shared <- shared %>%
mutate(direction_status = if_else(shared$direction_value < 0, "opposite", "same"))
df_shared <-
df_shared[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_shared,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'blood_logFC',
'blood_adj.P.Val',
'kidney_logFC',
'kidney_adj.P.Val'
)
)
write.table(
df_shared,
"../../results/star/comparion_correlation/df_shared_blood_kidney.txt",
sep = "\t",
quote = F,
row.names = F
)
unique to blood DEGs
shapiro.test(uniqueToBlood$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: uniqueToBlood$logFC.x
## W = 0.95296, p-value < 2.2e-16
shapiro.test(uniqueToBlood$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: uniqueToBlood$logFC.y
## W = 0.96023, p-value < 2.2e-16
res <- cor.test(uniqueToBlood$logFC.x, uniqueToBlood$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = uniqueToBlood, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(uniqueToBlood$logFC.x),
ymin = max(uniqueToBlood$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(uniqueToBlood$logFC.x),
ymin = 0,
ymax = min(uniqueToBlood$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -5.2,
y = 1.5,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "DEGs unique to blood",
x = "blood",
y = "brain"
)
ggplotly(p)
uniqueToBlood$logFC_difference <- (uniqueToBlood$logFC.x - uniqueToBlood$logFC.y)
uniqueToBlood$direction_value <- uniqueToBlood$logFC.x * uniqueToBlood$logFC.y
df_uniqueToBlood <- uniqueToBlood %>%
mutate(direction_status = if_else(uniqueToBlood$direction_value < 0, "opposite", "same"))
df_uniqueToBlood <-
df_uniqueToBlood[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_uniqueToBlood,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'blood_logFC',
'blood_adj.P.Val',
'brain_logFC',
'brain_adj.P.Val'
)
)
write.table(
df_uniqueToBlood,
"../../results/star/comparion_correlation/df_uniqueToBlood_blood_brain.txt",
sep = "\t",
quote = F,
row.names = F
)
unique to brain DEGs
shapiro.test(uniqueToBrain$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: uniqueToBrain$logFC.x
## W = 0.83232, p-value = 2.745e-15
shapiro.test(uniqueToBrain$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: uniqueToBrain$logFC.y
## W = 0.9517, p-value = 4.174e-07
res <- cor.test(uniqueToBrain$logFC.x, uniqueToBrain$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = uniqueToBrain, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(uniqueToBrain$logFC.x),
ymin = max(uniqueToBrain$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(uniqueToBrain$logFC.x),
ymin = 0,
ymax = min(uniqueToBrain$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -6,
y = 2,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "DEGs unique to brain",
x = "blood",
y = "brain"
)
ggplotly(p)
uniqueToBrain$logFC_difference <- (uniqueToBrain$logFC.x - uniqueToBrain$logFC.y)
uniqueToBrain$direction_value <- uniqueToBrain$logFC.x * uniqueToBrain$logFC.y
df_uniqueToBrain <- uniqueToBrain %>%
mutate(direction_status = if_else(uniqueToBrain$direction_value < 0, "opposite", "same"))
df_uniqueToBrain <-
df_uniqueToBrain[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_uniqueToBrain,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'blood_logFC',
'blood_adj.P.Val',
'brain_logFC',
'brain_adj.P.Val'
)
)
write.table(
df_uniqueToBrain,
"../../results/star/comparion_correlation/df_uniqueToBrain_blood_brain.txt",
sep = "\t",
quote = F,
row.names = F
)
correlation
shared DEGs
shapiro.test(shared$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: shared$logFC.x
## W = 0.95589, p-value = 5.784e-16
shapiro.test(shared$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: shared$logFC.y
## W = 0.96131, p-value = 7.594e-15
res <- cor.test(shared$logFC.x, shared$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = shared, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(shared$logFC.x),
ymin = max(shared$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(shared$logFC.x),
ymin = 0,
ymax = min(shared$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -2,
y = 5,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "Shared DEGs between kidney and blood",
x = "blood",
y = "kidney"
)
ggplotly(p)
shared$logFC_difference <- (shared$logFC.x - shared$logFC.y)
shared$direction_value <- shared$logFC.x * shared$logFC.y
df_shared <- shared %>%
mutate(direction_status = if_else(shared$direction_value < 0, "opposite", "same"))
df_shared <-
df_shared[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_shared,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'blood_logFC',
'blood_adj.P.Val',
'kidney_logFC',
'kidney_adj.P.Val'
)
)
write.table(
df_shared,
"../../results/star/comparion_correlation/df_shared_blood_kidney.txt",
sep = "\t",
quote = F,
row.names = F
)
unique to blood DEGs
shapiro.test(uniqueToBlood$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: uniqueToBlood$logFC.x
## W = 0.95791, p-value < 2.2e-16
shapiro.test(uniqueToBlood$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: uniqueToBlood$logFC.y
## W = 0.95666, p-value < 2.2e-16
res <- cor.test(uniqueToBlood$logFC.x, uniqueToBlood$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = uniqueToBlood, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(uniqueToBlood$logFC.x),
ymin = max(uniqueToBlood$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(uniqueToBlood$logFC.x),
ymin = 0,
ymax = min(uniqueToBlood$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -2,
y = 1.5,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "DEGs unique to blood",
x = "blood",
y = "kidney"
)
ggplotly(p)
uniqueToBlood$logFC_difference <- (uniqueToBlood$logFC.x - uniqueToBlood$logFC.y)
uniqueToBlood$direction_value <- uniqueToBlood$logFC.x * uniqueToBlood$logFC.y
df_uniqueToBlood <- uniqueToBlood %>%
mutate(direction_status = if_else(uniqueToBlood$direction_value < 0, "opposite", "same"))
df_uniqueToBlood <-
df_uniqueToBlood[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_uniqueToBlood,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'blood_logFC',
'blood_adj.P.Val',
'kidney_logFC',
'kidney_adj.P.Val'
)
)
write.table(
df_uniqueToBlood,
"../../results/star/comparion_correlation/df_uniqueToBlood_blood_kidney.txt",
sep = "\t",
quote = F,
row.names = F
)
unique to kidney DEGs
shapiro.test(uniqueToKidney$logFC.x)
##
## Shapiro-Wilk normality test
##
## data: uniqueToKidney$logFC.x
## W = 0.83249, p-value < 2.2e-16
shapiro.test(uniqueToKidney$logFC.y)
##
## Shapiro-Wilk normality test
##
## data: uniqueToKidney$logFC.y
## W = 0.95856, p-value < 2.2e-16
res <- cor.test(uniqueToKidney$logFC.x, uniqueToKidney$logFC.y,
method = "spearman")
p_value <- round(res$p.value, 3)
rho_value <- round(res$estimate, 3)
p <- ggplot(data = uniqueToKidney, aes(x = logFC.x, y = logFC.y, text = paste(gene_name))) +
annotate(
"rect",
xmin = 0,
xmax = max(uniqueToKidney$logFC.x),
ymin = max(uniqueToKidney$logFC.y),
ymax = 0,
fill = "lightpink3",
alpha = .5
) + annotate(
"rect",
xmin = 0,
xmax = min(uniqueToKidney$logFC.x),
ymin = 0,
ymax = min(uniqueToKidney$logFC.y),
fill = "cadetblue3",
alpha = .5
) +
geom_abline(color = "gray40") +
geom_point(size = 2) +
theme_bw() +
theme(plot.title = element_text(size = 10)) +
theme(legend.position = "none") +
theme(axis.title.x = element_text(size = 10),
axis.text.x = element_text(size = 10)) +
theme(axis.title.y = element_text(size = 10),
axis.text.y = element_text(size = 10)) +
annotate(
"text",
x = -5,
y = 5,
label = paste0("rho = ", rho_value,"\n",
"p = ", p_value),
parse = TRUE,
color = "gray29",
size = 5
) + labs(
title = "DEGs unique to kidney",
x = "blood",
y = "kidney"
)
ggplotly(p)
uniqueToKidney$logFC_difference <- (uniqueToKidney$logFC.x - uniqueToKidney$logFC.y)
uniqueToKidney$direction_value <- uniqueToKidney$logFC.x * uniqueToKidney$logFC.y
df_uniqueToKidney <- uniqueToKidney %>%
mutate(direction_status = if_else(uniqueToKidney$direction_value < 0, "opposite", "same"))
df_uniqueToKidney <-
df_uniqueToKidney[, c(1, 14, 18, 32, 36, 38, 40)]
data.table::setnames(
df_uniqueToKidney,
old = c('logFC.x', 'adj.P.Val.x', 'logFC.y', 'adj.P.Val.y'),
new = c(
'blood_logFC',
'blood_adj.P.Val',
'kidney_logFC',
'kidney_adj.P.Val'
)
)
write.table(
df_uniqueToKidney,
"../../results/star/comparion_correlation/df_uniqueToKidney_blood_kidney.txt",
sep = "\t",
quote = F,
row.names = F
)
Uniquely expressed and DEGs within a tissue
sharedWithBrain <- c(kidneyBrain$gene_name, bloodBrain$gene_name)
UniqueToBrain_DE_exprssion <-
setdiff(pig_brain_FDRq0.05$gene_name, sharedWithBrain)
df_UniqueToBrain_DE_exprssion <- subset(pig_brain_FDRq0.05, gene_name %in% UniqueToBrain_DE_exprssion)
write.table(
df_UniqueToBrain_DE_exprssion,
"../../results/star/comparion_correlation/UniqueToBrain_DE_exprssion.txt",
sep = "\t",
quote = F,
row.names = F
)
sharedWithKidney <- c(kidneyBrain$gene_name, bloodKidney$gene_name)
UniqueToKidney_DE_exprssion <-
setdiff(pig_kidney_FDRq0.05$gene_name, sharedWithKidney)
df_UniqueToKidney_DE_exprssion <- subset(pig_kidney_FDRq0.05, gene_name %in% UniqueToKidney_DE_exprssion)
write.table(
df_UniqueToKidney_DE_exprssion,
"../../results/star/comparion_correlation/UniqueToKidney_DE_exprssion.txt",
sep = "\t",
quote = F,
row.names = F
)
sharedWithBlood <- c(bloodKidney$gene_name, bloodBrain$gene_name)
UniqueToBlood_DE_exprssion <-
setdiff(pig_blood_FDRq0.05$gene_name, sharedWithBlood)
df_UniqueToBlood_DE_exprssion <- subset(pig_blood_FDRq0.05, gene_name %in% UniqueToBlood_DE_exprssion)
write.table(
df_UniqueToBlood_DE_exprssion,
"../../results/star/comparion_correlation/UniqueToBlood_DE_exprssion.txt",
sep = "\t",
quote = F,
row.names = F
)