rpolicastro / tsrexplorer_old

1 stars 1 forks source link

Detected feature jitter plots #47

Open zentnerlab opened 4 years ago

zentnerlab commented 4 years ago

It would be good to have the option to generate jitter plots of numbers of detected features. This would save space when many samples and replicates are being considered. Code I used in the paper:

features <- detect_features(exp, data_type = "tsr", feature_type = "transcript", samples = all)

p <- features %>% 
    add_column(technology = c(rep("nanoCAGE25", 2), rep("nanoCAGE500", 2), 
                              rep("STRIPE100", 3), rep("STRIPE250", 3), rep("STRIPE50", 3), 
                              rep("SLIC100", 2))) %>%
    mutate(technology = factor(technology, levels=c("STRIPE50", "STRIPE100", "STRIPE250",
                                                    "SLIC100", "nanoCAGE500", "nanoCAGE25"))) %>%
    ggplot(aes(x = technology, y = promoter_proximal_features)) +
    theme_bw() +
    stat_summary(fun.data = "mean_sdl", fun.args = list(mult = 1), size = 0.4, geom = "errorbar", width = 0.25,
                 alpha = 0.5) +
    geom_jitter(aes(color = technology), position = position_jitter(height = 0, width = 0.2), size = 2) +
    scale_color_viridis_d(begin = 0, end = 0.7) +
    ylim(2000, 6000)