Skip to content

Commit

Permalink
update R CMD Check badge
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsmechtel committed Nov 16, 2023
1 parent aef909a commit 51c63b3
Show file tree
Hide file tree
Showing 20 changed files with 282 additions and 28 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
Expand All @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -29,30 +29,21 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v1

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MetAlyzer
Type: Package
Title: Read and Analyze 'MetIDQ™' Software Output Files
Version: 0.2.0
Version: 1.0.0
Authors@R:
c(person("Nils", "Mechtel",
email = "[email protected]",
Expand All @@ -28,6 +28,8 @@ Imports:
stringr,
utils,
rlang,
ggplot2,
ggrepel,
SummarizedExperiment,
S4Vectors,
BiocManager,
Expand Down
13 changes: 13 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
# Generated by roxygen2: do not edit by hand

export(MetAlyzer_dataset)
export(calc_CV)
export(calculate_log2FC)
export(exportConcValues)
export(extraction_data)
export(filterMetaData)
export(filterMetabolites)
export(impute_data)
export(pathway)
export(plot_log2FC)
export(polarity)
export(read_named_region)
export(renameMetaData)
export(summarizeConcValues)
export(summarizeQuantData)
export(transform_data)
export(treatment_data)
export(updateMetaData)
import(SummarizedExperiment)
import(dplyr)
import(ggplot2)
import(ggrepel)
importFrom(rlang,.data)
importFrom(stats,lm)
importFrom(utils,install.packages)
importFrom(utils,installed.packages)
5 changes: 3 additions & 2 deletions R/calculate_log2FC.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#' @return A data frame containing the log2 fold change for each metabolite
#'
#' @import dplyr
#' @import SummarizedExperiment
#' @importFrom utils install.packages
#' @importFrom utils installed.packages
#' @importFrom rlang .data
Expand All @@ -27,7 +28,7 @@ calculate_log2FC <- function(metalyzer_se, categorical, perc_of_min = 0.2, imput
installation_type = "binary") {
metalyzer_se <- impute_data(metalyzer_se, perc_of_min, impute_NA)
metalyzer_se <- transform_data(metalyzer_se)
aggregated_data <- metadata(metalyzer_se)$aggregated_data
aggregated_data <- metalyzer_se@metadata$aggregated_data
meta_data <- colData(metalyzer_se)
cat_str <- deparse(substitute(categorical))

Expand All @@ -39,7 +40,7 @@ calculate_log2FC <- function(metalyzer_se, categorical, perc_of_min = 0.2, imput
}),
levels = unique(mapping_vec)), .after = ID)

metadata(metalyzer_se)$aggregated_data <- aggregated_data
metalyzer_se@metadata$aggregated_data <- aggregated_data
## Check for qvalue and BiocManager installation
installed_packages <- utils::installed.packages()[, "Package"]
if (! "qvalue" %in% installed_packages) {
Expand Down
4 changes: 2 additions & 2 deletions R/impute_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impute_data <- function(
perc_of_min,
impute_NA
) {
aggregated_data <- metadata(metalyzer_se)$aggregated_data
aggregated_data <- metalyzer_se@metadata$aggregated_data
cat("Impute concentrations (groupwise: Metabolite) with",
paste0(round(perc_of_min * 100), "%"),
"of the minimal positive value... ")
Expand All @@ -48,7 +48,7 @@ impute_data <- function(
Concentration, perc_of_min, impute_NA),
.after = Concentration) %>%
group_by_at(grouping_vars)
metadata(metalyzer_se)$aggregated_data <- aggregated_data
metalyzer_se@metadata$aggregated_data <- aggregated_data
cat("finished!\n")
return(metalyzer_se)
}
2 changes: 1 addition & 1 deletion R/plot_network.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Plot Pathway Network
#' Plot Pathway Network
#'
#' @description This function plots the log2 fold change for each metabolite and visualizes it, in a pathway network.
#'
Expand Down
4 changes: 2 additions & 2 deletions R/transform_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ transform <- function(vec, func) {
#' @return An updated aggregated_data tibble data frame
#' @export
transform_data <- function(metalyzer_se) {
aggregated_data <- metadata(metalyzer_se)$aggregated_data
aggregated_data <- metalyzer_se@metadata$aggregated_data
aggregated_data <- mutate(aggregated_data,
log2_Conc = transform(imputed_Conc, base::log2),
.after = imputed_Conc)
metadata(metalyzer_se)$aggregated_data <- aggregated_data
metalyzer_se@metadata$aggregated_data <- aggregated_data
return(metalyzer_se)
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MetAlyzer
========

<!-- badges: start -->
[![R-CMD-check](https://github.com/nilsmechtel/MetAlyzer/workflows/R-CMD-check/badge.svg)](https://github.com/nilsmechtel/MetAlyzer/actions)
[![R-CMD-check](https://github.com/nilsmechtel/MetAlyzer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nilsmechtel/MetAlyzer/actions/workflows/R-CMD-check.yaml)
[![license](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![metacran downloads](https://cranlogs.r-pkg.org/badges/grand-total/MetAlyzer)](https://cran.r-project.org/package=MetAlyzer)
<!-- badges: end -->
Expand Down
Binary file added data/example_meta_data.RDS
Binary file not shown.
2 changes: 1 addition & 1 deletion man/aggregate_data.Rd

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

18 changes: 18 additions & 0 deletions man/apply_linear_model.Rd

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

22 changes: 22 additions & 0 deletions man/calc_CV.Rd

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

39 changes: 39 additions & 0 deletions man/calculate_log2FC.Rd

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

25 changes: 25 additions & 0 deletions man/impute_data.Rd

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

40 changes: 40 additions & 0 deletions man/plot_log2FC.Rd

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

28 changes: 28 additions & 0 deletions man/read_named_region.Rd

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

17 changes: 17 additions & 0 deletions man/set_threshold.Rd

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

18 changes: 18 additions & 0 deletions man/transform.Rd

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

Loading

0 comments on commit 51c63b3

Please sign in to comment.