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
# I create and discuss this code at https://youtu.be/nU_GEPKVXU8 | |
library(dplyr) | |
#> | |
#> Attaching package: 'dplyr' | |
#> The following objects are masked from 'package:stats': | |
#> | |
#> filter, lag | |
#> The following objects are masked from 'package:base': | |
#> |
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
system("gsutil cp gs://biocbbs_2020a/cmd3out/uploads/GuptaA_2019.metaphlan_bugs_list.stool.rda .") | |
load("GuptaA_2019.metaphlan_bugs_list.stool.rda") | |
head(rownames(GuptaA_2019.metaphlan_bugs_list.stool)) #first 3 look wrong | |
grep("CIBIO", rownames(GuptaA_2019.metaphlan_bugs_list.stool)) #there are 60 with CIBIO in the rowname |
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
# to run this using Docker from the command line on the stock Bioconductor image: | |
# docker run -it bioconductor/bioconductor_docker:latest R | |
BiocManager::install("cBioPortalData") | |
library(cBioPortalData) | |
#acc_tcga full data pack | |
system.time(accpack <- cBioDataPack("acc_tcga")) #~10 seconds | |
accpack |
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
# docker run -it bioconductor/bioconductor_docker:latest R | |
BiocManager::install("cBioPortalData") | |
library(cBioPortalData) | |
cBio <- cBioPortal() | |
system.time(acc <- cBioPortalData(cBio, studyId = "acc_tcga", genePanelId = "IMPACT341")) | |
acc |
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
# docker run -it bioconductor/bioconductor_docker:latest R | |
BiocManager::install("cBioPortalData") | |
library(cBioPortalData) | |
cBio <- cBioPortal() | |
system.time(gbm <- cBioPortalData(cBio, studyId = "gbm_tcga", genePanelId = "IMPACT341")) | |
gbm | |
# again | |
system.time(gbm <- cBioPortalData(cBio, studyId = "gbm_tcga", genePanelId = "IMPACT341")) |
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
source("https://raw.githubusercontent.com/waldronlab/bugSigSimple/master/R/simple.R") | |
x=readCurationSheet("https://github.com/waldronlab/bugSigSimple/blob/master/inst/extdata/Microbial%20signatures%20curation%20-%20signatures.tsv?raw=true") | |
length(unique(x$PMID)) | |
writeLines(unique(x$PMID), file("signaturesPMID.txt")) |
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(BiocManager) | |
dir.create("~/packagefiles") | |
unlink("installationresults.txt") | |
pkgs <- available.packages(contrib.url(BiocManager::repositories()["BioCsoft"])) | |
pkgs <- rownames(pkgs) | |
set.seed(1) | |
pkgs <- sample(pkgs) | |
## pkgs <- pkgs[!pkgs %in% installed.packages()] |
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
if( Biobase::package.version("curatedTCGAData") < "1.5.6" ){ | |
BiocManager::install("waldronlab/curatedTCGAData") | |
} | |
stopifnot(BiocManager::version() >= "3.9") | |
library(curatedTCGAData) #requires >=1.5.6 and bioc-devel | |
mae <- curatedTCGAData("UCEC", "Methylation_methyl27", dry.run = FALSE) #~2 seconds from cache | |
dm <- assay(mae, 1) | |
# benchmarking showing cubic increase with # rows |
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
# Masseroli et al 2018, https://doi.org/10.1093/bioinformatics/bty688 | |
# "In TCGA data of BRCA patients, find the DNA somatic mutations | |
# within the first 2000 bp outside of the genes that are both | |
# expressed with FPKM > 3 and have at least a methylation in the same patient | |
# biospecimen, and extract these mutations of the top 5% patients | |
# with the highest number of such mutations." | |
library(curatedTCGAData) | |
system.time(mae <- curatedTCGAData("ACC", c("Mutation", "RNASeq2GeneNorm", "Methylation"), dry.run = FALSE)) |
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(GenomicRanges) | |
library(RaggedExperiment) | |
sample1 <- GRanges( | |
c(A = "chr1:1-10:-", B = "chr1:8-14:+", C = "chr2:15-18:+"), | |
score = 3:5) | |
sample2 <- GRanges( | |
c(D = "chr1:1-10:-", E = "chr2:11-18:+"), | |
score = 1:2) | |
colDat <- DataFrame(id = 1:2) |