run_gwas2crispr: Run the GWAS to CRISPR export pipeline (hg38)

View source: R/run_gwas2crispr.R

run_gwas2crisprR Documentation

Run the GWAS to CRISPR export pipeline (hg38)

Description

End-to-end pipeline: fetch significant associations, annotate, and optionally write CSV/BED/FASTA outputs. By default no files are written; set out_prefix to write results.

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. Experimental Factor Ontology (EFO) identifier, e.g., "EFO_0001663".

p_cut

numeric. P-value threshold for significance (default 5e-8).

flank_bp

integer. Flanking bases for FASTA sequences (default 200).

out_prefix

character or NULL. File prefix (including path) for outputs. If NULL (default), nothing is written to disk and a result object is returned. To write files safely in examples/tests, use file.path(tempdir(), "prefix").

genome_pkg

character. BSgenome package to use for FASTA (default "BSgenome.Hsapiens.UCSC.hg38"); FASTA step is skipped if not installed.

verbose

logical. If TRUE, emit progress via message().

Details

Network I/O may occur when fetching data. Only GRCh38/hg38 is supported.

Value

(Invisibly) a list with elements:

  • summary: tibble with basic counts.

  • snps_full: tibble of SNP metadata.

  • bed: tibble of BED intervals (if computed).

  • fasta: Biostrings::DNAStringSet (if computed).

  • written: character vector of file paths written (possibly empty).

See Also

fetch_gwas

Examples


  # Write into a temporary directory so we don't touch the user's filespace:
  tmp <- tempdir()
  res <- run_gwas2crispr(
    efo_id     = "EFO_0001663",
    p_cut      = 5e-8,
    flank_bp   = 200,
    out_prefix = file.path(tmp, "prostate"),
    verbose    = FALSE
  )

  # If you omit 'out_prefix', nothing is written; an object is returned:
  res2 <- run_gwas2crispr(
    efo_id     = "EFO_0001663",
    p_cut      = 5e-8,
    flank_bp   = 200,
    out_prefix = NULL,
    verbose    = FALSE
  )



gwas2crispr documentation built on Aug. 23, 2025, 1:12 a.m.