run_gwas2crispr: Run the GWAS-to-CRISPR export pipeline using GRCh38/hg38

View source: R/run_gwas2crispr.R

run_gwas2crisprR Documentation

Run the GWAS-to-CRISPR export pipeline using GRCh38/hg38

Description

Runs the complete computational preparation workflow: retrieves GWAS Catalog associations for a supported trait identifier through fetch_gwas, prepares SNP metadata, creates BED intervals, and optionally writes CSV, BED, and FASTA files for downstream CRISPR guide-design preparation.

Usage

run_gwas2crispr(
  efo_id,
  p_cut = 5e-08,
  flank_bp = 200,
  out_prefix = NULL,
  genome_pkg = "BSgenome.Hsapiens.UCSC.hg38",
  verbose = interactive()
)

Arguments

efo_id

character. GWAS Catalog trait identifier. The argument name is retained for backward compatibility. Examples include EFO_0001663, MONDO_0007254, and NCIT_C4872 when supported by the GWAS Catalog API.

p_cut

numeric. P-value threshold for significance.

flank_bp

integer. Number of flanking bases for FASTA sequence extraction.

out_prefix

character or NULL. Prefix for output files. If NULL, no files are written.

genome_pkg

character. BSgenome package name used for hg38 FASTA extraction.

verbose

logical. If TRUE, prints a compact progress line.

Details

Only GRCh38/hg38 is supported. CSV and BED outputs can be produced without genome packages. FASTA output is generated only when BSgenome.Hsapiens.UCSC.hg38 and Biostrings are installed. If FASTA dependencies are unavailable, the function still writes CSV and BED. Selected supported disease and cancer trait identifier prefixes include EFO, MONDO, and NCIT. HP, Orphanet, and ORPHA are accepted for compatibility. GO identifiers are not supported as primary GWAS Catalog trait identifiers in gwas2crispr 0.1.5.

Value

Invisibly returns a list with:

  • summary: one-row tibble with basic counts.

  • chr_freq: chromosome frequency table.

  • snps_full: harmonized SNP metadata.

  • bed: BED-style interval table.

  • fasta: DNAStringSet if FASTA was generated; otherwise NULL.

  • written: character vector of written file paths.

See Also

fetch_gwas

Examples


  res <- run_gwas2crispr(
    efo_id     = "EFO_0000707",
    p_cut      = 1e-6,
    flank_bp   = 300,
    out_prefix = file.path(tempdir(), "lung"),
    verbose    = FALSE
  )
  res$summary
  res$written



gwas2crispr documentation built on June 2, 2026, 9:06 a.m.