-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
4 changed files
with
208 additions
and
201 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 |
---|---|---|
@@ -1,35 +1,37 @@ | ||
Package: MARMoSET | ||
Type: Package | ||
Title: Get metadata out of raw files | ||
Version: 0.1.0 | ||
Author: Who wrote it | ||
Maintainer: The package maintainer <yourself@somewhere.net> | ||
Description: This packages uses a c# command line tool to extract the meta data of a raw file into a json file. | ||
It contains methods to collect data requred for publication by journal and to write them into a tab delimited text file. | ||
License: What license is it under? | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Imports: | ||
assertive.base, | ||
assertive.files, | ||
assertive.numbers, | ||
assertive.properties, | ||
assertive.reflection, | ||
assertive.sets, | ||
assertive.strings, | ||
assertive.types, | ||
dplyr, | ||
jsonlite, | ||
pathological, | ||
rlist, | ||
stringi, | ||
tidyr, | ||
magrittr | ||
Depends: | ||
R (>= 2.10) | ||
Suggests: | ||
readODS, | ||
knitr, | ||
rmarkdown | ||
RoxygenNote: 6.1.1 | ||
VignetteBuilder: knitr | ||
Package: MARMoSET | ||
Type: Package | ||
Title: Get metadata out of raw files | ||
Version: 0.1.0 | ||
Author: Who wrote it | ||
Maintainer: The package maintainer <yourself@somewhere.net> | ||
Description: Extraction of meta data from Thermo Fisher Scientific mass spectrometric raw data files into a json file via a | ||
c# command line tool. | ||
Also provided are methods to assemble data requred for publication by journals and to write them into a tab delimited text file. | ||
License: GPL (>= 3) | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Imports: | ||
assertive.base, | ||
assertive.files, | ||
assertive.numbers, | ||
assertive.properties, | ||
assertive.reflection, | ||
assertive.sets, | ||
assertive.strings, | ||
assertive.types, | ||
dplyr, | ||
jsonlite, | ||
magrittr, | ||
pathological, | ||
rlist, | ||
stringi, | ||
tidyr, | ||
utils | ||
Depends: | ||
R (>= 2.10) | ||
Suggests: | ||
readODS, | ||
knitr, | ||
rmarkdown | ||
RoxygenNote: 6.1.1 | ||
VignetteBuilder: knitr |
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,19 +1,20 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX | ||
|
||
AutoAppendNewline: Yes | ||
StripTrailingWhitespace: Yes | ||
|
||
BuildType: Package | ||
PackageInstallArgs: --no-multiarch --with-keep.source | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX | ||
|
||
AutoAppendNewline: Yes | ||
StripTrailingWhitespace: Yes | ||
|
||
BuildType: Package | ||
PackageInstallArgs: --no-multiarch --with-keep.source | ||
PackageCheckArgs: --as-cran |
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,80 +1,82 @@ | ||
#' Number of groups in the json file | ||
#' | ||
#' @param json A JSON file generated by the function "generate_json()" or by using MARMoSET.exe externaly. | ||
#' | ||
#' @return Count of groups in the JSON file. | ||
#' | ||
#' @examples | ||
#' data <- system.file( | ||
#' file.path('extdata', 'testfile.raw'), | ||
#' package = 'MARMoSET', mustWork = TRUE) | ||
#' json <- generate_json(data) | ||
#' | ||
#' group_count(json) | ||
#' | ||
#' @export | ||
|
||
group_count <- function(json) | ||
{ | ||
assertive.types::assert_is_list(json) | ||
|
||
return(json[["Group"]] %>% length()) | ||
} | ||
|
||
|
||
#' Filenames of one group | ||
#' | ||
#' @param json A JSON file generated by the function "generate_json()" or by using MARMoSET.exe externaly. | ||
#' @param group_number An index that determines the group. | ||
#' | ||
#' @return A list of filenames belonging to the choosen group. | ||
#' | ||
#' @examples | ||
#' data <- system.file( | ||
#' file.path('extdata', 'testfile.raw'), | ||
#' package = 'MARMoSET', mustWork = TRUE) | ||
#' json <- generate_json(data) | ||
#' | ||
#' files_in_group(json, 1) | ||
#' | ||
#' @export | ||
|
||
files_in_group <- function(json, group_number) | ||
{ | ||
assertive.types::assert_is_list(json) | ||
assertive.types::assert_is_a_number(group_number) | ||
assertive.numbers::assert_all_are_less_than_or_equal_to(group_number, group_count(json)) | ||
|
||
return(json[["Group"]][[group_number]][["Names"]]) | ||
} | ||
|
||
|
||
#' Get instrument names | ||
#' | ||
#' @param json A JSON file generated by the function "generate_json()" or by using MARMoSET.exe externaly. | ||
#' @param group_number An index that determines the group. | ||
#' | ||
#' @return A list of instruments used in the choosen group. | ||
#' | ||
#' @examples | ||
#' data <- system.file( | ||
#' file.path('extdata', 'testfile.raw'), | ||
#' package = 'MARMoSET', mustWork = TRUE) | ||
#' json <- generate_json(data) | ||
#' | ||
#' instrument_names(json, 1) | ||
#' | ||
#' @export | ||
|
||
instrument_names <- function(json, group_number) | ||
{ | ||
assertive.types::assert_is_list(json) | ||
assertive.types::assert_is_a_number(group_number) | ||
assertive.numbers::assert_all_are_less_than_or_equal_to(group_number, group_count(json)) | ||
|
||
instruments <- json[["Group"]][[group_number]][["Instruments"]] %>% | ||
summary() %>% | ||
rownames() | ||
|
||
return(instruments) | ||
} | ||
#' Number of groups in the json file | ||
#' | ||
#' @param json A JSON file generated by the function "generate_json()" or by using MARMoSET.exe externaly. | ||
#' | ||
#' @return Count of groups in the JSON file. | ||
#' | ||
#' @examples | ||
#' data <- system.file( | ||
#' file.path('extdata', 'testfile.raw'), | ||
#' package = 'MARMoSET', mustWork = TRUE) | ||
#' json <- generate_json(data) | ||
#' | ||
#' group_count(json) | ||
#' | ||
#' @export | ||
|
||
group_count <- function(json) | ||
{ | ||
assertive.types::assert_is_list(json) | ||
|
||
return(json[["Group"]] %>% length()) | ||
} | ||
|
||
|
||
#' Filenames of one group | ||
#' | ||
#' @param json A JSON file generated by the function "generate_json()" or by using MARMoSET.exe externaly. | ||
#' @param group_number An index that determines the group. | ||
#' | ||
#' @return A list of filenames belonging to the choosen group. | ||
#' | ||
#' @examples | ||
#' data <- system.file( | ||
#' file.path('extdata', 'testfile.raw'), | ||
#' package = 'MARMoSET', mustWork = TRUE) | ||
#' | ||
#' # Real-time JSON-generation: `json <- generate_json(data)` | ||
#' json <- MARMoSET::testfile_json | ||
#' | ||
#' files_in_group(json, 1) | ||
#' | ||
#' @export | ||
|
||
files_in_group <- function(json, group_number) | ||
{ | ||
assertive.types::assert_is_list(json) | ||
assertive.types::assert_is_a_number(group_number) | ||
assertive.numbers::assert_all_are_less_than_or_equal_to(group_number, group_count(json)) | ||
|
||
return(json[["Group"]][[group_number]][["Names"]]) | ||
} | ||
|
||
|
||
#' Get instrument names | ||
#' | ||
#' @param json A JSON file generated by the function "generate_json()" or by using MARMoSET.exe externaly. | ||
#' @param group_number An index that determines the group. | ||
#' | ||
#' @return A list of instruments used in the choosen group. | ||
#' | ||
#' @examples | ||
#' data <- system.file( | ||
#' file.path('extdata', 'testfile.raw'), | ||
#' package = 'MARMoSET', mustWork = TRUE) | ||
#' json <- generate_json(data) | ||
#' | ||
#' instrument_names(json, 1) | ||
#' | ||
#' @export | ||
|
||
instrument_names <- function(json, group_number) | ||
{ | ||
assertive.types::assert_is_list(json) | ||
assertive.types::assert_is_a_number(group_number) | ||
assertive.numbers::assert_all_are_less_than_or_equal_to(group_number, group_count(json)) | ||
|
||
instruments <- json[["Group"]][[group_number]][["Instruments"]] %>% | ||
summary() %>% | ||
rownames() | ||
|
||
return(instruments) | ||
} |
Oops, something went wrong.