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
--- | |
title: "Anscombe residuals plots" | |
author: "Levi Waldron" | |
date: "`r Sys.Date()`" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` |
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
# installed curatedMetagenomicData from github | |
suppressPackageStartupMessages({ | |
library(curatedMetagenomicData) | |
library(dplyr) | |
}) | |
#I download the data in two ways, one select a few CRC studies and the other will multiple studies available. | |
# specific only crc studies downloaded | |
suppressMessages({ |
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
# See https://diabimmune.broadinstitute.org/diabimmune/antibiotics-cohort/resources/16s-sequence-data | |
# The provided command `wget -r -np -nd https://pubs.broadinstitute.org/diabimmune/data/15` does not work because files are listed in an html page | |
library(dplyr) | |
library(rvest) | |
url <- "https://diabimmune.broadinstitute.org/diabimmune/data/15/" | |
url %>% | |
read_html() %>% | |
html_elements("a") %>% | |
html_attr("href") %>% | |
download.file(., destfile = basename(.)) |
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
##### Importing COVID-19 data from the NYC DOHMH github (https://github.com/nychealth/coronavirus-data) and merge with ACS data of interest | |
# In order to get the URL of a table of your interest, go to the table and click on 'History' on the top right corner. | |
# You will see the upload history for the table on this page. Choose a time point of interest and click on the second | |
# to the last button on the right (if you hover over the button it should say 'View at this point in the hisotry'). | |
# You will be directed to view the table. Then click on 'Raw' and copy the URL. | |
covid <- read.csv("https://raw.githubusercontent.com/nychealth/coronavirus-data/7ce1b84610232be9c3f780484865a51f73b8c469/recent/recent-4-week-by-modzcta.csv") | |
head(covid) |
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
##### Importing Framingham Heart Study data from a github repository (https://github.com/GauravPadawe/Framingham-Heart-Study) | |
library(tidyverse) | |
#importing the dataset | |
chddata <- read.csv("https://raw.githubusercontent.com/GauravPadawe/Framingham-Heart-Study/adcc828b8a5b3ddbd8d5b8b98e2b27cf60538db6/framingham.csv") | |
#some recoding | |
chddataclean <- chddata %>% | |
mutate(TenYearCHD = if_else (TenYearCHD=='1',"CHD", "No-CHD"), |
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(SingleCellMultiModal) | |
library(MultiAssayExperiment) | |
suppressMessages(scmm <- scMultiome(dry.run = FALSE)) | |
format(object.size(scmm), units="Mb") #31Mb in memory | |
saveHDF5MultiAssayExperiment(scmm) | |
dir("h5_mae", full.names=TRUE) |> file.info() # ~193MB on disk | |
suppressMessages(scmm_sparse <- scMultiome(format = "MTX", 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(curatedTCGAData) | |
library(TCGAutils) | |
library(RaggedExperiment) | |
## ----------------------------------------------------------------------------------------------------------------------------------------- | |
cnvdry <- | |
curatedTCGAData(assays = "CNVSNP", |
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 |