Skip to content

Commit

Permalink
Merge pull request #20 from jasenfinch/devel
Browse files Browse the repository at this point in the history
v1.0.6
  • Loading branch information
jasenfinch committed May 9, 2021
2 parents a03a65b + ef4bc1c commit fd87eb7
Show file tree
Hide file tree
Showing 35 changed files with 104 additions and 50 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: grover
Title: Web API Framework for Mass Spectrometry Data Transfer
Version: 1.0.5
Version: 1.0.6
Authors@R:
person(given = "Jasen",
family = "Finch",
Expand All @@ -26,8 +26,9 @@ Imports: callr,
progress,
purrr,
rawrr,
rjson,
readr,
rjson,
R.utils,
stringr,
tibble,
tictoc,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Expand Up @@ -37,6 +37,7 @@ exportMethods(sampleInfo)
exportMethods(show)
exportMethods(transferDirectory)
exportMethods(transferFile)
importFrom(R.utils,gzip)
importFrom(callr,r_bg)
importFrom(crayon,blue)
importFrom(crayon,bold)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
@@ -1,3 +1,9 @@
# grover 1.0.6

* [`grover::converFile`](https://jasenfinch.github.io/grover/reference/convert.html) creates the output directory if it doesn't already exist.

* converted files now correctly zipped by [`grover::converFile`](https://jasenfinch.github.io/grover/reference/convert.html) to ensure they are readable by the [`mzR`](https://www.bioconductor.org/packages/release/bioc/html/mzR.html) package.

# grover 1.0.5

* File conversion methods [`grover::converFile`](https://jasenfinch.github.io/grover/reference/convert.html) and [`grover::convertDirectory`](https://jasenfinch.github.io/grover/reference/convert.html) now return the file path of the converted file.
Expand Down
14 changes: 8 additions & 6 deletions R/client-conversion.R
Expand Up @@ -16,6 +16,7 @@
#' @importFrom fs dir_create file_delete
#' @importFrom progress progress_bar
#' @importFrom crayon yellow bold
#' @importFrom R.utils gzip
#' @export

setMethod('convertFile',signature = 'GroverClient',
Expand Down Expand Up @@ -44,7 +45,7 @@ setMethod('convertFile',signature = 'GroverClient',
'&args=')

if (is.null(args)) {
args <- ''
args <- ''
}

cmd <- str_c(cmd,args)
Expand All @@ -59,18 +60,19 @@ setMethod('convertFile',signature = 'GroverClient',
convertedFile <- convertedFile %>%
content(as = 'text',encoding = 'UTF-8')

if (!dir.exists(outDir)){
dir_create(outDir)
}

converted_file_path <- str_c(outDir,'/',fileName,'.mzML')

writeLines(convertedFile,converted_file_path)

if (isTRUE(zip)){
zipped_file_path <- str_c(outDir,'/',fileName,'.mzML.gz')

zip(zipped_file_path,
converted_file_path,
flags = '-q')

fs::file_delete(converted_file_path)
gzip(converted_file_path,
zipped_file_path)

converted_file_path <- zipped_file_path
}
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

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

2 changes: 1 addition & 1 deletion docs/LICENSE.html

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

12 changes: 6 additions & 6 deletions docs/articles/client-usage.html

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

12 changes: 12 additions & 0 deletions docs/articles/client-usage_files/header-attrs-2.8/header-attrs.js
@@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
12 changes: 6 additions & 6 deletions docs/articles/hosting.html

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

12 changes: 12 additions & 0 deletions docs/articles/hosting_files/header-attrs-2.8/header-attrs.js
@@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
2 changes: 1 addition & 1 deletion docs/articles/index.html

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

4 changes: 2 additions & 2 deletions docs/articles/introduction.html

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

12 changes: 12 additions & 0 deletions docs/articles/introduction_files/header-attrs-2.8/header-attrs.js
@@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
2 changes: 1 addition & 1 deletion docs/authors.html

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

2 changes: 1 addition & 1 deletion docs/index.html

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

10 changes: 9 additions & 1 deletion docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Expand Up @@ -5,5 +5,5 @@ articles:
client-usage: client-usage.html
hosting: hosting.html
introduction: introduction.html
last_built: 2021-04-26T23:30Z
last_built: 2021-05-09T11:32Z

2 changes: 1 addition & 1 deletion docs/reference/GroverClient-accessors.html

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

2 changes: 1 addition & 1 deletion docs/reference/GroverClient-class.html

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

2 changes: 1 addition & 1 deletion docs/reference/GroverHost-accessors.html

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

2 changes: 1 addition & 1 deletion docs/reference/GroverHost-class.html

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

2 changes: 1 addition & 1 deletion docs/reference/conversionArgs.html

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

2 changes: 1 addition & 1 deletion docs/reference/convert.html

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

0 comments on commit fd87eb7

Please sign in to comment.