Skip to content

Instantly share code, notes, and snippets.

@tbrittoborges
Created November 4, 2021 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbrittoborges/4f925e1a43fccf446857cd4a0f869e2c to your computer and use it in GitHub Desktop.
Save tbrittoborges/4f925e1a43fccf446857cd4a0f869e2c to your computer and use it in GitHub Desktop.
leafcutter result exploratory analysis
library(tidyverse)
library(ggrepel)
# load the data to variable x
x <- read_csv('leafcutter_junctions.csv')
x %>%
# filters the dataframe to keep only significant called junctions
filter(abs(deltapsi) > 0.1 & p.adjust < 0.05) %>%
# groups junctions by comparison
group_by(comparison) %>%
# show the counts of genes or introns per group
summarise(
genes = n_distinct(genes),
events = n_distinct(intron))
# this plots a generic/bad volcano plot
p <- x %>%
ggplot(aes(deltapsi, -log10(p.adjust))) +
geom_point()
# show the plot
p
# break it down by comparison
p + facet_wrap(vars(comparison))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment