Skip to content

Commit

Permalink
fixes for R CMD check
Browse files Browse the repository at this point in the history
  • Loading branch information
shackett committed Apr 29, 2021
1 parent d217633 commit 4d28898
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
^\.Rproj\.user$
assets
^data-raw$
_pkgdown.yml
rsconnect
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.Ruserdata
.DS_Store
inst/doc
rsconnect
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Imports:
readr,
reshape2,
rlang,
RSQLite,
stringr,
tibble,
tidyr (>= 1.0.0)
Expand All @@ -37,6 +38,7 @@ Suggests:
dbplyr,
fgsea,
grDevices,
kableExtra,
knitr,
lubridate,
plotly,
Expand Down
10 changes: 7 additions & 3 deletions R/import_mzroll.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ process_mzroll <- function(
}

#' Create SQLite Connection
#'
#' Open a connection to an SQLite database
#'
#' @param sqlite_path path to sqlite file
#'
#' @return sqlite connection
create_sqlite_con <- function(sqlite_path) {

checkmate::assertFileExists(sqlite_path)
Expand Down Expand Up @@ -494,9 +500,7 @@ aggregate_mzroll_nest <- function(mzroll_list_nest, samples_tbl) {
groupId = factor(
groupId,
levels = levels(one_mzroll_list$features$groupId)
),
peakId = factor(peakId, levels = peakId)
)
))
# update values and schema
one_mzroll_list <- romic::update_tomic(one_mzroll_list, updated_mzroll_list$samples)

Expand Down
2 changes: 2 additions & 0 deletions R/pathway_enrichment.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#'
#' @examples
#'
#' library(dplyr)
#'
#' regression_significance <- diffex_mzroll(
#' nplug_mzroll_normalized,
#' "normalized_log2_abundance",
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ util_pretty_khead <- function(tbl, nrows = 10, caption = NULL) {
checkmate::assertNumber(nrows, lower = 1)

tbl %>%
slice(1:nrows) %>%
dplyr::slice(1:nrows) %>%
knitr::kable(caption = caption) %>%
kableExtra::kable_styling(
position = "left",
Expand Down
8 changes: 7 additions & 1 deletion man/create_sqlite_con.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/find_pathway_enrichments.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions vignettes/NPLUG.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ renamed_samples <- final_processed_data$samples %>%
"{stringr::str_sub(limitation, 1, 1)}{round(DR,2)}"
)) %>%
group_by(name) %>%
mutate(name = ifelse(n() == 1, name, paste0(name, "-", 1:n()))) %>%
mutate(
name = case_when(n() == 1 ~ name,
TRUE ~ paste0(name, "-", 1:n()))
) %>%
ungroup()
final_processed_data <- romic::update_tomic(
Expand All @@ -267,7 +270,7 @@ romic::plot_heatmap(

# Differential Abundance Testing

Having generated a processed dataset, we can already see some patterns clearly by looking at the heatmap, such as bottlenecking of pyrimidine biosynthesis during uracil limitation, amino acid accumulation during leucine limitation, and TCA up-regulation during ammonium limitation. Its also apparent that many of the strongest metabolomic alterations are observed at slow growth rates, while these there are relatively smooth transitions back to a normalish-metabolome as cell growth more quickly. To quantitatively summarize trends like these, its helpful to carryout differential abundance testing. But, before we proceed we should determine the type of model we need to fit by interpreting the major sources of variation in our dataset in light of the experimental design. This is
Having generated a processed dataset, we can already see some patterns clearly by looking at the heatmap, such as bottlenecking of pyrimidine biosynthesis during uracil limitation, amino acid accumulation during leucine limitation, and TCA up-regulation during ammonium limitation. Its also apparent that many of the strongest metabolomic alterations are observed at slow growth rates, while these there are relatively smooth transitions back to a normalish-metabolome as cell growth more quickly. To quantitatively summarize trends like these, its helpful to carryout differential abundance testing. But, before we proceed we should determine the type of model we need to fit by interpreting the major sources of variation in our dataset in light of the experimental design.

## Exploratory Data Analysis (EDA)

Expand Down Expand Up @@ -369,7 +372,7 @@ enrichments <- find_pathway_enrichments(
)
```

# generate a table of top enrichments
### Generate tables and plots of top enrichments

```{r fgsea_table, echo=FALSE}
enrichments$enrichment_table %>%
Expand Down

0 comments on commit 4d28898

Please sign in to comment.