-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5373016
commit d92f4dd
Showing
9 changed files
with
709 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
^\.Rproj\.user$ | ||
^\.travis\.yml$ | ||
^codecov\.yml$ | ||
^LICENSE\.md$ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r | ||
|
||
language: R | ||
cache: packages | ||
language: r | ||
|
||
r_packages: | ||
- covr | ||
- devtools | ||
|
||
r_github_packages: | ||
- r-lib/covr | ||
- codecov/POMA | ||
|
||
after_success: | ||
- Rscript -e 'covr::codecov()' | ||
- Rscript -e 'library(covr);codecov()' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
Package: POMA | ||
Title: What the Package Does (One Line, Title Case) | ||
Title: R Package for Statistical Analysis of Metabolomic Data | ||
Version: 0.0.0.9000 | ||
Authors@R: | ||
person(given = "First", | ||
family = "Last", | ||
person(given = "Pol", | ||
family = "Castellano-Escuder", | ||
role = c("aut", "cre"), | ||
email = "first.last@example.com", | ||
comment = c(ORCID = "YOUR-ORCID-ID")) | ||
email = "polcaes@gmail.com", | ||
comment = c(ORCID = "0000-0001-6466-877X")) | ||
Description: What the package does (one paragraph). | ||
License: What license it uses | ||
License: GPL-3 | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Imports: | ||
tidyverse | ||
crayon | ||
clisymbols | ||
impute | ||
reshape2 | ||
Suggests: | ||
covr, | ||
testthat (>= 2.1.0), | ||
tidyverse | ||
testthat (>= 2.1.0) | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 6.1.1 |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
PomaNormPlot <- function(data, group = c("subjects", "metabolites")){ | ||
|
||
if (missing(group)) { | ||
group <- "subjects" | ||
warning("group argument is empty! subjects will be used") | ||
} | ||
|
||
colnames(data)[1:2] <- c("ID", "Group") | ||
data <- data %>% mutate(ID = paste0(row_number(), "_", ID)) | ||
|
||
normtable_metabolites <- select(data, -ID) %>% | ||
reshape2::melt() | ||
|
||
normtable_subjects <- select(data, -Group) %>% | ||
as_tibble() %>% | ||
gather(var, value, -ID) %>% | ||
spread(ID, value) %>% | ||
reshape2::melt() | ||
|
||
normtable_subjects <- normtable_subjects %>% | ||
mutate(variable = str_replace_all(variable, "._", "")) | ||
|
||
if(group == "subjects"){ | ||
|
||
normtable_subjects %>% | ||
group_by(variable) %>% | ||
ggplot(aes(variable, value, color = variable)) + | ||
geom_boxplot() + | ||
geom_jitter() + | ||
theme(legend.position = "none") + | ||
theme_minimal() + | ||
xlab("") + | ||
ggtitle("Normalization Plot by Subjects") + | ||
theme(axis.text.x = element_text(angle = 45, hjust = 1), | ||
legend.position = "none") | ||
|
||
} | ||
else{ | ||
|
||
normtable_metabolites %>% | ||
group_by(Group) %>% | ||
ggplot(aes(variable, value, color = Group)) + | ||
geom_boxplot() + | ||
geom_jitter() + | ||
theme(legend.position = "none") + | ||
theme_minimal() + | ||
xlab("") + | ||
ggtitle("Normalization Plot by Metabolites") + | ||
theme(axis.text.x = element_text(angle = 45, hjust = 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# POMA package | ||
|
||
## R Package for Statistical Analysis of Metabolomic Data | ||
|
||
<!-- badges: start --> | ||
[](https://codecov.io/gh/pcastellanoescuder/POMA_package?branch=master) | ||
<!-- badges: end --> |