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
#!/bin/bash | |
for p in DESeq2 apeglm tximport; do | |
echo "----- syncing $p -----"; | |
cd $p/github/$p | |
git pull | |
git fetch --all | |
git merge upstream/master | |
git push | |
cd ../../.. | |
done; |
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) | |
ui <- fluidPage(mainPanel( | |
plotOutput("plot1", click="plot_click"), | |
plotOutput("plot2") | |
)) | |
server <- function(input, output) { | |
output$plot1 <- renderPlot({ | |
plot(x,y) | |
}) | |
output$plot2 <- renderPlot({ |
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(ggplot2) | |
ui <- fluidPage(mainPanel( | |
plotOutput("plot1", click="plot_click") | |
)) | |
server <- function(input, output) { | |
selected <- reactive({ | |
near <- nearPoints(dat,input$plot_click,maxpoints=1,"x","y",threshold=20) | |
if (nrow(near) > 0) { | |
selected_points <<- near |
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
suppressPackageStartupMessages(library(plyranges)) | |
suppressPackageStartupMessages(library(AnnotationHub)) | |
suppressPackageStartupMessages(library(TxDb.Hsapiens.UCSC.hg19.knownGene)) | |
ah <- AnnotationHub() | |
query(ah, c("K562","CTCF","unipk")) | |
peaks <- ah[["AH22543"]] | |
peaks <- peaks %>% keepStandardChromosomes(pruning.mode="coarse") | |
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene |
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(hexSticker) | |
library(rafalib) | |
e <- expression({ | |
nullplot(bty="n",xaxt="n",yaxt="n") | |
text(.5,.5,"⇲",cex=15,col="white") | |
}) | |
set.seed(1) | |
sticker(e, p_size=24, | |
s_x=.8, s_y=.6, s_width=.2, s_height=.2, | |
url="www.bioconductor.org", u_color="white", u_size=4.5, |
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
sudo apt install sra-toolkit | |
fastq-dump -X 1000000 --split-files SRR1039508 |
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(DEXSeq) | |
alpha1 <- .1 | |
alpha2 <- .01 | |
ngene <- 5000 | |
sig.ratio <- .1 | |
niso <- 5 | |
set.seed(1) | |
fdr <- replicate(100, { | |
gene <- factor(rep(1:ngene,each=niso)) | |
pval <- runif(ngene*niso) |
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
dir <- system.file("extdata/salmon", package="tximportData") | |
ids <- list.files(dir) | |
# here gzipped, normally these are not | |
files <- file.path(dir, ids, "quant.sf.gz") | |
file.exists(files) | |
coldata <- data.frame(files, names=ids, population="TSI", stringsAsFactors=FALSE) | |
library(tximeta) |
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
# this is using SummarizedExperiment v1.11.5 | |
suppressPackageStartupMessages(library(SummarizedExperiment)) | |
m <- matrix(1:20, nrow=5, ncol=4, dimnames=list(letters[1:5], LETTERS[1:4])) | |
# this gives an error, good. | |
rowdata <- data.frame(x=1:5, row.names=letters[5:1]) | |
se <- SummarizedExperiment(m, rowData=rowdata) | |
# build the right way | |
rowdata <- data.frame(x=1:5, row.names=letters[1:5]) |
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
# load the SummarizedExperiment object but don't load SummarizedExperiment | |
rowdata <- attr(se,"rowData") | |
save(rowdata, file="rowdata.rda") | |
#coldata <- attr(se,"colData") | |
#save(coldata, file="coldata.rda") | |
counts <- get("data",attr(attr(se,"assays"),".xData"))$counts | |
save(counts, file="counts.rda") | |
# restart R | |
load("rowdata.rda") |