diff --git a/README.Rmd b/README.Rmd index 63ebc9f..13328c3 100644 --- a/README.Rmd +++ b/README.Rmd @@ -35,31 +35,39 @@ The raw file format starts with meta data. It consists of more information about You can install MARMoSET from github the following way: -```{r, message=FALSE} -# install.packages("remotes") +```{r, eval=FALSE} +install.packages('remotes') -remotes::install_github("loosolab/MARMoSET", host="github.molgen.mpg.de/api/v3") - -library(MARMoSET) +remotes::install_github('loosolab/MARMoSET', host='github.molgen.mpg.de/api/v3') ``` ## Usage: -The c# command line tool can be used in R with `use_rawMetaAsJson()` to create a JSON file including only the meta data of grouped raw files. -It takes as argument `path_data`, a path to a raw file or a directory containing raw files. +The c# command line tool can be used in R with `use_rawMetaAsJson()` to create a JSON file including only the meta data of grouped raw files. It takes as argument `path_data`, a path to a raw file or a directory containing raw files. + +This JSON file can also be created by using the rawMetaAsJson.exe externally. + +Due to the design of the RawFileReader the rawMetaAsJson.exe and therefore this command is running as 64 bit code on Windows only. To use this package with another operating system, it is necessarry to already have the JSON file created. ```{r} -# representative of any raw file / directory containing raw files -data <- system.file( - file.path('extdata', 'testfile.raw'), - package = 'MARMoSET', mustWork = TRUE) +library(MARMoSET) -json <- use_rawMetaAsJson(path_data = data) +if(.Platform$OS.type == 'windows') +{ + # representative of any raw file / directory containing raw files + data <- system.file( + file.path('extdata', 'testfile.raw'), + package = 'MARMoSET', mustWork = TRUE) + + json <- use_rawMetaAsJson(path_data = data) +} else +{ + # non windows user need to read in the JSON file here + json <- MARMoSET::testfile_json +} ``` -This JSON file can also be created by using the rawMetaAsJson.exe externally. - To allow an easier access to the JSON file it needs to be flattened, this works with `flatten_json()` which takes only one argument: `json`. ```{r} @@ -67,12 +75,12 @@ flat_json <- flatten_json(json = json) ``` Since raw files include a huge amount of meta data and only several of this information is required by journals there is the need to sort out. Therefore a table linking which information is essential and where to find it in the flattened JSON is useful. Such a here refered to as 'term matching table' can be created with `term_matching_table()` by submitting two arguments. The first, `instrument_list` takes a vector with the names of the instruments represented in the JSON file. -The second one, `origin_key` specifies which requirements should be met. If it stays empty, all journals are selected. While `"jpr"` stands for the requirements of the Journal of Proteome Research, `"mcp"` chooses the requirements of the Molecular and Cellular Proteomics. +The second one, `origin_key` specifies which requirements should be met. If it stays empty, all journals are selected. While `'jpr'` stands for the requirements of the Journal of Proteome Research, `'mcp'` chooses the requirements of the Molecular and Cellular Proteomics. ```{r} term_matching_table <- create_term_match_table( - instrument_list = c("Thermo EASY-nLC", "Q Exactive - Orbitrap_MS"), - origin_key = "jpr") + instrument_list = c('Thermo EASY-nLC', 'Q Exactive - Orbitrap_MS'), + origin_key = 'jpr') ``` The names of the instruments can be shown for each group with `instrument_names()` with the json and the group number as arguments. diff --git a/README.md b/README.md index f520aa5..65bbad2 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,12 @@ The raw file format starts with meta data. It consists of more information about Installation ------------ -You can install MARMoSET from github with: +You can install MARMoSET from github the following way: ``` r -# install.packages("devtools") -# devtools::install_github("loosolab/MARMoSET") +install.packages('remotes') -library(MARMoSET) +remotes::install_github('loosolab/MARMoSET', host='github.molgen.mpg.de/api/v3') ``` Usage: @@ -39,29 +38,40 @@ Usage: The c\# command line tool can be used in R with `use_rawMetaAsJson()` to create a JSON file including only the meta data of grouped raw files. It takes as argument `path_data`, a path to a raw file or a directory containing raw files. +This JSON file can also be created by using the rawMetaAsJson.exe externally. + +Due to the design of the RawFileReader the rawMetaAsJson.exe and therefore this command is running as 64 bit code on Windows only. To use this package with another operating system, it is necessarry to already have the JSON file created. + ``` r -# representative of any raw file / directory containing raw files -data <- system.file( - file.path('extdata', 'testfile.raw'), - package = 'MARMoSET', mustWork = TRUE) +library(MARMoSET) -json <- use_rawMetaAsJson(path_data = data) +if(.Platform$OS.type == 'windows') +{ + # representative of any raw file / directory containing raw files + data <- system.file( + file.path('extdata', 'testfile.raw'), + package = 'MARMoSET', mustWork = TRUE) + + json <- use_rawMetaAsJson(path_data = data) +} else +{ + # non windows user need to read in the JSON file here + json <- MARMoSET::testfile_json +} ``` -This JSON file can also be created by using the rawMetaAsJson.exe externally. - To allow an easier access to the JSON file it needs to be flattened, this works with `flatten_json()` which takes only one argument: `json`. ``` r flat_json <- flatten_json(json = json) ``` -Since raw files include a huge amount of meta data and only several of this information is required by journals there is the need to sort out. Therefore a table linking which information is essential and where to find it in the flattened JSON is useful. Such a here refered to as 'term matching table' can be created with `term_matching_table()` by submitting two arguments. The first, `instrument_list` takes a vector with the names of the instruments represented in the JSON file. The second one, `origin_key` specifies which requirements should be met. If it stays empty, all journals are selected. While `"jpr"` stands for the requirements of the Journal of Proteome Research, `"mcp"` chooses the requirements of the Molecular and Cellular Proteomics. +Since raw files include a huge amount of meta data and only several of this information is required by journals there is the need to sort out. Therefore a table linking which information is essential and where to find it in the flattened JSON is useful. Such a here refered to as 'term matching table' can be created with `term_matching_table()` by submitting two arguments. The first, `instrument_list` takes a vector with the names of the instruments represented in the JSON file. The second one, `origin_key` specifies which requirements should be met. If it stays empty, all journals are selected. While `'jpr'` stands for the requirements of the Journal of Proteome Research, `'mcp'` chooses the requirements of the Molecular and Cellular Proteomics. ``` r term_matching_table <- create_term_match_table( - instrument_list = c("Thermo EASY-nLC", "Q Exactive - Orbitrap_MS"), - origin_key = "jpr") + instrument_list = c('Thermo EASY-nLC', 'Q Exactive - Orbitrap_MS'), + origin_key = 'jpr') ``` The names of the instruments can be shown for each group with `instrument_names()` with the json and the group number as arguments. diff --git a/data/testfile_json.rda b/data/testfile_json.rda new file mode 100644 index 0000000..f21a039 Binary files /dev/null and b/data/testfile_json.rda differ diff --git a/vignettes/using_MARMoSET.Rmd b/vignettes/using_MARMoSET.Rmd index cc5dc3c..1b32be4 100644 --- a/vignettes/using_MARMoSET.Rmd +++ b/vignettes/using_MARMoSET.Rmd @@ -39,31 +39,39 @@ The raw file format starts with meta data. It consists of more information about You can install MARMoSET from github the following way: -```{r, message=FALSE} -# install.packages("devtools") +```{r, eval=FALSE} +install.packages('remotes') -devtools::install_github("loosolab/MARMoSET", host="github.molgen.mpg.de/api/v3") - -library(MARMoSET) +remotes::install_github('loosolab/MARMoSET', host='github.molgen.mpg.de/api/v3') ``` ## Usage: -The c# command line tool can be used in R with `use_rawMetaAsJson()` to create a JSON file including only the meta data of grouped raw files. -It takes as argument `path_data`, a path to a raw file or a directory containing raw files. +The c# command line tool can be used in R with `use_rawMetaAsJson()` to create a JSON file including only the meta data of grouped raw files. It takes as argument `path_data`, a path to a raw file or a directory containing raw files. + +This JSON file can also be created by using the rawMetaAsJson.exe externally. + +Due to the design of the RawFileReader the rawMetaAsJson.exe and therefore this command is running as 64 bit code on Windows only. To use this package with another operating system, it is necessarry to already have the JSON file created. ```{r} -# representative of any raw file / directory containing raw files -data <- system.file( - file.path('extdata', 'testfile.raw'), - package = 'MARMoSET', mustWork = TRUE) +library(MARMoSET) -json <- use_rawMetaAsJson(path_data = data) +if(.Platform$OS.type == 'windows') +{ + # representative of any raw file / directory containing raw files + data <- system.file( + file.path('extdata', 'testfile.raw'), + package = 'MARMoSET', mustWork = TRUE) + + json <- use_rawMetaAsJson(path_data = data) +} else +{ + # non windows user need to read in the JSON file here + json <- MARMoSET::testfile_json +} ``` -This JSON file can also be created by using the rawMetaAsJson.exe externally. - To allow an easier access to the JSON file it needs to be flattened, this works with `flatten_json()` which takes only one argument: `json`. ```{r} @@ -71,12 +79,12 @@ flat_json <- flatten_json(json = json) ``` Since raw files include a huge amount of meta data and only several of this information is required by journals there is the need to sort out. Therefore a table linking which information is essential and where to find it in the flattened JSON is useful. Such a here refered to as 'term matching table' can be created with `term_matching_table()` by submitting two arguments. The first, `instrument_list` takes a vector with the names of the instruments represented in the JSON file. -The second one, `origin_key` specifies which requirements should be met. If it stays empty, all journals are selected. While `"jpr"` stands for the requirements of the Journal of Proteome Research, `"mcp"` chooses the requirements of the Molecular and Cellular Proteomics. +The second one, `origin_key` specifies which requirements should be met. If it stays empty, all journals are selected. While `'jpr'` stands for the requirements of the Journal of Proteome Research, `'mcp'` chooses the requirements of the Molecular and Cellular Proteomics. ```{r} term_matching_table <- create_term_match_table( - instrument_list = c("Thermo EASY-nLC", "Q Exactive - Orbitrap_MS"), - origin_key = "jpr") + instrument_list = c('Thermo EASY-nLC', 'Q Exactive - Orbitrap_MS'), + origin_key = 'jpr') ``` The names of the instruments can be shown for each group with `instrument_names()` with the json and the group number as arguments.