Sovereign 8s.is mirror of standardgalactic/PA_Analysis
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-22 09:15:49 +09:00
test_long_read 20260621_upload 2026-06-21 20:15:14 +09:00
test_short_read 20260621_upload 2026-06-21 20:15:14 +09:00
environment.yml 20260621_upload 2026-06-21 20:15:14 +09:00
LICENSE Initial commit 2026-06-06 21:44:19 +09:00
PA_reclassification_long_read.py 20260621_upload 2026-06-21 20:15:14 +09:00
PA_reclassification_short_read.py Update PA_reclassification_short_read.py 2026-06-22 09:15:49 +09:00
README.md 20260621_upload 2026-06-21 20:15:14 +09:00

PA_reclassification

🧬 Prime-editing Read Reclassification

PA_reclassification is an analysis tool that reclassifies genome-editing sequencing reads into prime-editing (Prime Assembly, PA) outcome categories — precise installation, flap integration with indels, indels at the nick site, wild type, and so on. It compares the mutation pattern of each read against both a wild-type (WT) reference and the intended precise (PA) reference around the nick/cleavage and flap-junction positions, then assigns a final category.

Two entry points are provided depending on the sequencing platform:

Script Platform Backend
PA_reclassification_long_read.py Long-read (Nanopore / PacBio) CRISPRlungo
PA_reclassification_short_read.py Short-read (Illumina, paired-end amplicon) CRISPResso2

📥 Installation

The following core requirements are necessary to run the pipeline:

Requirements

Requirement Version
Python 3.10
CRISPRlungo latest (GitHub)
CRISPResso2 2.3.x
minimap2 2.22
pysam 0.19.1
vsearch 2.26.0
edlib 1.3.9
biopython 1.85
numpy 1.23.5
pandas 2.2.3

Setup Commands

Follow these commands to clone the repository and create the Conda environment (using mamba for speed). The provided environment.yml installs both CRISPRlungo (editable, from GitHub) and CRISPResso2 (from bioconda):

# 1. Clone the repository
git clone https://github.com/GuehoLab/PA_reclassification

# 2. Navigate to the directory
cd PA_reclassification

# 3. Create the Conda environment using the provided environment file
mamba env create -f environment.yml -n PA_reclassification

# 4. Activate the newly created environment
mamba activate PA_reclassification

# 5. Verify the backends are available
CRISPRlungo -h
CRISPResso  -h

~10–20 minutes on a standard desktop computer

Note: CRISPRlungo must be installed in editable mode (this is already configured in environment.yml). A non-editable install fails at runtime because its setup.py omits some src/ modules.

📝 Usage

Each script takes a single TAB-separated input table describing one or more samples. The first row is a header and is skipped.

Long-read

python PA_reclassification_long_read.py {input.txt} [options]

Run from the directory that contains your FASTQ files (the R1/R2 paths in the table are resolved relative to the working directory).

Input table columns (long-read)
# Column Description
1 name Sample / output name
2 R1 Treated reads FASTQ(.gz)
3 R2 Control reads FASTQ(.gz)
4 WT_ref Wild-type reference sequence
5 PA_seq Precise (PA) reference sequence
6 sg1_wt Guide 1 spacer (WT coordinates)
7 sg2_wt Guide 2 spacer (WT coordinates)
8 sg1_PA Guide 1 spacer (PA coordinates)
9 sg2_PA Guide 2 spacer (PA coordinates)
10 WT_cv_pos WT cleavage positions (comma separated)
11 WT_flap_pos WT flap positions (comma separated)
12 PA_cv_pos PA cleavage positions (comma separated)
13 PA_flap_pos PA flap positions (comma separated)
14 PA_junc_pos PA junction positions (comma separated, or - if none)

Short-read

python PA_reclassification_short_read.py {input.txt}
Input table columns (short-read)
# Column Description
1 name Sample / target name
2 R1 R1 FASTQ(.gz)
3 R2 R2 FASTQ(.gz)
4 Amp_ref Wild-type amplicon reference
5 PA_seq Intended precise (PA) amplicon
6 sg1 sgRNA 1 spacer
7 sg2 sgRNA 2 spacer (- if absent)
8 RTT1 Reverse-transcriptase template 1 (- if absent)
9 RTT2 Reverse-transcriptase template 2 (- if absent)
10 esso_output Directory for the CRISPResso2 output

Example

Test datasets are provided under test_long_read/ and test_short_read/:

# Long-read
cd test_long_read
python ../PA_reclassification_long_read.py longread_test_input.txt

# Short-read
cd test_short_read
python ../PA_reclassification_short_read.py shortread_test_input.txt

Expected runtime is ~5–15 minutes on a standard desktop computer (depending on read depth).

⚙️ Parameters (Full Options List)

The long-read script exposes the following optional arguments (the short-read script takes only the input table):

Argument Type Default Description
input_file str (required) TAB-separated input table (see columns above).
-o, --output-dir str reclassification_output Directory for all output files.
-s, --summary str summary.txt Combined summary file (one row per sample).
--large-mut-len int 50 Length threshold for calling a deletion "large".
-t, --threads int 8 Threads passed to CRISPRlungo.

📊 Result Files

Long-read

File Description
summary.txt Combined summary across all samples: read counts and percentages per category.
{output_dir}/{sample}/summary.txt Per-sample category counts and fractions.
{output_dir}/{sample}/res_table.txt Per-sample classification table — the closest reference (WT/PA) and its window mutations for each read group, with percentages.
{output_dir}/{sample}/{category}.txt One file per outcome category, listing the reads assigned to it (with WT/PA window mutations and indel lengths).

Short-read

File Description
multi_ref_esso_reclass_summary_v2_full.txt Combined summary: read counts and percentages per category, one row per target.
mutliref_win1_reclassification_result_sub_full/{name}.txt Per-target CRISPResso2 allele table annotated with the assigned category.
{esso_output}/CRISPResso_output_multiref/CRISPResso_on_{name}/ Raw CRISPResso2 output for each target.

Outcome categories

Category Description
Precise_PA Read matches the intended precise prime-edited allele (flap installed, no extra edits in the junction windows).
WT No edit detected in any cleavage/flap window (wild type).
Flap_integration_wDel / Flap_integration_with_deletion Flap integrated, accompanied by a net deletion in the window.
Flap_integration_wIns / Flap_integration_with_insertion Flap integrated, accompanied by a net insertion in the window.
Flap_install_wo_indels / Flap_installation_without_indels Flap installed without additional indels.
Indel_at_nick_site / Indels_at_nick_sites Small indels localized at the nick site, without flap integration.
Others Reads not matching any of the above patterns.