From 0a1b8781978926a9a3a8edcaa91dfcfa774bef40 Mon Sep 17 00:00:00 2001 From: Beaudette Date: Tue, 20 Feb 2024 09:00:13 -0800 Subject: [PATCH] updates --- MIR/art-from-MIR-spectral-DB.R | 4 ++-- MIR/build-compact-spectral-library.R | 6 +++--- MIR/eval-errors.R | 14 ++++++++++++++ MIR/main.R | 11 +++++++---- 4 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 MIR/eval-errors.R diff --git a/MIR/art-from-MIR-spectral-DB.R b/MIR/art-from-MIR-spectral-DB.R index 286ee78..9d3fa73 100644 --- a/MIR/art-from-MIR-spectral-DB.R +++ b/MIR/art-from-MIR-spectral-DB.R @@ -41,13 +41,13 @@ parseSpectra <- function(.txt, compressed = TRUE) { base.path <- 'E:/MIR' # compressed spectra -# db.file <- file.path(base.path, 'MIR-compact-gz.sqlite') +db.file <- file.path(base.path, 'MIR-compact-compressed.sqlite') # plain-text spectra # db.file <- file.path(base.path, 'MIR-compact-text.sqlite') # full -db.file <- file.path(base.path, 'MIR-compact.sqlite') +# db.file <- file.path(base.path, 'MIR-compact.sqlite') db <- dbConnect(RSQLite::SQLite(), db.file) diff --git a/MIR/build-compact-spectral-library.R b/MIR/build-compact-spectral-library.R index 4267e0e..37d9c4c 100644 --- a/MIR/build-compact-spectral-library.R +++ b/MIR/build-compact-spectral-library.R @@ -17,7 +17,7 @@ library(purrr) ## flag for embedding compressed spectra # useful for stand-alone SQLite versions, not for SDA # requires a little more work when reading data out of the SQLite DB -compressSpec <- TRUE +compressSpec <- FALSE # functions waiting for an R package source('../code/snapshot-preparation/snapshot-functions.R') @@ -169,8 +169,8 @@ dbDisconnect(db) ## SQLite file stats -# uncompressed / txt: 9.5GB -# gzipped / txt: 4.2GB +# uncompressed / txt: 5.5GB +# gzipped / txt: GB # uncompressed / gz(txt): 2.6GB # gzipped / gz(txt): GB diff --git a/MIR/eval-errors.R b/MIR/eval-errors.R new file mode 100644 index 0000000..43ecc61 --- /dev/null +++ b/MIR/eval-errors.R @@ -0,0 +1,14 @@ +library(opusreader2) +library(purrr) + +# all collections +x <- readRDS('errors.rds') + +# find just the collections with errors +idx <- which(! sapply(x, is.null)) +x <- x[idx] + + +## 2024-02-14 errors: +## C2019USNJ085 + diff --git a/MIR/main.R b/MIR/main.R index b49f2ab..f8c4d91 100644 --- a/MIR/main.R +++ b/MIR/main.R @@ -10,6 +10,9 @@ setwd('MIR') # save to temporary folder for later use source('pre-process-collections.R') +# evaluate errors +# eval-errors.R + # create collection/sample/integer wn-sequence table # create wn-sequence metadata table # flag samples with odd wn-sequence @@ -20,8 +23,8 @@ source('build-compact-spectral-library.R') ## TODO: -## 1. create spectra -- sample LUT -## 2. index -## 3. simplify code if possible -## 4. wrapper / helper functions +# 1. create spectra -- sample LUT +# 2. index +# 3. simplify code if possible +# 4. wrapper / helper functions