This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(UpSetR) | |
library(dplyr) | |
library(tidyr) | |
library(readr) | |
library(ggplot2) | |
dat <- read_delim("ancestry_dataframe.tsv") | |
ui <- fluidPage( | |
titlePanel("IGVF Ancestry Dashboard"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n <- 200 | |
m <- 40 | |
set.seed(1) | |
x <- runif(n, -1, 1) | |
library(rafalib) | |
bigpar(2,2,mar=c(3,3,3,1)) | |
library(RColorBrewer) | |
cols <- brewer.pal(11, "Spectral")[as.integer(cut(x, 11))] | |
plot(x, rep(0,n), ylim=c(-1,1), yaxt="n", xlab="", ylab="", | |
col=cols, pch=20, main="underlying data") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mat <- matrix(rnbinom(2e5, mu=100, size=1/.01), ncol=100) | |
library(DESeq2) | |
d <- DESeqDataSetFromMatrix(mat, DataFrame(x=rep(1,100)), ~1) | |
# library size correction, centered log ratio to reference sample | |
d <- estimateSizeFactors(d) | |
# variance | |
d <- estimateDispersionsGeneEst(d) | |
# trend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set.seed(5) | |
n <- 1000 | |
reps <- 10 | |
rna <- matrix( | |
rnbinom(n * reps, mu = 10, size = 100), | |
ncol=reps | |
) | |
dna <- matrix( | |
rnbinom(n * reps, mu = 10, size = 100), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUNS, = glob_wildcards("fastq/{run}_1.fastq.gz") | |
SALMON = "/proj/milovelab/bin/salmon-1.4.0_linux_x86_64/bin/salmon" | |
ANNO = "/proj/milovelab/anno" | |
rule all: | |
input: expand("quants/{run}/quant.sf", run=RUNS) | |
rule salmon_index: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(splines) | |
library(DESeq2) | |
# make some demo data | |
dds <- makeExampleDESeqDataSet(n=100, m=40) | |
dds$condition <- sort(runif(40)) | |
# make one gene where expression has a curve shape (just for demo) | |
s_shape <- round(500 * sin(dds$condition*2*pi) + 1000 + rnorm(40,0,50)) | |
mode(s_shape) <- "integer" | |
counts(dds)[1,] <- s_shape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dataframes vs lm S3 vs Bioc S4 | |
# Michael Love | |
# Nov 1 2023 | |
dat <- data.frame(genotype=c("wt","wt","mut","mut"), | |
count=c(10,20,30,40), | |
score=c(-1.2,0,3.4,-5), | |
gene=c("Abc","Abc","Xyz","Xyz")) | |
library(tibble) | |
dat |> as_tibble() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(palmerpenguins) # penguins! | |
library(ggplot2) # "grammar of graphics" plots | |
suppressPackageStartupMessages( | |
library(dplyr) # data pliers | |
) | |
penguins |> | |
slice(1:3) |> | |
select(species, island) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Toy tree example for collapsing" | |
author: "Michael Love" | |
--- | |
Example data with 20 inferential replicates, here we just have 1 | |
sample per condition and we calculate the LFC at each level of the | |
tree. | |
From the below simulation setup (see first chunk), the true DE signal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(plyranges) | |
library(readr) | |
bindata <- read_tsv("bindata.40000.hg19.tsv.gz") | |
fire <- read_bed("fire-adult-hg19.txt") | |
# not necessary, but nice to have | |
si <- Seqinfo(genome="hg19") | |
si <- keepStandardChromosomes(si) |
NewerOlder