Skip to content

Instantly share code, notes, and snippets.

@mikelove
Created June 5, 2023 17:55
Show Gist options
  • Save mikelove/141d25e64163121bb70a2823dc2ed89e to your computer and use it in GitHub Desktop.
Save mikelove/141d25e64163121bb70a2823dc2ed89e to your computer and use it in GitHub Desktop.
Code for performing ASE analysis with DESeq2
design <- ~0 + donor + allele
dds <- DESeqDataSetFromMatrix(counts, coldata, design) # counts has the two alleles per donor
assays(dds)[["weights"]] <- weights # 1 for hets, 1e-6 for homs
sizeFactors(dds) <- rep(1, ncol(dds))
dds <- DESeq(dds, test="LRT", reduced=~0 + donor)
res <- results(dds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment