--- title: "Question-Driven Reviews" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Question-Driven Reviews} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} resource_files: - figures/logo.svg - figures/logo-dark.svg --- [![R-CMD-check](https://github.com/CTTIR/scimapR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CTTIR/scimapR/actions/workflows/R-CMD-check.yaml) [![pkgdown](https://github.com/CTTIR/scimapR/actions/workflows/pkgdown.yaml/badge.svg)](https://cttir.github.io/scimapR/) [![CRAN status](https://www.r-pkg.org/badges/version/scimapR)](https://CRAN.R-project.org/package=scimapR) [![Codecov test coverage](https://codecov.io/gh/CTTIR/scimapR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/CTTIR/scimapR?branch=main) [![CRAN downloads](https://cranlogs.r-pkg.org/badges/scimapR)](https://cran.r-project.org/package=scimapR) [![CRAN downloads total](https://cranlogs.r-pkg.org/badges/grand-total/scimapR)](https://cran.r-project.org/package=scimapR) [![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ## Research questions as objects scimapR treats research questions as structured objects, not just query strings. ```{r setup} library(scimapR) ``` ```{r question} rq <- sm_question( text = "Does spatial transcriptomics improve outcome prediction in colorectal cancer?", framework = "PICO", population = "colorectal cancer patients", intervention = "spatial transcriptomics", outcome = "survival or recurrence" ) print(rq) ``` ## Building a corpus from a question ```r # In production, this hits APIs: corpus <- sm_corpus_for_question(rq, sources = c("pubmed", "openalex")) ``` For this vignette, we use the synthetic example corpus: ```{r synthetic} corpus <- sm_example_corpus(with_screening = TRUE, seed = 42) ``` ## Screening ### Regex-based (deterministic) ```{r regex} screened <- sm_screen_regex( corpus, include_terms = c("transcriptom", "spatial"), exclude_terms = c("mouse", "drosophila") ) nrow(screened$works) ``` ### LLM-grounded screening ```r # Requires ellmer package and an API key screened <- sm_screen_against_question( corpus, rq, llm = ellmer::chat_anthropic(), stages = "title-abstract" ) ``` ### Screening summary ```{r summary} sm_screen_summary(corpus) ``` ## PRISMA flow ```{r prisma, fig.width = 6, fig.height = 4} prisma <- sm_screen_prisma(corpus) prisma$counts prisma$plot ``` ## Export for Rayyan/Covidence ```r sm_export_rayyan(corpus, "my_corpus.ris") sm_export_covidence(corpus, "my_corpus_covidence.ris") ```