diff --git a/.gitignore b/.gitignore index 8edfb63..8857dc3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ *.mzML *.mzXML +*.sqlite +*.parquet .Rproj.user README.Rmd diff --git a/R/grabMzxmlFunctions.R b/R/grabMzxmlFunctions.R index 7997647..083e4a8 100644 --- a/R/grabMzxmlFunctions.R +++ b/R/grabMzxmlFunctions.R @@ -638,17 +638,22 @@ grabMzxmlSpectraVoltage <- function(xml_nodes){ grabMzxmlSpectraMzInt <- function(xml_nodes, file_metadata){ all_peak_nodes <- xml2::xml_text(xml2::xml_find_all(xml_nodes, xpath = "d1:peaks")) - vals <- lapply(all_peak_nodes, function(binary){ + init_peak_encs <- xml2::xml_attr(xml2::xml_find_all(xml_nodes, xpath = "d1:peaks"), "compressionType") + all_peak_encs <- rep("none", length(init_peak_encs)) + all_peak_encs[init_peak_encs=="zlib"] <- "gzip" + all_peak_encs[init_peak_encs=="zlib compression"] <- "gzip" + + vals <- mapply(function(binary, encoding_i){ if(!nchar(binary))return(matrix(ncol = 2, nrow = 0)) decoded_binary <- base64enc::base64decode(binary) raw_binary <- as.raw(decoded_binary) - decomp_binary <- memDecompress(raw_binary, type = file_metadata$compression) + decomp_binary <- memDecompress(raw_binary, type = encoding_i) final_binary <- readBin(decomp_binary, what = "numeric", n=length(decomp_binary)/file_metadata$precision, size = file_metadata$precision, endian = file_metadata$endi_enc) matrix(final_binary, ncol = 2, byrow = TRUE) - }) + }, all_peak_nodes, all_peak_encs) } diff --git a/vignettes/figures/ssc_vignette_renders/make_time_gp.png b/vignettes/figures/ssc_vignette_renders/make_time_gp.png index 7a9317b..73dd1c4 100644 Binary files a/vignettes/figures/ssc_vignette_renders/make_time_gp.png and b/vignettes/figures/ssc_vignette_renders/make_time_gp.png differ diff --git a/vignettes/figures/ssc_vignette_renders/make_timings.rds b/vignettes/figures/ssc_vignette_renders/make_timings.rds new file mode 100644 index 0000000..d869c5c Binary files /dev/null and b/vignettes/figures/ssc_vignette_renders/make_timings.rds differ diff --git a/vignettes/figures/ssc_vignette_renders/multichrom_gp.png b/vignettes/figures/ssc_vignette_renders/multichrom_gp.png index a6d76d9..9c93508 100644 Binary files a/vignettes/figures/ssc_vignette_renders/multichrom_gp.png and b/vignettes/figures/ssc_vignette_renders/multichrom_gp.png differ diff --git a/vignettes/figures/ssc_vignette_renders/multichrom_timings.rds b/vignettes/figures/ssc_vignette_renders/multichrom_timings.rds new file mode 100644 index 0000000..0c522c5 Binary files /dev/null and b/vignettes/figures/ssc_vignette_renders/multichrom_timings.rds differ diff --git a/vignettes/figures/ssc_vignette_renders/par_time_gp.png b/vignettes/figures/ssc_vignette_renders/par_time_gp.png index 5ad6a80..bb05d7b 100644 Binary files a/vignettes/figures/ssc_vignette_renders/par_time_gp.png and b/vignettes/figures/ssc_vignette_renders/par_time_gp.png differ diff --git a/vignettes/figures/ssc_vignette_renders/par_timings.rds b/vignettes/figures/ssc_vignette_renders/par_timings.rds new file mode 100644 index 0000000..de9fbc6 Binary files /dev/null and b/vignettes/figures/ssc_vignette_renders/par_timings.rds differ diff --git a/vignettes/figures/ssc_vignette_renders/query_time_gp.png b/vignettes/figures/ssc_vignette_renders/query_time_gp.png index d5d85ad..110bc86 100644 Binary files a/vignettes/figures/ssc_vignette_renders/query_time_gp.png and b/vignettes/figures/ssc_vignette_renders/query_time_gp.png differ diff --git a/vignettes/figures/ssc_vignette_renders/query_timings.rds b/vignettes/figures/ssc_vignette_renders/query_timings.rds new file mode 100644 index 0000000..40e749b Binary files /dev/null and b/vignettes/figures/ssc_vignette_renders/query_timings.rds differ diff --git a/vignettes/figures/ssc_vignette_renders/size_cons.png b/vignettes/figures/ssc_vignette_renders/size_cons.png index e69b2a2..f4b116d 100644 Binary files a/vignettes/figures/ssc_vignette_renders/size_cons.png and b/vignettes/figures/ssc_vignette_renders/size_cons.png differ diff --git a/vignettes/figures/ssc_vignette_renders/size_list.rds b/vignettes/figures/ssc_vignette_renders/size_list.rds new file mode 100644 index 0000000..ca550b1 Binary files /dev/null and b/vignettes/figures/ssc_vignette_renders/size_list.rds differ diff --git a/vignettes/figures/ssc_vignette_renders/sum_plot.png b/vignettes/figures/ssc_vignette_renders/sum_plot.png index 089b8e1..e777f75 100644 Binary files a/vignettes/figures/ssc_vignette_renders/sum_plot.png and b/vignettes/figures/ssc_vignette_renders/sum_plot.png differ diff --git a/vignettes/speed_size_comparison.Rmd b/vignettes/speed_size_comparison.Rmd index 8c52b83..3febfdd 100644 --- a/vignettes/speed_size_comparison.Rmd +++ b/vignettes/speed_size_comparison.Rmd @@ -12,7 +12,7 @@ vignette: > --- ```{r setup, include=FALSE} -knitr::opts_chunk$set(echo = TRUE, eval=FALSE) +knitr::opts_chunk$set(echo = TRUE, eval=TRUE) options(rmarkdown.html_vignette.check_title = FALSE) data.table::setDTthreads(2) ```