CRISPResso2

repository·master·Indexed 43 days ago

https://github.com/pinellolab/crispresso2

A bioinformatics pipeline for the analysis of genome editing outcomes from deep sequencing data. Version 2.3.4 provides tools for aligning sequencing reads to a reference and quantifying insertions, deletions, and mutations. The suite includes specialized tools such as CRISPRessoBatch, CRISPRessoPooled, CRISPRessoWGS, CRISPRessoCompare, CRISPRessoPooledWGCompare, and CRISPRessoAggregate.

Tokens
19.5K
Snippets
29
Records
89
Agent score
56%

What's inside CRISPResso2

  1. Overview of CRISPResso2

    master

    CRISPResso2 is a software pipeline for the rapid and intuitive interpretation of genome editing experiments. It performs three primary functions:

    1. Alignment: Aligns sequencing reads to a provided reference sequence.
    2. Quantification: Quantifies insertions, mutations, and deletions to distinguish between modified and unmodified reads.
    3. Summarization: Generates intuitive plots and datasets to summarize editing results.

    A limited web implementation is available at https://crispresso2.pinellolab.org/.

  2. Understand VCF Left-Normalization in CRISPResso2

    master

    CRISPResso2 performs VCF left-normalization to ensure that Indels (insertions and deletions) in repetitive reference regions are represented by their leftmost equivalent position, as required by the VCF specification.

    Without normalization, the aligner might right-shift indels in repetitive sequences (e.g., deleting AC at positions 92-93 instead of the leftmost CA at 91-92). This is particularly common in homopolymer runs (e.g., CCC).

    CRISPResso2 uses internal logic in writers/vcf.py to shift deletion windows and rotate insertion bases to their leftmost valid coordinates using the reference sequence (ref_str) and the alignment-to-reference position mapping (ref_positions).

  3. Implementation details for Hover-zoom figures

    master

    The hover-zoom functionality is implemented in a single location to ensure consistency across the CLI and web projects.

    Files:

    • shared/partials/figure_zoom.html (contains HTML and inline figure_zoom.js)

    Usage & Constraints:

    • This implementation is used by report.html and is imported by CRISPRessoPro's nucleotide-quilt partial (partials/nuc_quilt_zoom_figure.html) via a fallback loader.
    • Do not create duplicate copies of this implementation elsewhere.
    • CSS Requirements: The zoom strip must have explicit width:100% (to prevent collapsing to 0px in flex-column wrappers) and overflow:hidden.
    • JS Behavior: The inline JavaScript is stateless and re-measures on every pointermove. Do not cache geometry at the first hover, as this causes a 'dead-zoom-in-hidden-tabs' bug.
    • Scope: Only WIDE figures (amplicon-wide nucleotide quilts) should use this zoom. sgRNA-scoped quilts should render as plain images.
  4. Explore CRISPResso2 tool suites and examples

    master

    CRISPResso2 is part of a larger suite of tools designed for different experimental scales and types. You can find specific example runs for each tool in the documentation:

    • CRISPResso2 (Core): Standard analysis of genome editing sites.
    • CRISPRessoBatch: Analyzing and comparing multiple experimental conditions at the same site.
    • CRISPRessoPooled: Analyzing multiple amplicons from a pooled amplicon sequencing experiment.
    • CRISPRessoWGS: Analyzing specific sites in whole-genome sequencing (WGS) samples.
    • CRISPRessoCompare: Comparing editing between two samples (e.g., treated vs. control).
    • CRISPRessoPooledWGCompare: Comparing pooled amplicons in WGS data.
    • CRISPRessoAggregate: Aggregating results from previously-run CRISPResso analyses.
  5. Workflow for features requiring changes to both parent repo and CRISPRessoReports

    master

    When a feature requires simultaneous changes to the parent repository and the shared CRISPRessoReports code, use this synchronized branching workflow:

    1. In the parent repo: Create a feature branch from master:
      git checkout -b <feature-branch> origin/master
    2. In the reports repo: Create a corresponding feature branch:
      git checkout master-reports
      git pull
      git checkout -b <feature-branch>-reports reports/master
    3. Development: Switch back to the parent repo branch (git checkout <feature-branch>) and develop your changes. You can commit changes for both repositories in the same commit sequence.
    4. Syncing back: To push reports changes, switch to the reports feature branch and merge the parent branch using the subtree command:
      git checkout <feature-branch>-reports
      git merge --squash -Xsubtree="CRISPResso2/CRISPRessoReports" --no-commit --allow-unrelated-histories <feature-branch>
    # Parent repo setup
    git checkout -b <feature-branch> origin/master
    
    # Reports repo setup
    git checkout master-reports
    git pull
    git checkout -b <feature-branch>-reports reports/master
    
    # Merging reports changes back
    git checkout <feature-branch>-reports
    git merge --squash -Xsubtree="CRISPResso2/CRISPRessoReports" --no-commit --allow-unrelated-histories <feature-branch>
  6. Push changes from the parent repo back to CRISPRessoReports

    master

    If you have made changes to the files within the CRISPRessoReports directory of your parent repository and want to contribute them back to the shared repository, follow these steps:

    1. Create or switch to a branch on the CRISPRessoReports remote. To create a new feature branch based on the reports master:
      git checkout reports/master
      git checkout -b <feature-branch>-reports
    2. Merge the changes from your parent repository's feature branch into this reports branch using a subtree merge:
      git merge --squash -Xsubtree="CRISPResso2/CRISPRessoReports" --no-commit --allow-unrelated-histories <feature-branch>
      Note: <feature-branch> refers to the branch in your parent repo containing the changes.
    3. Push the changes to the shared repository:
      git push reports
    4. Return to your parent repository branch:
      git checkout <feature-branch>
    git checkout reports/master
    git checkout -b <feature-branch>-reports
    git merge --squash -Xsubtree="CRISPResso2/CRISPRessoReports" --no-commit --allow-unrelated-histories <feature-branch>
    git push reports
    git checkout <feature-branch>
  7. Pull changes from CRISPRessoReports into the parent repo

    master

    To incorporate the latest updates from the shared CRISPRessoReports repository into your parent repository feature branch, follow these steps:

    1. In the parent repo, switch to the dedicated reports branch:
      git checkout <feature-branch>-reports
    2. Pull the latest changes from the remote:
      git pull
    3. Switch back to your active working branch in the parent repo:
      git checkout <feature-branch>
    4. Merge the changes using a subtree merge to avoid unrelated history errors:
      git merge --squash -Xsubtree="CRISPResso2/CRISPRessoReports" --no-commit --allow-unrelated-histories <feature-branch>-reports
      Note: Adjust the -Xsubtree path to match your repository's structure (e.g., CRISPRessoWEB/CRISPRessoReports).
    5. Resolve any merge conflicts and commit the changes.
    git checkout <feature-branch>-reports
    git pull
    git checkout <feature-branch>
    git merge --squash -Xsubtree="CRISPResso2/CRISPRessoReports" --no-commit --allow-unrelated-histories <feature-branch>-reports
  8. Initialize CRISPRessoReports as a subtree in the parent repo

    master

    If CRISPRessoReports has not yet been added to your parent repository, you can read it in as a subtree.

    Warning: Ensure you are on the correct branch in the parent repository before running this command.

    1. Switch to your target branch:
      git checkout <feature-branch>
    2. Read the tree into the specified prefix:
      git read-tree --prefix=CRISPResso2/CRISPRessoReports -u master-reports

    Note: Replace CRISPResso2/CRISPRessoReports with the actual path where you want the files to reside in your parent repo.

    git checkout <feature-branch>
    git read-tree --prefix=CRISPResso2/CRISPRessoReports -u master-reports
  9. Set up CRISPRessoReports as a remote in a parent repo

    master

    To work with the shared reports code within a parent repository (like CRISPResso2 or C2Web), you must first add the CRISPRessoReports repository as a git remote. This is a one-time setup step.

    Run the following command in your parent repository root:

    git remote add reports https://github.com/edilytics/CRISPRessoReports.git
  10. Analyze pooled sequencing experiments with CRISPRessoPooledCORE

    master

    The CRISPRessoPooledCORE.py module is a CLI entrypoint designed to analyze multiple amplicons from pooled sequencing experiments. It automates the process of demultiplexing reads from a single sequencing run into individual amplicons and then runs standard CRISPResso analysis on each.

    Core Workflow

    1. Amplicon Validation: Checks for distinct amplicon sequences, unique names, and valid nucleotide characters.
    2. Alignment (Mode 1): Aligns reads to a custom Bowtie2 index built from the provided amplicon sequences.
    3. Demultiplexing: Splits the aligned BAM file into individual FASTQ files for each amplicon.
    4. Sub-CRISPResso Runs: Executes individual CRISPResso commands for each amplicon using the demultiplexed reads.
    5. Genome Mapping (Optional): If RUNNING_MODE is set to AMPLICONS_AND_GENOME, it also maps amplicons to a reference genome and can demultiplex reads across the entire genome or specifically at amplicon locations.

    Key Requirements

    • Dependencies: bowtie2 and samtools must be installed and available in the system path.
    • Input Data: Requires an amplicons file (containing amplicon_name, amplicon_seq, etc.) and sequencing reads (FASTQ files).
  11. Aggregate CRISPResso2 results

    master

    The CRISPRessoAggregateCORE.py module serves as a CLI entrypoint to aggregate multiple CRISPResso2 analysis runs into a single summary report. It processes individual CRISPResso2 output folders to generate unified statistics, including:

    • Quantification of editing frequencies: Summarizes unmodified vs. modified reads, insertions, deletions, and substitutions across all samples and amplicons.
    • Mapping statistics: Aggregates alignment data (total reads, aligned reads, discarded reads, etc.).
    • Visual Summaries: Generates summary plots such as nucleotide composition 'quilts', reads total bar plots, and modification summary plots.
    • Aggregate Report: Produces an HTML report (CRISPResso2Aggregate_report.html) that consolidates findings from all imported runs.

    If the CRISPRessoPro version is installed, the tool can utilize Pro-specific hooks for advanced HTML reporting.