Skip to content

Instantly share code, notes, and snippets.

View tiagochst's full-sized avatar

Tiago Chedraoui Silva tiagochst

  • Endpoint Health
  • Miami, Florida
View GitHub Profile
RUN apt-get update
RUN apt install -y tzdata font-manager
RUN apt-get install -y libz-dev
RUN conda config --add channels bioconda
RUN conda config --add channels conda-forge
RUN conda install --quiet --yes -c anaconda curl
RUN conda install --quiet --yes -c r r-irkernel
RUN conda install --quiet --yes -c r r-devtools
library(TCGAbiolinks)
library(SummarizedExperiment)
dir.create(gsub(" |,", "_",TCGAbiolinks:::getGDCInfo()$data_release))
setwd(gsub(" |,", "_",TCGAbiolinks:::getGDCInfo()$data_release))
projects <- TCGAbiolinks:::getGDCprojects()$project_id
projects <- projects[grepl('^TCGA',projects,perl=T)]
for(proj in projects){
dir.create(proj,showWarnings = FALSE)
query <- GDCquery(project = proj,
data.category = "Transcriptome Profiling",
@tiagochst
tiagochst / ELMERv1.R
Last active March 1, 2018 13:02
Running ELMER v1 on TCGA breast cancer - Major aim: Get execution times
# March 1 2018
# ooo Introduction ooo
# This code performs ELMERv1 analysis on TCGA breast cancer
# data set for time comparison purporses.
# ooo Author ooo
# Tiago Chedraoui Silva (tiagochst at gmail.com)
# To run ELMER version 1
# the we clone ELMER from https://github.com/lijingya/ELMER
# and installed its auxiliary data from https://github.com/lijingya/ELMER.data
@tiagochst
tiagochst / maftools.R
Last active November 22, 2017 18:39
Find most significant mutations for survival
require(maftools)
maf <- GDCquery_Maf("COAD",pipelines = "mutect2")
clinic <- GDCquery_clinic("TCGA-COAD")
colnames(clinic)[1] <- "Tumor_Sample_Barcode"
clinic$Overall_Survival_Status <- 1
clinic$Overall_Survival_Status[which(clinic$vital_status != "dead")] <- 0
clinic$time <- clinic$days_to_death
clinic$time[is.na(clinic$days_to_death)] <- clinic$days_to_last_follow_up[is.na(clinic$days_to_death)]
acc <- read.maf(maf = maf, clinicalData = clinic,isTCGA = T)
# ---------------------------
# Accessing the material
# https://tinyurl.com/bioc2017-ELMER
# ---------------------------
library("Bioc2017.TCGAbiolinks.ELMER")
Biobase::openVignette("Bioc2017.TCGAbiolinks.ELMER")
# ---------------------------
# Section 1:
# Aims:
# Section 1
library("Bioc2017.TCGAbiolinks.ELMER")
library(TCGAbiolinks)
library(SummarizedExperiment)
library(DT)
library(dplyr)
query.exp <- GDCquery(project = "TCGA-LUSC",
data.category = "Transcriptome Profiling",
data.type = "Gene Expression Quantification",
workflow.type = "HTSeq - FPKM-UQ",
@tiagochst
tiagochst / server.R
Created June 7, 2017 23:30
Error in safari
# Contributed by Joe Cheng, February 2013
# Requires googleVis version 0.4.0 and shiny 0.4.0 or higher
# server.R
library(googleVis)
library(shiny)
shinyServer(function(input, output) {
output$view <- renderGvis({
Pie1 <- gvisPieChart(CityPopularity)
deps <- c("shiny","shinyFiles","methylumi")
for(pkg in deps) if (!pkg %in% installed.packages()) biocLite(pkg, dependencies = TRUE)
library(shiny)
library(shinyFiles)
library(methylumi)
ui <- pageWithSidebar(
headerPanel(
'DNA methylation idat normalization with methylumi',
'methylumi normalization'
@tiagochst
tiagochst / maf_legacy.R
Created February 22, 2017 03:07
Get MAF files aligned against hg19
query.maf.hg19 <- GDCquery(project = "TCGA-COAD",
data.category = "Simple nucleotide variation",
data.type = "Simple somatic mutation",
access = "open",
legacy = TRUE)
# Check maf availables
knitr::kable(getResults(query.maf.hg19)[,c("created_datetime","file_name")])
query.maf.hg19 <- GDCquery(project = "TCGA-COAD",
data.category = "Simple nucleotide variation",
# This code will get all clinical indexed data from TCGA
library(TCGAbiolinks)
library(data.table)
clinical <- TCGAbiolinks:::getGDCprojects()$project_id %>%
regexPipes::grep("TCGA",value=T) %>%
sort %>%
plyr::alply(1,GDCquery_clinic, .progress = "text") %>%
rbindlist
readr::write_csv(clinical,path = paste0("all_clin_indexed.csv"))