Skip to content

Commit ee83582

Browse files
committed
finish two way comparison
1 parent b0208fd commit ee83582

File tree

1 file changed

+23
-28
lines changed

1 file changed

+23
-28
lines changed

inst/templates/rnaseq/DE/Cross-comparison-analysis.Rmd

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,6 @@ params:
2020
project_file: ../information.R
2121
---
2222

23-
24-
25-
```{r load_params, cache = FALSE, message = FALSE, warning=FALSE}
26-
# 1. Set up input files in this R file (params_pairwisecomp.R)
27-
## Full results file (all genes) for contrastt 1
28-
comp1_fn <- 'https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/cross-comparison/all_results_DMSO_vs_Group1.csv.gz'
29-
## Name of contrast 1. This will be displayed on the figures
30-
comp1_name <- "DMSO vs. Group1"
31-
## Full results file (all genes) for contrast 2
32-
comp2_fn <- 'https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/cross-comparison/all_results_DMSO_vs_Group2.csv.gz'
33-
## Name of contrast 2. This will be displayed on the figures
34-
comp2_name <- "DMSO vs. Group2"
35-
## Adjusted P-value used for significance
36-
padj_co <- 0.05
37-
## Log2FC used for significance. If no cutoff used put 0
38-
LFC <- 0.5
39-
40-
comp1 <- read_csv(comp1_fn) %>%
41-
dplyr::filter(padj <= 1)
42-
comp2 <- read_csv(comp2_fn) %>%
43-
dplyr::filter(padj <= 1)
44-
```
45-
46-
47-
4823
```{r load_libraries, cache = FALSE, message = FALSE, warning=FALSE}
4924
library(rtracklayer)
5025
library(tidyverse)
@@ -78,8 +53,30 @@ opts_chunk[["set"]](
7853
set.seed(1234567890L)
7954
```
8055

56+
# Compare two differential expression analysis
57+
58+
```{r load_params, cache = FALSE, message = FALSE, warning=FALSE}
59+
# 1. Set up input files in this R file (params_pairwisecomp.R)
60+
## Full results file (all genes) for contrastt 1
61+
comp1_fn <- 'https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/cross-comparison/all_results_DMSO_vs_Group1.csv.gz'
62+
## Name of contrast 1. This will be displayed on the figures
63+
comp1_name <- "DMSO vs. Group1"
64+
## Full results file (all genes) for contrast 2
65+
comp2_fn <- 'https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/cross-comparison/all_results_DMSO_vs_Group2.csv.gz'
66+
## Name of contrast 2. This will be displayed on the figures
67+
comp2_name <- "DMSO vs. Group2"
68+
## Adjusted P-value used for significance
69+
padj_co <- 0.05
70+
## Log2FC used for significance. If no cutoff used put 0
71+
LFC <- 0.5
72+
73+
comp1 <- read_csv(comp1_fn) %>%
74+
dplyr::filter(padj <= 1)
75+
comp2 <- read_csv(comp2_fn) %>%
76+
dplyr::filter(padj <= 1)
77+
```
8178

82-
# Load Data
79+
## Load Data
8380

8481
We load our dataset
8582

@@ -95,7 +92,6 @@ comp2_sig <- comp2 %>%
9592
```
9693

9794

98-
9995
# Comparisons
10096

10197
We start with a venn diagram looking at the overlap between our two contrasts
@@ -169,7 +165,6 @@ ggplot(lfc, aes(x=comp1, y=comp2, color=col)) + geom_point() +
169165
```
170166

171167

172-
173168
## Compare ajusted P-values
174169

175170
We plot adjusted P-values for our contrasts and color points by whether or not they are significant in our contrasts. The black line is 1:1.

0 commit comments

Comments
 (0)