Skip to content

Commit

Permalink
Merge pull request #42 from jasenfinch/devel
Browse files Browse the repository at this point in the history
v0.7.7
  • Loading branch information
jasenfinch authored Nov 25, 2020
2 parents 84b41dc + 0e3fb94 commit d5c5b46
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
#- {os: windows-latest, r: 'release'}
#- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: MFassign
Title: Molecular Formula Assignment for High Resolution metabolomics
Version: 0.7.6
Version: 0.7.7
Authors@R: person("Jasen", "Finch", email = "jsf9@aber.ac.uk", role = c("aut", "cre"))
Description: Molecular formula assignment for high resolution metabolomics.
Depends: R (>= 3.5.0),
Expand Down Expand Up @@ -30,7 +30,7 @@ Remotes: jasenfinch/mzAnnotation,
License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
Collate:
'allGenerics.R'
'allClasses.R'
Expand Down
4 changes: 2 additions & 2 deletions R/addMFs.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ addMFs <- function(rel,MF,identMF = T){
relations[,chr_columns] <- relations[,chr_columns] %>%
{
.[is.na(.)] <- ''
return(.)
.
}

relations <- relations %>%
Expand All @@ -36,7 +36,7 @@ addMFs <- function(rel,MF,identMF = T){
relations[,chr_columns] <- relations[,chr_columns] %>%
{
.[is.na(.)] <- ''
return(.)
.
}

relations <- relations %>%
Expand Down
6 changes: 3 additions & 3 deletions R/assignMFs.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
#'
#' @export

assignMFs <- function(dat,parameters,verbose = T) {
assignMFs <- function(dat,parameters,verbose = TRUE) {
options(digits = 10)

if (verbose == T) {
if (verbose == TRUE) {
startTime <- proc.time()
message(blue('\nMFassign '),red(str_c('v',packageVersion('MFassign') %>% as.character())),' ',date())
message(rep('_',console_width()))
Expand All @@ -28,7 +28,7 @@ assignMFs <- function(dat,parameters,verbose = T) {
{.[-1]} %>%
{
.[1] <- yellow(.[1])
return(.)
.
} %>%
str_c(collapse = '\n')
message(params)
Expand Down
24 changes: 6 additions & 18 deletions R/prepCorrelations-method.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,24 @@ setMethod('prepCorrelations',signature = 'Assignment',

correlations <- correlations %>%
mutate(Mode1 = str_split_fixed(Feature1,'@',2) %>%
as_tibble() %>%
select(V1) %>%
unlist() %>%
.[,1] %>%
str_sub(1,1),
Mode2 = str_split_fixed(Feature2,'@',2) %>%
as_tibble() %>%
select(V1) %>%
unlist() %>%
.[,1] %>%
str_sub(1,1),
`m/z1` = str_split_fixed(Feature1,'@',2) %>%
as_tibble() %>%
select(V1) %>%
unlist() %>%
.[,1] %>%
str_replace_all('[:alpha:]','') %>%
as.numeric(),
`m/z2` = str_split_fixed(Feature2,'@',2) %>%
as_tibble() %>%
select(V1) %>%
unlist() %>%
.[,1] %>%
str_replace_all('[:alpha:]','') %>%
as.numeric(),
RetentionTime1 = str_split_fixed(Feature1,'@',2) %>%
as_tibble() %>%
select(V2) %>%
unlist() %>%
.[,2] %>%
as.numeric(),
RetentionTime2 = str_split_fixed(Feature2,'@',2) %>%
as_tibble() %>%
select(V2) %>%
unlist() %>%
.[,2] %>%
as.numeric(),
ID = 1:nrow(.)
) %>%
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# MFassign

[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![R build status](https://github.com/jasenfinch/MFassign/workflows/R-CMD-check/badge.svg)](https://github.com/jasenfinch/MFassign/actions)
[![Coverage Status](https://img.shields.io/codecov/c/github/jasenfinch/MFassign/master.svg)](https://codecov.io/github/jasenfinch/MFassign?branch=master)
[![license](https://img.shields.io/badge/license-GNU%20GPL%20v3.0-blue.svg)](https://github.com/jasenfinch/MFassign/blob/master/DESCRIPTION)

<!-- badges: end -->

An R package for molecular formula assignment in high resolution metabolomics

### Installation

``` r
devtools::install_github('jasenfinch/MFassign')
```
```
2 changes: 1 addition & 1 deletion man/assignMFs.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-assignMFs.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ context('assignMFs')
p <- assignmentParameters('FIE')
p@nCores <- 2

assignment <- assignMFs(peakData,p,verbose = FALSE)
assignment <- assignMFs(peakData,p,verbose = TRUE)

test_that('assignMFs works',{
expect_true(class(assignment) == "Assignment")
Expand Down

0 comments on commit d5c5b46

Please sign in to comment.