Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Feb 20, 2024
1 parent e70e895 commit 0a1b878
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
4 changes: 2 additions & 2 deletions MIR/art-from-MIR-spectral-DB.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions MIR/build-compact-spectral-library.R
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions MIR/eval-errors.R
Original file line number Diff line number Diff line change
@@ -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

11 changes: 7 additions & 4 deletions MIR/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 0a1b878

Please sign in to comment.