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(lefser) | |
library(curatedMetagenomicData) | |
}) | |
zeller <- | |
curatedMetagenomicData("ZellerG_2014.pathway_abundance", | |
counts = TRUE, | |
dryrun = FALSE)[[1]] | |
zeller <- zeller[, zeller$study_condition != "adenoma"] | |
zeller <- relativeAb(zeller) |
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
metaphlanToPhyloseq <- function( | |
metaphlandir, | |
metadat=NULL, | |
simplify=TRUE){ | |
## tax is a matrix or data.frame with the table of taxonomic abundances, rows are taxa, columns are samples | |
## metadat is an optional data.frame of specimen metadata, rows are samples, columns are variables | |
## if simplify=TRUE, use only the most detailed level of taxa names in the final object | |
## metaphlanToPhyloseq("~/Downloads/metaphlan_bugs_list") | |
.getMetaphlanTree <- function(removeGCF=TRUE, simplify=TRUE){ | |
if (!requireNamespace("ape")) { |
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) | |
library(mia) | |
library(dplyr) | |
library(purrr) | |
}) | |
datasets <- sampleMetadata |> | |
group_by(study_name) |> | |
count() |> |
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
Before using this script you need to create an OpenAI API key (https://platform.openai.com/api-keys) | |
and put it in ~/.Renviron: | |
OPENAI_API_KEY='my_key_here' | |
# libraries used | |
library(openai) | |
library(dplyr) | |
library(stringr) |
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(bugsigdbr) | |
bsdb <- importBugSigDB(version = "devel") | |
# Create a stacked barplot of the proportion of Pielou, Shannon, Chao1, Simpson, Inverse Simpson, and Richness as a function of year | |
library(tidyverse) | |
bsdb_by_year <- bsdb |> | |
filter(Year > 2014) |> | |
dplyr::group_by(Year) |> | |
dplyr::summarize( | |
Pielou = sum(!is.na(Pielou)) / n(), |
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: "Stepwise treadmill test" | |
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
% \VignetteIndexEntry{Using Affymetrix Probe Level Data} | |
% \VignetteDepends{hgu95av2.db, rae230a.db, rae230aprobe, Biostrings} | |
% \VignetteKeywords{Annotation} | |
%\VignettePackage{annotate} | |
\documentclass{article} | |
\newcommand{\Rfunction}[1]{{\texttt{#1}}} | |
\newcommand{\Rmethod}[1]{{\texttt{#1}}} |
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)) | |
zeller <- curatedMetagenomicData::curatedMetagenomicData("Zeller.+relative_abundance", counts = FALSE, dryrun = FALSE)[[1]] | |
zellercounts <- curatedMetagenomicData::curatedMetagenomicData("Zeller.+relative_abundance", counts = TRUE, dryrun = FALSE)[[1]] | |
zeller <- zeller[, zeller$study_condition != "adenoma"] | |
zellercounts <- zellercounts[, zellercounts$study_condition != "adenoma"] | |
suppressPackageStartupMessages(library(lefser)) | |
res_group <- lefser(zeller, groupCol = "study_condition") | |
res_group_counts <- lefser(zellercounts, groupCol = "study_condition") |
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,] |> |
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) | |
``` |
NewerOlder