Overview
This vignette demonstrates how to retrieve and classify the
peer-reviewed literature on delta smelt (Hypomesus
transpacificus) using the pubclassify R package.
The workflow has four steps:
- Search Scopus for articles that mention delta smelt in their abstract.
- Define an eight-category taxonomy and the classification prompts.
- Classify each paper using a large language model.
- Summarize the distribution of papers across categories.
Setup
Store credentials with pc_configure(). The Scopus key
and LLM key should come from environment variables; the base URL points
to an OpenAI-compatible endpoint hosted by the California Department of
Technology.
pubclassify::pc_configure(
scopus_key = Sys.getenv("SCOPUS_API_KEY"),
llm_key = Sys.getenv("PUBCLASSIFY_LLM_KEY"),
llm_base_url = "https://customeruat.sda.state.ca.gov/api/v1",
llm_provider = "openai-compatible"
)Step 1: Search Scopus
Search for peer-reviewed articles where “delta smelt” appears in the abstract. Grey literature and reports that have not been peer-reviewed (as determined by Scopus) are excluded.
pubs <- pubclassify::pc_search_scopus(
query = "delta smelt",
field = "abstract",
doc_type = "article"
)Step 2: Classification Taxonomy
Papers are classified into eight categories. Each category is defined below with the key concepts it covers, what it explicitly excludes, and signal phrases that help the LLM distinguish it from adjacent categories.
1. Life Cycle Models
Studies that develop or apply integrated models linking multiple life stages of delta smelt to environmental conditions, management actions, or population dynamics.
Includes: Stage-structured population models; Individual-based models (IBMs); Full or partial life cycle models (linking 2 or more life stages); Population viability or forecasting models; Bioenergetic models
Excludes: Models focused on a single process (e.g. only habitat or only entrainment); Purely statistical correlations without life cycle structure
Key signals: “life cycle model”, “stage-structured”, “individual-based model”, “recruitment”, “survival across life stages”, “reproduction”, “abundance index”, “population growth”, “population dynamics”, “population projection”
Tie-break: If a study models multiple life stages together, classify here – even if it includes habitat or entrainment components.
2. Entrainment
Studies focused on the transport, loss, or mortality of delta smelt due to water infrastructure or hydrodynamic processes, especially related to pumping, diversion, or flow operations.
Includes: Export facility entrainment (SWP/CVP); Fish salvage facility (SWP/CVP); Salvage-based analyses; Hydrodynamic drivers of entrainment risk; Behavioral positioning tied to entrainment vulnerability; Quantification or modeling of entrainment losses; Proportional population loss due to entrainment
Excludes: General hydrodynamics not linked to fish entrainment risk; Habitat studies where entrainment is not central; Predation discussed in the context of SWP/CVP
Key signals: “entrainment”, “salvage”, “export pumps”, “diversion”, “Old and Middle River (OMR) flow”, “loss”, “mortality due to pumping”, “Clifton Court Forebay”
Tie-break: If the study’s primary question is about risk or magnitude of entrainment or proportional population loss, classify here – even if habitat or behavior is analyzed.
3. Summer-Fall Habitat
Studies examining how habitat conditions during June-December influence delta smelt distribution, survival, or population dynamics, including evaluation of management actions that modify these conditions.
Includes: Effects of temperature, salinity, turbidity, or prey during summer-fall; X2 relationships (location in km from Golden Gate where salinity = 2 ppt); Suisun Marsh Salinity Control Gates (SMSCG); Managed wetlands affecting summer-fall habitat; Seasonal habitat suitability or occupancy models; Low salinity zone area and position
Excludes: Habitat studies focused on other seasons (e.g. spawning); General habitat studies without seasonal emphasis
Key signals: “summer”, “fall”, “June-December”, “summer-fall”, “X2”, “low salinity zone”, “Suisun Marsh”, “salinity control gates”
Tie-break: If the study is primarily about delta smelt and habitat conditions in the summer-fall period, classify here – even if modeling or monitoring tools are used.
4. General Biology
Studies describing the basic biology, ecology, or life history of delta smelt, without a primary focus on management actions, entrainment, or life cycle-integrated modeling.
Includes: Growth, reproduction, fecundity; Feeding ecology and diet; Behavior (not tied to entrainment); Physiological tolerances and distribution (temperature, salinity, etc.); Laboratory or field studies of life history traits; Life history, competitors, predators
Excludes: Studies primarily focused on management interventions; Monitoring or tool development; Life cycle models
Key signals: “growth”, “diet”, “fecundity”, “spawning”, “physiology”, “tolerance”, “laboratory experiment”, “ecology”, “life history”, “habitat suitability”
Tie-break: Use as the default when no other category is clearly dominant.
5. Monitoring Tools
Studies that develop, test, or apply methods or technologies specifically designed or validated for detecting, tracking, or estimating delta smelt or their environment, where the method itself is the primary contribution.
Includes: eDNA development and validation; Genomic monitoring tools; Tagging and telemetry methods; Survey design, detection tools, and detection probability; Novel observational or analytical techniques; Sampling gear efficiency
Excludes: Studies using standard monitoring data to answer ecological questions; Papers where the tool is secondary to a biological or management question; General-purpose statistical or bioinformatics methods that use delta smelt only as an example dataset
Key signals: “eDNA”, “genomic”, “PCR”, “assay”, “tagging”, “telemetry”, “acoustic”, “dye”, “method development”, “validation”, “detection probability”
Tie-break: Apply this binary test: ‘Would this method exist, unchanged, if delta smelt had never been used as the example dataset?’ If yes, classify as Incidental Mention. If no (the method was built for delta smelt monitoring), classify here. If the method is used to answer an ecological question, classify by that question instead.
6. Culture and Reintroduction
Studies that develop methods and best practice for raising delta smelt in captivity, including maintaining genetic diversity in a captive population, or that evaluate experimental approaches to reintroducing cultured delta smelt into their natural environment.
Includes: Cultured or captive-reared delta smelt populations; Delta smelt supplementation programs; Hatchery genetic management plans; Broodstock collection; Reintroduction, release techniques, and release enclosures; Fish Conservation and Culture Laboratory studies
Excludes: Salmon hatchery or salmon broodstock studies
Key signals: “captive”, “hatchery”, “broodstock”, “reintroduction”, “supplementation”, “Fish Conservation and Culture Laboratory”, “release enclosure”
7. Social Science
Studies that examine delta smelt conservation, management, or water policy through a social science lens, including economic analyses, governance and institutional studies, policy evaluation, stakeholder engagement, and the human dimensions of resource management decisions affecting delta smelt.
Includes: Water policy and regulatory analysis related to delta smelt (ESA listings, biological opinions, water allocation decisions); Economic valuation of delta smelt conservation or water management decisions; Cost-benefit analyses of management actions (water exports, flow restrictions, habitat restoration); Stakeholder conflict, negotiation, and collaborative governance of the Sacramento-San Joaquin Delta; Environmental law and litigation related to delta smelt; Public perception, attitudes, and values related to delta smelt or Delta water management; Environmental justice and equity in Delta water governance; Historical and political analysis of delta smelt conservation
Excludes: Biological studies that mention policy implications without analyzing them; Technical hydrological or biological assessments used to inform policy (classify by the biological category); Water operations studies focused on physical outcomes rather than governance or human dimensions
Key signals: “water policy”, “water management”, “water allocation”, “Endangered Species Act”, “ESA”, “biological opinion”, “BiOp”, “stakeholder”, “governance”, “regulatory”, “compliance”, “economic”, “socioeconomic”, “cost-benefit”, “valuation”, “litigation”, “court”, “legal”, “public perception”, “attitudes”, “survey respondents”
Tie-break: If the primary research question concerns human decisions, institutions, values, or economic trade-offs related to delta smelt or Delta water management, classify here – even if biological data are referenced.
8. Incidental Mention
Publications where delta smelt appears in the abstract but is not a primary subject of study. For example, the abstract lists delta smelt alongside many other species, references it as ecological background, or names it incidentally without describing delta smelt-focused methods or findings.
Includes: Multi-species surveys where delta smelt is one of many listed species; Papers citing delta smelt only as context or background; General-purpose statistical or computational tools where delta smelt data is used only to illustrate the method (e.g., software for estimating effective population size, demographic inference tools, or population genetics methods applied to delta smelt as a convenient dataset)
Excludes: Any paper with smelt-focused methods, analyses, or findings
Key signals: Delta smelt listed among many species without dedicated analysis, Smelt mentioned only in introduction or discussion as context, Delta smelt used as an example or case study dataset for a broadly applicable method (apply the binary test: would this method exist unchanged without delta smelt data?), General population genetics or statistical software illustrated with delta smelt data
Step 3: Classification Prompts
Classification is guided by two prompts passed to
pc_classify().
System Prompt
The system prompt defines the model’s role and is sent with every batch call. It establishes that classification should be based on the central scientific objective of a study, not on the data type or methods used.
You are a scientific literature classifier specializing in aquatic ecology. You will be given a list of published peer-reviewed manuscripts with titles and abstracts, plus a taxonomy of research categories. Assign each manuscript to one primary category based on the central research objective (i.e., what the study is primarily trying to understand or estimate), not just the data, methods, or variables used. If multiple categories apply equally, use the priority rules provided to select the best-fitting primary category.
Classification Instructions
The classification instructions are injected alongside the taxonomy in each batch call. They provide domain-specific priority rules for resolving cases where a paper could plausibly belong to more than one category.
When multiple categories apply, use this priority order:
1. Life Cycle Models – if multi-stage population modeling is central
2. Entrainment – if infrastructure-related loss or risk is central
3. Summer-Fall Habitat – if summer and/or fall habitat (June–December) is central
4. Monitoring Tools – if method development is central
5. Culture and Reintroduction – if captive rearing and reintroduction is central
6. Social Science – if policy, economics, governance, or human dimensions is central
7. General Biology – fallback/default
8. Incidental Mention – if delta smelt is not the primary focus
When uncertain, prefer the category that best answers: “What is the main question this paper is trying to answer?”
Do not classify based solely on data type (e.g. eDNA, survey data) or methods used (e.g. modeling, statistics). Classify based on the scientific objective.
Step 4: Classify
Each paper’s title and abstract are sent to the LLM in batches of 10. The model assigns one category and a one-sentence rationale per paper. Results are saved to disk so they can be reloaded without re-running the API calls.
classified <- pubclassify::pc_classify(
pubs = pubs,
taxonomy = taxonomy,
provider = "openai-compatible",
model = "Anthropic Claude Sonnet 4.5",
system_prompt = system_prompt,
classify_instructions = classify_instructions
)Results
The search returned 227 peer-reviewed articles. After classification, the distribution across substantive research categories is:
classified |>
dplyr::filter_out(pc_field == "Incidental Mention") |>
dplyr::count(Category = pc_field, name = "Papers") |>
dplyr::arrange(dplyr::desc(Papers)) |>
knitr::kable(
booktabs = TRUE,
linesep = "",
caption = "Distribution of delta smelt literature by research category."
)| Category | Papers |
|---|---|
| General Biology | 101 |
| Culture and Reintroduction | 37 |
| Monitoring Tools | 30 |
| Summer-Fall Habitat | 23 |
| Entrainment | 14 |
| Life Cycle Models | 13 |
| Social Science | 9 |
An additional 0 articles were classified as Incidental Mention, meaning delta smelt appeared in the abstract but was not the primary subject of study.
2008 Biological Opinion
In 2008, a Biological Opinion concluded that Central Valley Project and State Water Project operations jeopardized the endangered delta smelt, risking its extinction. This motivated a rapid increase in research on delta smelt, as evidenced by the marked growth in the number of peer-reviewed publications after 2008.

Cumulative delta smelt publications by research category.