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(ggplot2) | |
library(tidyverse) | |
library(readr) | |
sra_stat <- read_csv("https://www.ncbi.nlm.nih.gov/Traces/sra/sra_stat.cgi") | |
sra_stat$date <- as.Date(sra_stat$date, format = "%m/%d/%Y") | |
ggplot(sra_stat, aes(x = date, group = 1)) + | |
geom_area(aes(y = bases / 10^15), fill = "orange", alpha = 0.8) + | |
geom_area(aes(y = bytes / 10^15), fill = "blue", alpha = 0.8) + | |
labs(title = "Amount of Sequencing Data in SRA", |
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 | |
#convert all gddoc documents to pdf | |
#needs jq: https://stedolan.github.io/jq/download/ | |
shopt -s nullglob | |
for g in *.gddoc | |
do | |
url=$(jq -c '.url' $g) | |
url="${url%/edit?usp=drivesdk\"}" | |
url="${url#\"}" |
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(foreach) | |
library(stringr) | |
library(biomaRt) | |
read_gmt <- function(gmt_file){ | |
conn <- file(gmt_file,open="r") | |
all_lines <-readLines(conn) | |
result <- foreach(line = str_split(all_lines, "\t"), .combine = bind_rows) %do% { | |
data_frame(id = line[1], gene_id = line[-c(1,2)]) |
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
#obtained from ftp://ftp.ensembl.org/pub/grch37/release-87/regulation/homo_sapiens/homo_sapiens.GRCh37.Regulatory_Build.regulatory_features.20161117.gff.gz | |
#date: 12/01/2017 | |
library(stringr) | |
library(tidyr) | |
homo_sapiens.GRCh37.Regulatory_Build.regulatory_features.20161117 <- read.delim("/local/home/mlist/Projects/homo_sapiens.GRCh37.Regulatory_Build.regulatory_features.20161117.gff", header=FALSE) | |
ensembl_reg_hg19 <- tidyr::separate(homo_sapiens.GRCh37.Regulatory_Build.regulatory_features.20161117, col = V9, into = c("ID", "bound_end", "bound_start", "description", "feature_type"), sep = ";") | |
apply(ensembl_reg_hg19, 2, function(x) str_replace_all(x, pattern = ".*=", "")) | |
ensembl_reg_hg19_tidy <- apply(ensembl_reg_hg19, 2, function(x) str_replace_all(x, pattern = ".*=", "")) |
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 dependencies | |
# install DeepBlueR from bioconductor | |
# http://bioconductor.org/packages/release/bioc/html/DeepBlueR.html | |
library(DeepBlueR) | |
library(dplyr) | |
library(tidyr) | |
# List all BLUEPRINT samples | |
blueprint_samples <- deepblue_list_samples( | |
extra_metadata = list("source" = "BLUEPRINT Epigenome")) |
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
# authentication, register for DeepBlue, log in, open your account info, | |
# copy and paste user key here | |
auth_key <- "xxxxxxxxxx" | |
#dependencies | |
library(foreach) | |
library(matrixStats) | |
library(DeepBlueR) | |
library(stringr) | |
library(corrplot) |
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
### PLAIN INSTALLATION ### | |
#Download the installer for Microsoft R Open built for Ubuntu 15 | |
wget https://mran.revolutionanalytics.com/install/mro/3.2.3/MRO-3.2.3-Ubuntu-15.4.x86_64.deb | |
#Install package ignoring the missing libjpeg dependency | |
sudo dpkg -i --ignore-depends libjpeg8 MRO-3.2.3-Ubuntu-15.4.x86_64.deb | |
#At this point you can already use MRO but plotting won't work! |
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
setAs("RnBeadSet", "RnBeadRawSet", function(from){ | |
new(Class = RnBeadSet, | |
pval.sites = [email protected], | |
pval.regions = [email protected], | |
qc = from@qc, | |
pheno = from@pheno, | |
sites = from@sites, | |
meth.sites = [email protected], | |
covg.sites = [email protected], | |
regions = from@regions, |
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 docker images -a | awk 'NR >= 2 {printf "%s ",$3}' | xargs sudo docker rmi -f |
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
### R functions to consume the KeyPathwayMinerWeb RESTful API ### | |
### Authors: Markus List and Martin Dissing-Hansen ### | |
# Package dependencies. Make sure those are installed | |
library(RCurl) | |
library(rjson) | |
library(foreach) | |
# Helper method for base64 encoding. Needed to transfer network and dataset files # | |
base64EncFile <- function(fileName){ |
NewerOlder