| Title: | Busta Lab Tools Built on 'phylochemistry' |
|---|---|
| Description: | Lab tools for the Busta lab: the full-featured GC-MS / GC-TCD peak integration app, a GenomeScope genome-size estimator, a client for the lab's 'dgx' language-model servers, and cached download helpers for lab reference datasets. Attaching this package also attaches 'phylochemistry'. |
| Authors: | Lucas Busta [aut, cre] |
| Maintainer: | Lucas Busta <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-11-23 18:26:07 UTC |
| Source: | https://github.com/thebustalab/phylochemistry |
These versions have been retired. Each one stops with a message pointing at
analyzeGCMSdata7(), the current app.
analyzeGCMSdata2(...) analyzeGCMSdata3(...) analyzeGCMSdata4(...) analyzeGCMSdata5(...) analyzeGCMSdata6(...)analyzeGCMSdata2(...) analyzeGCMSdata3(...) analyzeGCMSdata4(...) analyzeGCMSdata5(...) analyzeGCMSdata6(...)
... |
Ignored. |
Nothing; always signals an error.
try(analyzeGCMSdata6("/path/to/your/CDF/folder"))try(analyzeGCMSdata6("/path/to/your/CDF/folder"))
Opens a folder of ANDI-MS or ANDI-Chrom .CDF files, builds the
chromatograms, and serves a Shiny app for baseline correction, peak
detection and integration, all-ion views, co-elution splits and peak
labelling. The app sets the working directory to CDF_directory_path
and writes its state there (<file>.CDF.csv, chromatograms.csv,
samples_monolist.csv, peaks_monolist.csv, caches and stamps).
analyzeGCMSdata7( CDF_directory_path = getwd(), zoom_and_scroll_rate = 100, baseline_window = 400, samples_per_page = 20, compact = FALSE, x_axis_start_default = NULL, x_axis_end_default = NULL, path_to_reference_library = busta_spectral_library, samples_monolist_subset = NULL, ions = 0, all_ion_view = FALSE, all_ion_threshold = 0.02, all_ion_scaling = "sqrt", all_ion_max_points = 1200, integrate_peak_ions = TRUE, score_peak_confidence = TRUE, confidence_thresholds = c(0.75, 0.9), coelution_crosstalk = c(0, 0), facet_label_size = 12, facet_label_wrap = 14, n_cores = NULL, ms_classifier_path = "/project_data/shared/mass_spectral_library/ms_classifier.py", jupyter = FALSE )analyzeGCMSdata7( CDF_directory_path = getwd(), zoom_and_scroll_rate = 100, baseline_window = 400, samples_per_page = 20, compact = FALSE, x_axis_start_default = NULL, x_axis_end_default = NULL, path_to_reference_library = busta_spectral_library, samples_monolist_subset = NULL, ions = 0, all_ion_view = FALSE, all_ion_threshold = 0.02, all_ion_scaling = "sqrt", all_ion_max_points = 1200, integrate_peak_ions = TRUE, score_peak_confidence = TRUE, confidence_thresholds = c(0.75, 0.9), coelution_crosstalk = c(0, 0), facet_label_size = 12, facet_label_wrap = 14, n_cores = NULL, ms_classifier_path = "/project_data/shared/mass_spectral_library/ms_classifier.py", jupyter = FALSE )
CDF_directory_path |
Folder holding the |
zoom_and_scroll_rate |
Ignored; kept so old calls still run. |
baseline_window |
Baseline window, in scans, for new samples. |
samples_per_page |
Samples drawn per page. |
compact |
Ignored (Overview mode was removed); kept so old calls still run. |
x_axis_start_default, x_axis_end_default
|
Initial x window (retention time). |
path_to_reference_library |
Unused; kept so old calls still run. |
samples_monolist_subset |
Optional subset of samples to load. |
ions |
Extra ions to extract; the TIC (ion 0) is always extracted. |
all_ion_view |
Start in the all-ion display. |
all_ion_threshold |
Ion-inclusion threshold for the all-ion views. |
all_ion_scaling |
Initial y scaling for the all-ion views. |
all_ion_max_points |
Maximum x points drawn per trace in the all-ion views. |
integrate_peak_ions |
Compute |
score_peak_confidence |
Compute spectrum-agreement confidence squares. |
confidence_thresholds |
Agreement thresholds for the confidence squares. |
coelution_crosstalk |
Supplied cross-talk for two-compound co-elution splits. |
facet_label_size, facet_label_wrap
|
Sample-name strip size and wrap width. |
n_cores |
Cores for parallel prefetch ( |
ms_classifier_path |
Path to the Python peak classifier used by Shift+4;
|
jupyter |
If |
With jupyter = FALSE, a shiny.appobj; otherwise the app is run.
Sends one prompt to the dgx generate endpoint (an SSH tunnel on the lab's
JupyterHub) and returns the parsed JSON reply. If the server answers 503
"memory_admission" the call waits and retries for up to max_wait_sec.
dgxGenerate( prompt, model = NULL, quant = NULL, max_tokens = 256, system = NULL, logprobs = NULL, server_url = Sys.getenv("DGX_GENERATE_URL", "http://127.0.0.1:9002"), timeout_sec = 900, max_wait_sec = as.numeric(Sys.getenv("DGX_MEMORY_WAIT_SEC", 4 * 3600)), on_wait = NULL )dgxGenerate( prompt, model = NULL, quant = NULL, max_tokens = 256, system = NULL, logprobs = NULL, server_url = Sys.getenv("DGX_GENERATE_URL", "http://127.0.0.1:9002"), timeout_sec = 900, max_wait_sec = as.numeric(Sys.getenv("DGX_MEMORY_WAIT_SEC", 4 * 3600)), on_wait = NULL )
prompt |
Prompt text. |
model |
Model id, e.g. "google/gemma-4-12B-it"; |
quant |
Quantisation: 4 = nf4, 8 = int8, 16 = bf16. |
max_tokens |
Maximum tokens to generate. |
system |
Optional system prompt. |
logprobs |
Optional 1-3: return token log-probabilities (needs |
server_url |
Base URL of the generate server (env |
timeout_sec |
Request timeout in seconds; a cold model load takes about 180 s. |
max_wait_sec |
Longest total wait for memory admission, in seconds; 0 fails at once. |
on_wait |
Internal: a function called before and after each memory wait. |
A list parsed from the server's JSON reply (completion, duration_sec, ...).
Report whether the dgx generate server is reachable and busy
dgxGridStatus()dgxGridStatus()
NULL, invisibly; the status is printed as a message.
Check the dgx endpoints (generate, ESM2, ESMC)
dgxHealth()dgxHealth()
NULL, invisibly; one status line per endpoint is printed as a message.
Largest grid runModelGrid() will start
dgxMaxGridCells()dgxMaxGridCells()
The cell limit (env DGX_MAX_GRID_CELLS, default 5000).
A port of GenomeScope 2.0: fits the k-mer spectrum with a negative-binomial
mixture model by nonlinear least squares (minpack.lm::nlsLM()) and writes
the summary, model and progress files into output_dir.
genomeScope(input_histogram_file, output_dir, ploidy, kmer_length)genomeScope(input_histogram_file, output_dir, ploidy, kmer_length)
input_histogram_file |
Path to a two-column k-mer histogram (coverage, count), whitespace separated, no header. |
output_dir |
Output directory (created if needed). |
ploidy |
Ploidy of the model, 1 to 6. |
kmer_length |
k-mer length used to build the histogram. |
Called for its side effects (files in output_dir).
Fetches one of the lab's reference datasets from the lab website on first use,
caches the file under tools::R_user_dir("bustalab", "cache") and reads it with
the same reader and column types the old bustalab <- TRUE loader used.
getLabDataset( name, refresh = FALSE, cache_dir = tools::R_user_dir("bustalab", "cache") )getLabDataset( name, refresh = FALSE, cache_dir = tools::R_user_dir("bustalab", "cache") )
name |
Dataset name; omit it to list the available names. |
refresh |
If |
cache_dir |
Where cached files are kept. |
"busta_spectral_library": the lab mass-spectral library (CSV, about 40 MB).
"plant_phylogeny": a plant phylogeny (ape::read.tree() of a Newick file).
"plant_species": the plant species table (CSV).
The dataset (a tibble, or a phylo tree for "plant_phylogeny"); with
name missing, a character vector of dataset names.
getLabDataset() ## Not run: busta_spectral_library <- getLabDataset("busta_spectral_library") ## End(Not run)getLabDataset() ## Not run: busta_spectral_library <- getLabDataset("busta_spectral_library") ## End(Not run)
Batched by cell, resumable (re-running skips rows that succeeded and retries
failed ones) and refuses to start against an unreachable server or a grid
larger than dgxMaxGridCells() unless force = TRUE.
runModelGrid( prompts, models = c("google/gemma-4-E2B-it", "google/gemma-4-E4B-it", "google/gemma-4-12B-it", "google/gemma-4-26B-A4B-it", "google/gemma-4-31B-it"), quants = c(4), out_csv = "grid_results.csv", max_tokens = 16, system = NULL, labels = NULL, verbose = TRUE, force = FALSE, max_consecutive_errors = as.numeric(Sys.getenv("DGX_MAX_CONSECUTIVE_ERRORS", "10")), logprobs = NULL )runModelGrid( prompts, models = c("google/gemma-4-E2B-it", "google/gemma-4-E4B-it", "google/gemma-4-12B-it", "google/gemma-4-26B-A4B-it", "google/gemma-4-31B-it"), quants = c(4), out_csv = "grid_results.csv", max_tokens = 16, system = NULL, labels = NULL, verbose = TRUE, force = FALSE, max_consecutive_errors = as.numeric(Sys.getenv("DGX_MAX_CONSECUTIVE_ERRORS", "10")), logprobs = NULL )
prompts |
Character vector of prompts. |
models |
Model ids. |
quants |
Quantisations (4, 8, 16). |
out_csv |
Results CSV, appended after every prompt. |
max_tokens |
Maximum tokens per generation. |
system |
Optional system prompt. |
labels |
Prompt ids; defaults to |
verbose |
Print progress. |
force |
Start even if the pre-flight check fails. |
max_consecutive_errors |
Stop after this many failures in a row. |
logprobs |
Optional 1-3, as in |
out_csv, invisibly.