Load the example dataset (example2.tsv
) using read_tsv
.
library(tidyverse)
results <- read_tsv('example2.tsv',
col_types = cols(Chr = 'c', Strand = 'c'))
filter
to find out how many genes have an adjusted p-value less than 0.05.filter(results, adjp < 0.05) %>%
nrow()
arrange
.arrange(results, adjp) %>%
select(., GeneID, Name, adjp) %>%
head(1)
log10()
function to calculate this.results <- mutate(results,
log10p = -log10(adjp))
select(results, GeneID, Name, adjp, log10p) %>%
arrange(adjp) %>%
head(5)
normalised_counts <-
select(results, GeneID, Name, contains('normalised_count'))
pivot_longer
.normalised_counts_long <-
pivot_longer(normalised_counts, c(-GeneID, -Name),
names_to = 'sample', values_to = 'normalised count')
iris
dataset make a plot of Petal.Width (y) against Sepal.Width (x).ggplot(data = iris) +
geom_point(aes(x = Sepal.Width, y = Petal.Width))
scale_colour_viridis_c
.ggplot(data = iris, aes(x = Sepal.Width, y = Petal.Width)) +
geom_point(aes(colour = Petal.Length)) +
scale_colour_viridis_c()
scale_fill_manual
.ggplot(data = iris, aes(x = Sepal.Width, y = Petal.Width)) +
geom_point(aes(fill = Species), shape = 22, size = 3) +
scale_fill_manual(values = c('firebrick2', 'steelblue3', 'orange'))