Skip to content

Instantly share code, notes, and snippets.

@lwaldron
Created July 19, 2025 16:10
Show Gist options
  • Save lwaldron/d0446999867538d7b4bb5925be7712b0 to your computer and use it in GitHub Desktop.
Save lwaldron/d0446999867538d7b4bb5925be7712b0 to your computer and use it in GitHub Desktop.
F. prausnitzii in PD
---
title: "F. prausnitzii in PD"
author: "Levi Waldron"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r, message=FALSE}
library(bugsigdbr)
library(dplyr)
```
```{r}
df <- importBugSigDB(version = "devel", cache = TRUE)
dfp <- filter(df, grepl("Parkinson", df$Condition) &
grepl("healthy|control", df$`Group 0 name`, ignore.case=TRUE) &
!grepl("Parkinson's disease patients", df$`Group 0 name`, ignore.case=TRUE) &
`Host species` == "Homo sapiens" &
grepl("Faecalibacterium", df$`MetaPhlAn taxon names`)
)
```
```{r}
length(unique(dfp$Study)) # studies
nrow(dfp) # signatures
```
```{r}
library(bugSigSimple)
res <- bugSigSimple::createTaxonTable(dfp, n=40) |>
select(c(1, 2, 4, 5))
res <- filter(res, grepl("Blautia|Roseburia|Faecalibacterium|Fusicatenibacter saccharivorans|Anaerostipes hadrus|Bacteroides ovatus|Eubacterium rectale", res$`Taxon Name`))
kableExtra::kable(res)
```
```{r}
sigs <- getSignatures(dfp, tax.id.type = "taxname")
writeGMT(sigs, gmt.file = "~/Downloads/PDsignatures.txt")
```
@lwaldron
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment