glysmith leverages
the power of Large Language Models (LLMs) to make glyco-omics analysis
more intuitive and efficient. From generating complex analytical
pipelines to crafting comprehensive reports, AI integration allows you
to focus on the science while it handles the boilerplate.
To enable AI features, configure an API key for the LLM provider you want to use. DeepSeek is the default provider, and you can obtain a key from the DeepSeek Platform.
Once you have your key, set it as an environment variable in your R session:
You can also use other providers supported by ellmer.
For example, OpenAI can be used by setting OPENAI_API_KEY
and passing provider = "openai":
Sys.setenv(OPENAI_API_KEY = "your_api_key")
bp <- inquire_blueprint(
"I want to perform DEA and visualize the results.",
exp = your_exp,
provider = "openai",
model = "gpt-4.1"
)If you prefer to configure the provider once per R session, use package-level options:
options(
glysmith.ai_provider = "openai",
glysmith.ai_model = "gpt-4.1"
)
bp <- inquire_blueprint(
"I want to perform DEA and visualize the results.",
exp = your_exp
)For OpenAI-compatible endpoints, set OPENAI_API_KEY and
pass both provider = "openai_compatible" and
base_url. The corresponding options are
glysmith.ai_provider, glysmith.ai_model,
glysmith.ai_api_key, and
glysmith.ai_base_url.
Note: This environment variable is session-specific. You will
need to set it again in new R sessions, or add it to your
.Renviron file for a permanent setup.
inquire_blueprint()Instead of manually browsing and selecting various
step_xxx functions and manage the parameters, you can
describe your analysis goals in plain English (or your language).
inquire_blueprint() will translate your requirements into a
structured analytical blueprint.
# Describe your goals in natural language
bp <- inquire_blueprint("I want to perform DEA and visualize the results.", exp = your_exp)
print(bp)By providing the experiment object (exp), the LLM can
understand your data structure and experimental design, ensuring the
generated blueprint is tailored to your specific dataset. The function
also prints a brief rationale for the chosen steps to the console.
After you answering all the questions, a blueprint is returned as
bp. You can then pass it to
forge_analysis():
If the initial blueprint needs adjustment, you can use
modify_blueprint() to refine it iteratively without
starting from scratch.
While polish_report() uses robust default rules, setting
use_ai = TRUE unlocks advanced AI capabilities for report
generation:
To use a non-default provider for reporting, pass the
ai_ configuration arguments:
In AI mode, the LLM performs several high-level tasks:
The entire pipeline, from raw data to a finished report, can be simplified into a few intelligent steps:
# 1. Generate an analysis plan
bp <- inquire_blueprint("Perform DEA and visualize key findings.", exp = your_exp)
# 2. Execute the analysis
res <- forge_analysis(your_exp, bp)
# 3. Export data and intermediate results
quench_result(res, "analysis_output/")
# 4. Generate an AI-enhanced report
polish_report(res, "report.html", use_ai = TRUE)