How crisprverse/crisprdesign works
Purpose and Entry Points
crisprDesign is a Bioconductor R package for designing and annotating CRISPR guide RNAs across DNA- and RNA-targeting modalities: knockout, activation/interference, base editing, knockdown, paired guides, and optical pooled screening. Public workflows start with findSpacers() or findSpacerPairs(), then enrich and rank returned guide objects. Package exports and S4 generics are organized in R/AllGenerics.R; core APIs reside under R/.
Core Domain Model
GuideSet is the central mutable analysis artifact: an S4 genomic-range-derived guide collection containing protospacer/PAM coordinates, spacer sequence, nuclease metadata, and progressively added annotations. PairedGuideSet represents paired GuideSet entries plus pair-level geometry.
• R/GuideSet-class.R
• R/PairedGuideSet-class.R
• R/GuideSet2DataFrames.R
Target Preparation and Candidate Discovery
Targets enter as genomic GRanges plus a reference genome, or as custom DNA/RNA sequences. Transcript databases can be transformed and queried into target regions. findSpacers() enumerates nuclease-compatible protospacer/PAM candidates; completeSpacers() supports completion/extension flows. This boundary separates reference sequence and nuclease definitions (provided by crisprBase) from package-owned guide objects.
• R/findSpacers.R
• R/TxDb2GRangesList.R
• R/queryTxObject.R
Alignment and Specificity Pipeline
Candidate guides can be aligned to genomic, transcriptomic, or custom-sequence targets. Alignment results are retained as per-guide GRangesList data and summarized as mismatch/context counts. addSpacerAlignments() dispatches to external Bowtie/BWA integrations or Biostrings matching; repeat annotation can remove or flag low-specificity candidates. Off-target scores consume these stored alignments, making alignment a required upstream stage.
• R/addSpacerAlignments.R
• R/addOffTargetScores.R
• R/addRepeats.R
Annotation and Scoring Enrichment
The pipeline decorates a GuideSet rather than producing separate tables. Sequence features, PAM quality, restriction sites, gene/isoform context, TSS distance, repeats, SNPs, conservation, and other genomic attributes become metadata columns. On-target scoring delegates prediction algorithms to crisprScore; composite and specificity-proxy stages combine annotations for selection.
• R/addSequenceFeatures.R
• R/addGeneAnnotation.R
• R/addOnTargetScores.R
Modality-Specific Branches
Base-editing workflows calculate editing sites and combinatorial predicted alleles against transcript-derived nucleotide/amino-acid tables. RNA targeting obtains mRNA sequences and uses transcript-level alignment semantics. Paired-guide design forms candidate guide pairs and records PAM orientation, distance, and cut length.
• R/addEditedAlleles.R
• R/getMrnaSequence.R
• R/findSpacerPairs.R
Selection and Library Outputs
Users may directly subset enriched GuideSet objects, while rankSpacers() applies recommended nuclease-aware prioritization. OPS-related functionality is represented in the published interface and supporting utilities/examples, providing barcode-distance and library-design workflows adjacent to core guide selection.
• R/rankSpacers.R
• R/removeMultiGeneTargeting.R
• inst/examples/ops.R
Runtime and External Boundaries
Runtime is R/Bioconductor using S4 genomic data structures (GenomicRanges, Biostrings, BSgenome, transcript/VCF ecosystems). crisprBase supplies CrisprNuclease/BaseEditor specifications; crisprBowtie and crisprBwa connect to indexed external aligners, while crisprScore provides scoring models. Inputs include BSgenome/custom sequences, TxDb-like annotations, Bowtie/BWA indexes, repeat ranges, and VCFs; bundled examples include FASTA and indexed VCF fixtures.
• inst/fasta/chr12.fa
• inst/extdata/common_snps_dbsnp151_example.vcf.gz
• DESCRIPTION
Main entry points: GuideSet-class.R GuideSet · findSpacers.R Spacer discovery · addSpacerAlignments.R Spacer alignments · rankSpacers.R Guide ranking
Components 19
Targeting & Discovery
- Public APIs & S4 generics · Exports organize the guide-design workflows.
R/AllGenerics.R - Target region preparation · Converts and queries transcript annotations into target regions.
R/TxDb2GRangesList.R - GuideSet · Mutable genomic-range guide artifact with accumulated annotations.
R/GuideSet-class.R - Spacer discovery · Enumerates or completes nuclease-compatible protospacer/PAM candidates.
R/findSpacers.R
Annotation & Specificity
- Spacer alignments · Stores per-guide GRangesList hits and mismatch/context summaries.
R/addSpacerAlignments.R - Repeats & off-target scores · Flags repetitive targeting and scores stored off-target alignments.
R/addOffTargetScores.R - Sequence & gene annotation · Adds sequence, PAM, genomic, gene, isoform, and TSS features.
R/addGeneAnnotation.R - On-target scoring · Delegates guide activity prediction to crisprScore.
R/addOnTargetScores.R
Specialized Design
- PairedGuideSet · Stores paired guides and pair-level geometry.
R/PairedGuideSet-class.R - Paired-guide design · Forms pairs with PAM orientation, distance, and cut length.
R/findSpacerPairs.R - Base-edit allele prediction · Calculates editing sites and predicted transcript alleles.
R/addEditedAlleles.R - mRNA sequence retrieval · Obtains transcript sequences for RNA-targeting semantics.
R/getMrnaSequence.R
Selection & Library
- Guide ranking · Applies nuclease-aware prioritization to enriched guides.
R/rankSpacers.R - Selected GuideSet · Users can subset or filter guides for downstream use.
R/removeMultiGeneTargeting.R - OPS library design · Provides barcode-distance and optical pooled screening utilities.
inst/examples/ops.R
Runtime Boundaries
- Genome, sequences & annotations
- crisprBase specifications · Provides nuclease and base-editor definitions.
- Bowtie/BWA & Biostrings · External indexed aligners or in-process sequence matching.
- crisprScore models
Connections 24
- Public APIs & S4 generics → Spacer discovery: starts
- Public APIs & S4 generics → Paired-guide design: starts
- Genome, sequences & annotations → Target region preparation: annotations
- Genome, sequences & annotations → Spacer discovery: reference sequences
- crisprBase specifications → Spacer discovery: PAM/editing rules
- Target region preparation → Spacer discovery: target regions
- Spacer discovery → GuideSet: candidate guides
- GuideSet → Paired-guide design: pair candidates
- Paired-guide design → PairedGuideSet: guide pairs
- GuideSet → Spacer alignments: guides
- Genome, sequences & annotations → Bowtie/BWA & Biostrings: indexes/custom targets
- Bowtie/BWA & Biostrings → Spacer alignments: alignment hits
- Spacer alignments → Repeats & off-target scores: stored off-targets
- GuideSet → Sequence & gene annotation: decorate
- GuideSet → On-target scoring: sequence features
- crisprScore models → On-target scoring: prediction models
- Sequence & gene annotation → Guide ranking: context features
- Repeats & off-target scores → Guide ranking: specificity metrics
- On-target scoring → Guide ranking: activity scores
- Guide ranking → Selected GuideSet: prioritized guides
- GuideSet → Base-edit allele prediction: base-editor guides
- Genome, sequences & annotations → mRNA sequence retrieval: transcript annotations
- mRNA sequence retrieval → Spacer alignments: RNA targets
- Selected GuideSet → OPS library design: library candidates