Skip to content

Instantly share code, notes, and snippets.

View katwre's full-sized avatar

Katarzyna Wreczycka katwre

View GitHub Profile
@katwre
katwre / getData.R
Last active August 29, 2015 14:19
Using genomation to analyze methylation profiles from Roadmap epigenomics and ENCODE
# RRBS from ENCODE
rrbs.IMR90.path <- "http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeHaibMethylRrbs/wgEncodeHaibMethylRrbsImr90UwSitesRep1.bed.gz"
rrbs.H1.path <- "http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeHaibMethylRrbs/wgEncodeHaibMethylRrbsH1hescHaibSitesRep1.bed.gz"
# read the RRBS data to GRanges
library(genomation)
rrbs.IMR90<-readGeneric(rrbs.IMR90.path, chr = 1, start = 2, end = 3, strand = 6,
meta.cols = list(score=11), keep.all.metadata = FALSE, zero.based = T, skip = 1)
rrbs.H1<-readGeneric(rrbs.H1.path, chr = 1, start = 2, end = 3, strand = 6,
plot(t1, type="l", col="red",
xlab="", ylab="time [sec]",
xaxt = "n", ylim=c(0, max(t1, t2)))
lines(t2, type="l", col="blue")
title(xlab = "number of rows of bigger dataset", line = 5)
par(las=2)
options(scipen=999) #disable scientific notation
axis(1, at=seq(10,200, 10),
labels=nmb.rows[seq(10, length(nmb.rows), 10)])
legend("bottomright", c("findOverlaps","foverlaps"),
@katwre
katwre / comp_foverlaps_findoverlaps.R
Last active August 29, 2015 14:18
Comparison the execution time of foverlaps and findOverlaps functions
library(rbenchmark)
library(GenomicRanges)
library(data.table)
# create sample dataset
start <- seq(1L, 20e8L, 1000L)
end <- start + 3000L
chrom <- "chr1"
DT.big <- data.table(chrom, start, end)
@katwre
katwre / first_script.py
Last active August 29, 2015 14:18
First Gist
print "Hello world"