View cmdErr.R
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
suppressPackageStartupMessages(library(curatedMetagenomicData)) | |
sampleMetadata[sampleMetadata$study_name == "FengQ_2015", ] |> | |
returnSamples("relative_abundance", rownames = "NCBI") | |
allstudies <- unique(sampleMetadata$study_name) | |
allres <- sapply(allstudies, function(study) { | |
message(study) | |
try( | |
suppressMessages(sampleMetadata[sampleMetadata$study_name == study,] |> |
View NYC_CHS20.Rmd
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: "NYC CHS import" | |
author: "Levi Waldron" | |
date: "`r Sys.Date()`" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE, message = FALSE) | |
``` |
View benchmark_heatmapTable.R
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
req.packages <- c("GenomicSuperSignature", "bcellViper", "microbenchmark", "reprex") | |
BiocManager::install(req.packages, ask=FALSE, force = FALSE) | |
reprex::reprex({ | |
BiocManager::version() | |
BiocManager::valid() | |
suppressPackageStartupMessages({ | |
library(GenomicSuperSignature) | |
library(bcellViper) |
View anscombe_residuals.Rmd
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) | |
``` |
View microsud_cmd_reprex.R
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({ |
View diabimmune.R
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(.)) |
View NYC-COVID_ACS_merge
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) |
View framingham.R
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"), |
View scMultiome.R
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)) |
View TCGA_re.R
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", |
NewerOlder