Skip to content

Commit

Permalink
Merge pull request #24 from AleruDivine/main
Browse files Browse the repository at this point in the history
Updated vignettes
  • Loading branch information
cmirzayi authored Jan 24, 2025
2 parents 245892e + 4da9b9e commit 7442f42
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 17 deletions.
1 change: 1 addition & 0 deletions bugSigSimple.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: b8714a68-b332-4c39-88f2-49fdba065555

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
8 changes: 7 additions & 1 deletion vignettes/c-section_meconium_shaimaa.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ subset.final <-
arrange(PMID)
```
Show key characteristics of the included signatures:

```{r}
detach("package:dplyr", unload = TRUE)
library(dplyr)
```

```{r}
select(subset.final, all_of(c("PMID", "Source", "Group 0 name", "Group 1 name", "Abundance in Group 1")))
select(subset.final, "PMID", "Source", "Group 0 name", "Group 1 name", "Abundance in Group 1")
```

Are any studies missing?
Expand Down
27 changes: 20 additions & 7 deletions vignettes/capstoneanalysis_clare.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,22 @@ covid_all <- bugsigdbr::subsetByOntology(dat, column = "Condition", "COVID-19",
mutate(studyexp = paste(Study, Experiment, sep = "_")) %>%
mutate(
site = recode(`Body site`,
"feces" = "Gut",
"rectal" = "Gut",
"nasopharynx" = "aURT",
"oropharynx" = "aURT",
"nasopharynx,oropharynx" = "aURT",
"tongue" = "aURT"
"Feces" = "Gut",
"Rectum" = "Gut",
"Nasopharynx" = "aURT",
"Oropharynx" = "aURT",
"Nasopharynx,Oropharynx" = "aURT",
"Nasal cavity" = "aURT",
"Surface of tongue" = "aURT",
"Nasopharynx,Throat" = "aURT",
"Throat" = "aURT",
"Tongue" = "aURT",
"Lung" = "LRT",
"Sputum" = "LRT"
)
) %>%
mutate(comparison1 = paste(`Group 0 name`, `Group 1 name`, sep = " vs "))
```


## Table of studies

Expand All @@ -73,6 +78,10 @@ gut_sigs <- filter(covid_all,
naso_sigs <- filter(covid_all,
site == "aURT") %>%
drop_na(Source)
resp_sigs <- filter(covid_all,
site == "LRT") %>%
drop_na(Source)
```

Expand All @@ -88,6 +97,10 @@ kableExtra::kbl(bugSigSimple::createTaxonTable(gut_sigs))
kableExtra::kbl(bugSigSimple::createTaxonTable(naso_sigs))
```

```{r}
kableExtra::kbl(bugSigSimple::createTaxonTable(resp_sigs))
```

# gut microbiota analysis

Look specifically at case-control comparisons
Expand Down
10 changes: 5 additions & 5 deletions vignettes/capstoneanalysis_fatima.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ dim(dat)
```{r}
my.dat <- subsetByCurator(dat, curator="Fatima Zohra")
table(my.dat[,"Condition"])
condsnew <-c("bipolar disorder","unipolar depression")
condsnew <-c("bipolar disorder","major depressive disorder")
condsnew <-c("bipolar disorder")
efo <- bugsigdbr::getOntology("efo")
dat.bpd <- bugsigdbr::subsetByOntology(dat, column = "Condition", "bipolar disorder", efo)
dat.upd <- bugsigdbr::subsetByOntology(dat, column = "Condition", "unipolar depression", efo)
dat.upd <- bugsigdbr::subsetByOntology(dat, column = "Condition", "major depressive disorder", efo)
my.dat.cond <- rbind(dat.bpd, dat.upd)
table(my.dat.cond[,"Condition"])
Expand Down Expand Up @@ -104,9 +104,9 @@ my.dat.mdd <- my.dat.cond[!ind,]
dim(my.dat.mdd)
table(my.dat.mdd[,"Condition"])
getMostFrequentTaxa(my.dat.mdd, n=20)
getMostFrequentTaxa(my.dat.mdd,sig.type= "increased")
getMostFrequentTaxa(my.dat.mdd,sig.type= "decreased")
getMostFrequentTaxa(my.dat.mdd, n= 20)
getMostFrequentTaxa(my.dat.mdd,, "UP")
getMostFrequentTaxa(my.dat.mdd,, "DOWN")
```

## Binomial test "Increased in bipolar"
Expand Down
2 changes: 1 addition & 1 deletion vignettes/capstoneanalysis_kweku.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ bugSigSimple::createStudyTable(dat_condition)

```{r}
gut_sigs <- filter(dat_condition,
`Body site` %in% c("feces,mucosa of small intestine", "feces"))
`Body site` %in% c("Feces, Mucosa of small intestine", "Feces"))
```

In this table, the Binomial Test p-value corresponds to the null hypothesis
Expand Down
5 changes: 3 additions & 2 deletions vignettes/fieldworkanalysis_samara.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ fit.negbin <-
data = df,
control = glm.control(
epsilon = 1e-8,
maxit = 70,
maxit = 50,
trace = FALSE
)
)
summary(fit.negbin)
library(broom)
tidy(fit.negbin)
fit.ZInegbin <- zeroinfl(Streptococcus ~ Lactobacillus + age + BMI | 1,
data = df,
Expand Down
2 changes: 1 addition & 1 deletion vignettes/healthysig.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ overlap0_increased<- merge(x = bugall_increased, y = paircheck0_increased, by =c
overlap0_increased[is.na(overlap0_increased)] <- 0
```


#```{r comparison-increased_vs_decrease}
```
t.test(overlap0_increased$overlap, overlap0_decreased$overlap)
wilcox.test(overlap0_increased$overlap, overlap0_decreased$overlap)
Expand Down

0 comments on commit 7442f42

Please sign in to comment.