Abstract
Prediction of CRISPR/Cas outcomes remains unsatisfactory in embryos due to distinct DNA repair preferences and the lack of large-scale embryo editing profiles. We introduce inDecay, a flexible system for predicting the proportion of CRISPR-induced indels from the target sequence. Owing to its parameter-efficient and cell-type-aware design, inDecay performs well in both in-sample training and out-of-sample fine-tuning. Starting with cross-cell-line predictions, we observed that inDecay maintains high accuracy in mouse zygote editing and in goat, cattle and porcine embryos. inDecay may accelerate mouse model generation, livestock embryonic editing, and gene therapy applications.
Supplementary Information
The online version contains supplementary material available at https://doi.org/10.1186/s13059-026-04211-x.
Keywords: CRISPR editing, DNA repair, Machine learning, Editing outcome prediction
Background
The CRISPR/Cas system enables precise and efficient genome editing [1–3]. The precise control of potential editing outcomes is often required in a wide range of derived applications, including generating model animals, treating genetic diseases by correcting pathogenic genetic variations, and engineering therapeutic cells [4–6]. To this end, it is helpful to have an unbiased and accurate prediction of the repair outcomes during guide RNA (gRNA) design to avoid undesired editing outcomes.
CRISPR-induced genome editing primarily occurs through the repair of a double-stranded break (DSB) at the site targeted by the guide RNA [7, 8], producing a diverse array of repair products. For template-free CRISPR editing, the main pathways involved are classical Non-Homologous End Joining (cNHEJ), which produces small insertions and deletions, and Microhomology-Mediated End Joining (MMEJ), which generally produces larger deletions with the existence of short homologous sequences [9, 10]. The choice of the repair pathway and the randomness within each repair process give rise to a complex repair profile. The repair profile is regulated at two levels. Globally, the expression of DNA repair genes shapes the overall preference over different repair pathways [11, 12]. Locally, the sequence context flanking the cleavage site determines the probability of each potential insertion or deletion (indel) based on the preference of indels by different repair pathways.
Recently, highly scalable self-targeting editing techniques have emerged, making it possible to comprehensively profile CRISPR-induced DNA repair events for a target sequence [13–15]. The generated data offer unique opportunities to decipher the impact of local sequence context on repair patterns and were used to develop computational methods for predicting CRISPR editing outcomes, with prominent examples including inDelphi [13], ForeCasT [14], and Lindel [15]. However, existing methods have primarily been trained on datasets measured in a certain cell line (or pooling multiple lines) and learned the mapping from sequence to repair profile, ignoring the variability of the global cellular environment across cell types or conditions [16, 17]. Consequently, their predictions may be inaccurate for cell types that exhibit distinct preferences for repair pathways [13, 14].
One particular example is predicting gene editing in zygotes or early embryos. Embryonic cells exhibit distinct DNA repair activity compared with somatic cells, particularly during early developmental stages [18]. Studies have suggested that embryonic cells may favor the NHEJ repair pathway at certain stages, possibly due to the absence of specific proteins and shifts in cell cycle phase distribution [18–20]. As a result, predicting CRISPR editing outcomes in embryonic cells poses greater challenges for current methods. For example, although inDelphi has developed variants tailored to several cell types [13], its predictions tend to over-represent microhomology-mediated end joining (MMEJ) repair outcomes. Furthermore, these methods have shown poor performance when applied to germline editing [21, 22].
In this study, we present inDecay, a multi-stage deep learning method for predicting the CRISPR-induced editing outcome given the target sequence. Our method particularly considers the variability of the DNA repair system across different cell types or conditions by explicitly modeling the ratios of different repair pathways (insertion, MH deletion, and NH deletion). Moreover, we designed an informative encoding scheme for each deletion event based on its deletion length, MH track, and deletion start site. The encoded deletion features enable efficient estimation of the probabilities of deletion events and allow for post hoc customization of the model using user-adjustable hyperparameters. Our results demonstrate the superiority of inDecay over existing methods on multiple cell lines. We particularly highlight the use of few-shot learning, which effectively facilitates generalization of our model to new cell lines. Moreover, we demonstrated that this transfer-learning capability plays a critical role in accurate prediction in mouse and livestock embryos in our newly generated in vivo datasets. Therefore, with its flexibility and accuracy, inDecay holds great potential for broader application in CRISPR-based genome editing studies.
Results
Highly informative event-based features enable a flexible and lightweight model for repair outcome prediction
The DNA repair outcomes of the CRISPR-induced double-strand break depend on both the sequence context of the target site and the cellular environment as defined by the relative activities of different repair pathways [11, 12]. We designed a novel repair-outcome prediction method, inDecay, that considers the impact of both components. Our method, inDecay, first captures the sequence context by detecting all possible microhomologous (MH) sequences (referred to as MH-track later) within the target sequences. This enables us to quickly identify the MH deletion events and craft features for each event. Next, the preference for different repair outcomes was captured by a multi-stage learning system in a cell type-specific manner, which used the manually crafted features to predict the probability of each event (indel).
The strength of MMEJ events is largely decided by the length and the starting position of the MH-tracks. A long MH-track that is close to the cut site can sometimes result in a single MH deletion event dominating the entire repair profile [23]. Characterizing MH tracks and annotating MH deletions from hundreds of possible deletion events is thus important. To quickly identify all the MH-tracks in the target sequence, we converted the problem of searching all possible homologous sub-sequences into a diagonal-line detection problem. This was achieved by matching the left and right cleaved fragments into a two-dimensional matrix similar to the sequence substitution matrix (Fig. 1A), which was traditionally used to score aligning nucleotides. Then, MH-tracks can be efficiently identified by applying convolution filters to the matrix (see Method), avoiding iterative string matching by previous methods [14, 15]. The identified MH-tracks were then used to annotate the corresponding MH-deletions in terms of their deletion start site, maximum MH length, and deletion length.
Fig. 1.

Schema of the inDecay model. A The workflow of MH event detection. A target sequence was first cut into two fragments at the cut-site and then the pair-wise nucleotide substitution matrix was computed. The y-axis (first dimension) of the matrix represents the left fragment, and the x-axis represents the right fragment. The filtered matrix has only diagonal lines left. The y-coordinate of the tail end indicates the start site of the lines. The deletion length was the addition of the y-coordinate to the x-coordinate of the tail-end. Features were extracted based on the detected deletion events and served as the input for the multi-stage model. B The multi-stage prediction models. After identifying the MH deletion events for a given target sequence, the full event frequency was predicted via the module, which transforms the features of each event into frequency. The whole feature set comprises 20 features tailored to each indel event based on its category, along with 41 features shared across all events, including the GC ratio, the overall MH-strength, the ratios of insertion and deletion predicted by the module and 36 one-hot encoded sequence features
We observed a consistent frequency decay of deletion events with respect to the deletion length as well as the start site (proximity of starting position to the cut site) across different cell types (see Fig. 1A). However, depending on the sequence context, this pattern can be disrupted by larger deletions induced by long MH-tracks (Additional file 1: Fig. S1). We therefore designed features in a first-principles manner to represent this statistical frequency decay using the deletion start site, maximum MH length, and deletion length extracted by the method mentioned above. The deletion length and start site were transformed by a decay function, and the MH length was regulated by a power function (Fig. 1A and Methods), with each term having its own hyper-parameter.
In the second step, more features were generated based on the category, as well as the deleted or inserted nucleotides of each indel (Fig. 1B). Subsequently, the inDecay frequency module transforms the finalized feature array of an event into its probability using a neural network. These event-specific features were constructed differently for the three classes, including microhomology (MH) deletions, non-MH deletions (NH), and insertions. NH deletion features were similar to MH deletion features, with several features set to zero (see Table S4). Insertion features mainly captured the indel size and the complement of inserted nucleotides to the flanking sequences. Additionally, we added four types of features shared among all events to inform the overall properties of the target sequence, including the insert-del proportion from the first stage, the overall MH-strength derived from the filtered substitution matrix, the GC-ratio and the one-hot encoded 9-bp sequences upstream to the PAM site. The shared features reduced the inductive bias of the neural network by learning hidden variables that can complement the hand-crafted features. Taken together, we curated a set of 61 information-dense features as the input.
In the next stage, we utilized the annotated events and first-principles-derived features to predict the full spectrum of repair outcomes along with additional sequence features. The prediction was done via two steps. The first step involved the ratio module of inDecay to predict the overall ratio between deletion and insertion from the 9-bp nucleotides before the Protospacer Adjacent Motif (PAM) site. This ratio was highly predictable using a linear model. In fact, different studies have reported a consistent nucleotide usage when it differentiates deletion-prone and insertion-prone sequences [13–15].
In summary, we proposed an event-based multi-stage learning method inDecay to predict the CRISPR editing outcome. A new MH-track search algorithm was integrated into inDecay to rapidly highlight the important MH-deletion features. inDecay combined feature engineering that was obtained from first-principle knowledge and automatic feature learning by neural networks, making it a lightweight yet powerful model.
inDecay accurately predicts the repair profiles in five cell lines
To evaluate the performance of inDecay for different cellular environments, we applied it to a multi-cell line dataset generated by Allen & Crepaldi et al. [14], which profiled the repair outcomes of over 35,000 guide RNAs for all 5 cell lines (Additional file 1: Fig. S2). Among them, we selected 1,133 highly covered guide RNAs containing over 1,000 total counts across cell lines as the test set and kept the remaining samples that had over 500 counts to train our inDecay model. The repair profiles of the targeted sequences have manifested a strong variability among cell types in several aspects (see Additional file 1: Fig. S3). Baseline models, Lindel and FORECasT, provided only a single model without cell type specification. To ensure a fair comparison, we retrained Lindel and FORECasT for each cell line, using the same training and test split. The inDelphi authors trained different versions on an independent dataset for 4 different cell lines. Among them, mESC and K562 overlapped with our training data set. Due to the difficulties of reproducing inDelphi’s pipeline, we compared inDelphi only on mESC and K562 data. We then benchmarked inDecay with the baselines on the held-out test set. To thoroughly assess the predicted outcome distribution of each method, a variety of evaluation metrics were applied (Fig. 2A), including those previously utilized and some newly introduced ones (see Methods). FORECasT’s datasets involved two experimental replicates for each cell line; therefore, repair profiles from the two replicates were used to determine the upper bound of each evaluation metric.
Fig. 2.

Performance of inDecay on FORECasT’s multi-cell type datasets. A Illustration of the evaluation process and the metrics. The evaluation metrics encompass 1) top-5 event recall, which directly measures the count of overlapped events between the predicted and true top-5 sets; 2) distribution similarity metrics, including Kendall’s rank correlation coefficient and KL divergence, to evaluate overall alignment between the predicted and observed distributions; and 3) the accuracy in recapitulating key compositional features such as the frameshift ratio and the proportion of deletion events. B-G Evaluation of model performance across different cell lines using various metrics. Models, including Lindel, inDelphi, FORECasT, and inDecay (ours), were trained on the same dataset and tested on 1,133 guides. inDelphi was evaluated only for mESC and K562. The x-axis shows the cell type and the y-axis shows the evaluation metric for all the subplots. The color of the bar denotes different methods: replication (dots) was calculated from the repair profile of the two experimental repeats
We began by evaluating the yield of the most frequent events through the recall of the top-5 predicted indel sizes and events. CRISPR editing typically produces a group of long-tail distributed indels. Although each target sequence can generate over 300 unique indels, the top 5 accounted for 65.1% of the total (averaged over 59,337 samples from 5 cell lines, Additional file 1: Fig. S4). Adding five more indels increased this cumulative frequency to only 77.2%, indicating that the first five indels were the dominant events. Here, inDecay showed the highest top-5 recall in terms of indel sizes and specific events (3.6 for inDecay in Fig. 2B, 3.3 in 2C). inDecay outperformed Lindel by a large margin and was better than FORECasT and inDelphi (, one-sided paired Wilcoxon signed-rank test). Consistently, inDecay also achieved the highest top-10 recall (Additional file 1: Fig. S5A). These results together suggest that inDecay can robustly reveal the most dominant and subdominant indels despite using much fewer features than previous methods.
Next, we looked into the prediction of indel length by grouping events according to the editing length. In CRISPR/Cas gene editing experiments, the length of the editing outcome is essential for evaluating editing efficiency, specificity, and functional phenotype. By collapsing repair events of the same length, we transformed highly sparse event probabilities into a dense indel-length distribution consisting of 41 elements. The transformation allows for accurate measurement of the reconstructed distribution as it avoids the bias caused by the null entries of the rare indels (as opposed to the Mean Squared Error used in [15]). We also included Kendall’s coefficient, which considers the ordering within 41 indel lengths (1–2 bp insertion, insertion>3 bp, 1–37 bp deletions and deletions >= 38 bp). inDecay could predict the most concordant ranking of indel length, with a mean Kendall’s of 0.73 across cell lines (Fig. 2D). When evaluating the overall similarity of indel length, inDecay presented a KL divergence around 10% and 32% lower than inDelphi and FORECasT (Fig. 2E). Interestingly, while we found FORECasT achieved comparable top-5 recall, its Kendall’s (among 41 indel lengths) was substantially lower than that of inDecay (on average 0.08 lower across cell lines), indicating its suboptimal performance in predicting the ranking of top events (similarly in the KL divergence metric). These results together demonstrate inDecay’s ability to accurately recapitulate the indel length distribution at different scopes.
We subsequently inspected how accurately our model can predict the likelihood of introducing a frameshift mutation, which is important for designing effective gene knockouts. We started by examining the R-square value between observed and predicted frameshift ratio (i.e., the proportion of indels causing frameshift and consequent loss of function) with a metric of frameshift ratio (FSR2). Across all cell lines, inDecay achieved the highest frameshift ratio . Specifically, for the mESC cell line, inDecay reached an FSR2 of 0.859 with a large improvement over existing baselines (0.622 for Lindel, 0.77 for inDelphi, and 0.804 for FORECasT), thus improving our ability to estimate the efficiency of introducing loss-of-function indels (Fig. 2F and Additional file 1: Fig. S5). This improvement is attributable to inDecay’s accurate prediction at finer reading-frame resolution, which is to distinguish in-frame, +1-bp, and +2-bp frameshift outcomes (Additional file 1: Fig. S6). Additionally, we investigated the predicted ratio of deletion events to insertion events (Fig. 2G), where inDecay consistently outperformed all other methods in five cell lines, partly owing to its multi-stage design (Fig. 2G). While Lindel and FORECasT performed reasonably well, inDelphi unexpectedly displayed disproportionately low , attributed to a general overestimation of the deletion events (Additional file 1: Fig. S5B).
In summary, our method, inDecay, accurately predicts the repair profiles for different cell lines. By combining the advantages of an event-based model and a multi-stage design, inDecay produces predictions that closely resemble the observed event probabilities for the most frequent events, the distribution of indel length, and the proportion of different indel types.
Model interpretation analysis confirms that inDecay’s features capture biologically meaningful repair determinants
To identify which components of inDecay’s feature design underlie its cross-cell-line performance, we combined two complementary interpretation approaches: feature ablation, which quantifies importance at the global level, and SHAP analysis, which provides local attributions at the level of individual events (see Methods). The feature set of inDecay is intentionally saturated, with several features describing different aspects of the same underlying repair mechanism (see Table S4). We performed ablation at the group level by jointly masking related features. Quantifying each group’s effect on prediction performance revealed that features related to microhomology, indel size, and insertion–nucleotide complementarity were the most influential groups (Additional file 1: Fig. S7A-D). SHAP analysis provides complementary event-level attributions, allowing us to test whether each feature behaves as its biological motivation predicts. For deletion events, deletion length and microhomology length ranked as the top two features by mean |SHAP| value, confirming their dominant role (Additional file 1: Fig. S7E). Start-site position ranked third, consistent with the known positional bias of Cas9-induced deletions relative to the cut site [13, 14]. The signs of the attributions matched our design assumptions: event probability decayed with increasing deletion length and start-site distance, while long MH tracks counteracted this decay and promoted longer deletions. These top-ranked features also overlapped with those highlighted by the ablation analysis, indicating consistency between global and local interpretation. For insertion events, SHAP attributions revealed how inDecay hierarchically discriminates event categories (Additional file 1: Fig. S7F). The model first uses a microhomology length of zero to flag non-MMEJ events, then a deletion size of zero to confirm an insertion. Among insertion-specific features, left nucleotide match, shift, and insertion length emerged as the top drivers — consistent with the templated insertion mechanism, in which the nucleotide identity at the cut-site overhang determines the dominant +1 insertion.
Transfer learning enables effective cross-cell-line and cross-editor prediction with inDecay
In practice, CRISPR/Cas genome editing is carried out across various cell types and organisms, many of which are not encompassed within the dataset for training inDecay or other existing models. Transfer learning represents a way to effectively overcome the cell type variability for models pre-trained on another cell line (Fig. 3A). To demonstrate this, we selected two cell pairs, CHO-mESC () and CHO-iPSC (, see Additional file 1: Fig. S3), that have two of the largest KL divergences in indel length distribution. To assess the minimum number of samples required to overcome cell line variability, we designed a series of transfer learning experiments to evaluate the effect of fine-tuning data size. The source model, pre-trained on CHO cells, was fine-tuned using incrementally larger subsets of the query cell line’s data, specifically 10, 20, 30, 40, 50, 80, 100, 300, 500, and 1000 guide RNAs. These fine-tuning samples were randomly drawn 10 times from the guides in the query cell line, and the resulting models were evaluated on 1,133 test samples of the query cell line to calculate the average performance.
Fig. 3.

Transfer inDecay across cell types and editors with different sample sizes. A Workflow for evaluating data efficiency in cross-cell-line transfer learning. A source model pre-trained on CHO cells is fine-tuned with incrementally larger subsets of the target cell line’s data and evaluated on a held-out test set. B Performance of transferred models on the mESC test set (n=1,133 guides) as a function of fine-tuning sample size. C Performance of transferred models on the iPSC test set (n=1,133 guides) as a function of fine-tuning sample size. In both (B) and (C), the gray band shows the range across 10 random sampling repeats, dots indicate the mean, and dashed lines mark the benchmark performance of inDecay trained directly on mESC (yellow) or iPSC (blue) data. D Cross-editor transfer: performance on 618 held-out Cas9–TREX2 targets across four metrics as a function of fine-tuning sample size. Frameshift ratio error and KL divergence measure prediction error (lower is better); top-5 and top-10 recall measure event overlap (higher is better). E Indel size distributions for the Cas9–TREX2 editor. The observed distribution (black) is compared with predictions from the zero-shot K562-pretrained model (gray) and models fine-tuned with 30 (orange) or 1,000 (blue) samples
When applied to unseen cell lines without fine-tuning, inDecay’s performance dropped substantially compared to models trained exclusively on those cell lines, e.g., the major event recall ( > 0.15) fell to 0.05 in mESC and 0.04 in iPSC, approaching zero in both cases. However, the gap between cell lines can be quickly closed: for example, in mESC (Fig. 3B), fine-tuning with as few as 30 samples brought major event recall to over 0.70 and the frameshift ratio to over 0.74 from 0.53. Other metrics, including absolute error of frameshift, Kendall’s of indel length, top-5 indel length accuracy, and KL divergence, also showed the largest improvements within this range. Similar patterns were also observed for the most distantly related cell line pair (CHO to iPSC), where 30 fine-tuning samples gave substantial improvement, and after 30–50 samples the marginal improvements (performance gain per extra sample) became lower (Fig. 3C). Importantly, the five cell lines shared the same set of gRNA-target sequence pairs; that is, the fine-tuning dataset does not introduce new sequences. This means that the performance gain during the transfer learning process is not due to additional data but rather to adaptation to the repair preference of the target cell line.
To further test whether inDecay’s few-shot framework transfers across CRISPR effector protein, we examined the Cas9-TREX2 fusion protein (short for TREX2), which shows different indel preferences but does not entirely deviate from the repair pathways that inDecay can cover (Fig. 3D). The 3‘5‘ exonuclease TREX2 shifts editing outcomes away from the short, cut-proximal deletions predicted by the NHEJ repair pathway and toward longer, asymmetric, one-sided deletions with enrichment around 9–15 bp (Fig. 3E). We set up similar fine-tuning experiments with increasing sample size and evaluated on 618 held-out targets to assess whether sample efficiency is maintained in a cross-editor scenario. Similar to the cell type transfer experiment, inDecay achieves meaningful improvement with as few as 30 samples (mean frameshift error = 0.06, KLD = 3.5) and continues to improve as the sample size increases. TREX2 shows a distinct indel size distribution from that predicted by the model trained on SpCas9 data (black vs. gray curve in Fig. 3E). The gap can be quickly filled with only 30 samples.
In summary, inDecay can effectively adapt to the repair landscapes of different cell types with limited fine-tuning data. Importantly, as few as 30 to 50 samples are sufficient to achieve alignment with the query cell line or a different editor. Leveraging inDecay, researchers can rapidly customize predictive models for unseen somatic cells or even embryos by collecting minimal fine-tuning data (Fig. 3A).
inDecay can quickly adapt to distinct mouse zygote editing patterns using few-shot learning
Template-free CRISPR/Cas editing has become a widely adopted technique for generating gene knockout animal models in biological research. Due to the limited availability of mammalian zygotes, it is essential to achieve efficient editing outcomes in order to maximize the yield of knockout embryos. However, embryonic cells exhibit unique repair preferences, and embryo editing normally involves different techniques, such as microinjection or electroporation, to deliver the CRISPR-gRNA complex, collectively shaping a distinct editing profile compared with somatic cell lines. Moreover, existing predictors, trained on self-targeting data, have been shown to be inaccurate for embryo editing [21, 22], underscoring the necessity of developing models trained on embryo-specific data.
To characterize the patterns of CRISPR-induced indel formation in mouse embryos and provide data for training embryo-specific models, we designed 52 gRNAs targeting 43 genes and performed editing experiments across a large cohort of embryos for each gRNA (Fig. 4A; guide sequences and read counts in Table S1). Given the efficiency of embryo editing, we collected around 11,700 mouse zygotes for sgRNA–Cas9 complex delivery to obtain a sufficient number of genome-edited embryos. The targeted loci were subsequently PCR-amplified and subjected to Sanger sequencing, followed by signal processing and filtering to derive the editing profiles of each gRNA–gene pair (see Methods). Notably, we conducted pilot experiments on 145 mouse zygotes to verify that the editing and electroporation pipeline does not compromise embryo viability (Table S3 and Additional file 1: Fig. S8). As a result, we compiled a dataset comprising editing outcomes from 1,878 successfully edited mouse embryos across 52 genomic loci, out of the 11,781 zygotes initially collected. As our method has demonstrated sample-efficient transferability (Fig. 3), we next employed few-shot learning using inDecay to capture the patterns of embryonic editing. To ensure fair evaluation, we applied leave-one-out cross-validation to split the fine-tuning and testing samples. In each fold, we evaluated the prediction results of one gRNA while using the remaining 51 gRNAs for training and validation. To quantify model performance, we aggregated results across 30 high-quality test gRNAs (indicated by stars in Fig. 4B), which were selected based on larger embryo sample sizes and higher sequencing signal quality.
Fig. 4.

Transferring and evaluating inDecay in newly generated mouse zygote editing dataset. A Workflow for collecting mouse embryonic editing data. B Bar plot displaying the number of mouse embryos counted for each designed guide RNA, with coloring indicating sequencing quality and stars highlighting super high-quality data selected for test set. C Overall indel length distribution of the 30 test guide RNAs on mouse embryos (orange curve and bar) and their predicted distribution by inDecay pre-trained only on somatic cell lines (pre-trained CHO, blue curve) and fine-tuned on our zygote data (few-shot, yellow curve). Kullback–Leibler divergence value (KLD_IDL) was computed between the observed and each of the predicted indel length distributions (lower KLD_IDL value is better). D Performance of Lindel, inDelphi, FORECasT, and our pre-trained and few-shot models on different metrics. From left to right shows the major events ( > 0.25) recall ratio, top-5 event recall, Kendall tau correlation of top-5 events, the absolute error of frameshift ratio (|predicted ratio – observed ratio|), KL divergence of indel length distribution. E Radar chart comparing different prediction models across five metrics, where our “few-shot” model achieves superior – “five star” performance (Lindel was excluded here; absolute frameshift error and KLD_IDL were inverted as lower values indicate better performance). F Representative examples from three gRNA-target pairs in mouse zygotes, showing the most frequent events of observation (orange) and their predicted frequency by pre-trained model (blue), fine-tuned model (yellow), inDelphi-mESC (gray), Lindel (olive), and FORECasT (salmon). Each indel is labeled by a CIGAR-like identifier: the prefix indicates the event type (D for deletion, I for insertion) followed by the indel length in base pairs; the suffix encodes the genomic coordinates relative to the cut site, where L is the left breakpoint, R is the right breakpoint, and C is the number of nucleotides matching the flanking sequence (microhomology length). For example, D7_L-4C4R8 denotes a 7 bp deletion spanning from 4 bp left of the cut site (L) to 8 bp right of the cut site (R), with a 4 bp microhomology (C)
Genome editing in mouse zygotes yields an indel distribution with a strong preference for small indels (observed, orange), differing from what the model learned from mESC data (pretrained, blue) (Fig. 4C). Remarkably, with only 52 samples, our method quickly addresses the discrepancy and surpasses our pre-trained inDecay model in all evaluated metrics (Fig. 4D, E, F), even though our pre-trained inDecay model has already outperformed current mainstream tools in embryonic editing prediction. More specifically, we highlighted the improvements as follows. In terms of the distribution of indel length, the mouse zygote editing data exhibits a heavy weighting toward 1-bp deletions and 1-bp insertions, a trend precisely captured by our fine-tuned inDecay model (see Fig. 4C, last panel for KL divergence details), while the model trained on mESC data shows additional peaks at 5- and 7-bp deletions. Moreover, when examining the major events (i.e., those with ratios 1/4), we found that our fine-tuned model yielded an average of 80% of major events, whereas inDelphi, Lindel, and FORECasT reached only 37–52% (Fig. 4D). Consistently, inDecay also achieved the lowest absolute error between predicted and observed frameshift ratios, enabling more realistic estimation of the chance of functional knockout in the zygote genome (Fig. 4D). When looking at the detailed event-level predictions per gRNA in the three examples (Fig. 4F), we observe that only the few-shot model reliably captures the true dominant editing patterns in embryonic cells. Notably, we chose mESC as the pre-trained model for demonstrating the most challenging scenario, and this improvement holds across different source cell lines (Additional file 1: Fig. S9).
In summary, these results suggest that embryo editing data indeed possess unique repair preferences, which, however, can be accurately and efficiently captured by our inDecay model using as few as around 50 samples.
Application of inDecay to predicting zygote editing in livestock species with scarce data
The CRISPR/Cas system is increasingly used to improve breeding and produce animal lines with desired traits in large mammals, especially for livestock [24, 25]. The emerging genetic modification tools, like variants of CRISPR/Cas systems, have predominantly been developed for and tested in model species. Despite the high value for agricultural studies and the field of large animal research, the preference for CRISPR-based editing and the subsequent repairing patterns in livestock zygotes still lack comprehensive characterization. Because livestock species are mostly monotocous animals with long gestation periods, it takes much longer to obtain genome-editing results from livestock zygotes, with far fewer embryo samples per donor than in mice. It would therefore be particularly helpful to optimize guide RNA design using accurate predictions of the editing outcome to reduce the number of trials. However, the time- and labor-intensive nature of editing livestock embryos makes such data scarce and possibly noisy, consequently restricting the training of standard machine learning models.
To investigate the gene editing and DNA repair preferences of livestock zygotes, we generated the first dataset suitable for model training by collecting a total of 3,632 zygotes (Fig. 5A) from major livestock species, including cattle, porcine, sheep, and goat. Zygotes were harvested via superovulation, followed by injection of RNA–Cas9 protein complexes for gene editing before the two-cell stage (Fig. 5B). After culturing to expand the cell population, targeted regions were amplified and sequenced via Sanger methods. Data preprocessing and quality filtering mirrored the protocols established for the mouse zygote dataset (see Methods). Ultimately, 434 embryos exhibiting successful genome editing were identified, shaping the indel outcome profiles for 12 distinct guide RNAs (guide sequences and read counts in Table S2). The total event-count distribution of the in-house mouse and livestock datasets is summarized in Additional file 1: Fig. S10.
Fig. 5.

Transferring and evaluating inDecay in newly generated livestock embryonic editing dataset. A Bar plot displaying the number of livestock embryos counted for each designed guide RNA, with coloring indicating sequencing quality and stars highlighting super high-quality data selected for the test set. B Workflow for collecting livestock embryonic editing data. C Overall indel length distribution of the 9 test guide RNAs: observed distribution (observed, orange bar and curve), pre-trained in somatic cell lines (pre-trained, blue curve), and fine-tuned on our zygote data (few-shot, yellow curve). Kullback–Leibler divergence value (KLD_IDL) was computed between the observed and each of the predicted indel length distributions (lower value is better). D, E Goat and cattle examples showing the most frequent observed events (observed, orange) and their predicted frequency by pre-trained model (blue), fine-tuned model (yellow), the mESC version of inDelphi (gray), Lindel (olive), and FORECasT (salmon). F Performance of Lindel, inDelphi, FORECasT, and our pre-trained and few-shot models on different metrics
Our in-house zygote editing results revealed distinctly different DNA repair activities in livestock species compared with somatic cell lines (Fig. 5C) and mouse zygotes. Notably, the indel length profiles in livestock embryos exhibited prominent peaks at 4- and 5-bp deletions, in contrast to the strong preference for smaller indels in mouse zygotes (Fig. 4C), likely suggesting higher activity of the MMEJ pathway in livestock embryos. Utilizing leave-one-out few-shot learning with as few as 12 guide RNAs, inDecay achieved high fidelity in matching indel length distributions (reducing KL divergence from 0.903 to 0.587) and recovering major editing events in approximately 80% of cases—yielding the highest top-event recall and the lowest frameshift prediction error observed (Fig. 5F). These results underscore the adaptability and robustness of inDecay for cross-species embryo editing outcome prediction.
Discussion
The CRISPR-induced DSB repair procedure displays substantial cell type variability, leading to unique weighting of MMEJ, c-NHEJ deletion, and insertion events within the editing outcomes [10]. In this study, we introduced inDecay, a flexible CRISPR editing outcome prediction system that can capture the intricate variations across different cell states. Coupled with our unique MH-event detection system, inDecay specifically crafts features for each MMEJ and c-NHEJ deletion event with several highly informative decay terms. Through extensive benchmarking, we showed that inDecay outperforms other methods, and the predicted repair outcomes align with the observed outcomes in all aspects (see Fig. 2). The efficient design of inDecay allowed it to be adapted to a different cellular context in a highly data-efficient manner (see Fig. 3). The flexibility and lightweight model architecture make inDecay uniquely suitable to address the prediction problem for zygote editing, an important application of CRISPR editing where the sample size can hardly scale up. Indeed, the parameter-efficient design keeps both runtime and memory footprint low during few-shot fine-tuning, even on a consumer laptop (Additional file 1: Fig. S11). To comprehensively measure the embryonic DNA repair profiles of mouse and livestock, we collected more than 2,200 genetically modified embryos from more than 15,000 zygotes. Both zygote editing datasets show unique repair patterns compared with cell-line data, but the pre-trained inDecay can adapt to mouse data with 52 samples (Fig. 4) and improve livestock with no more than 4 data points per species (Fig. 5).
Our results demonstrate that embryo editing outcomes in mouse zygotes are characterized by a sharply peaked indel length distribution favoring minimal edits (1-bp insertions and deletions), distinct from the more varied indel profiles observed in somatic cell-derived models such as mESCs, which is an immortalized in vitro counterpart of the mouse zygote (see Fig. 4C). This biological specificity underscores the pitfalls of applying somatic-cell-trained editing-prediction tools directly to embryonic contexts. Notably, existing methods such as Lindel, inDelphi, and FORECasT exhibit substantial performance degradation in embryonic datasets, likely due to their limited training scope and failure to capture embryo-specific DNA repair preferences, reinforcing the need for data-driven adaptation in specialized settings. Furthermore, the inherently limited availability of mammalian zygotes—even with superovulation techniques—presents substantial challenges for collecting comprehensive training data, especially for non-model species such as livestock. This constraint amplifies the demand for modeling strategies that are both data-efficient and robust to sparse, noisy data.
One hurdle in developing a generalizable editing outcome prediction system lies in the under-characterization of cell types and species-level variability of repair outcome preferences. In early efforts, both FORECasT and inDelphi employed the self-targeting system in the context of several different cell lines. However, it remains unclear how representative these cell lines are for their species and their counterparts in the living organism (e.g., mESCs and mouse zygotes). While it seems challenging to conduct large-scale self-targeting assays in diverse cell types, gene-expression profiles of many cell types have been widely characterized and are readily accessible. Linking gene-expression patterns to repair preferences of uncharacterized cells offers a promising path. Recent technical advances by repair-seq [26] have demonstrated how the repair outcomes vary across different perturbed expression contexts, revealing genetic dependencies and fine-grained heterogeneity in DSB-repair pathways. We can leverage inDecay’s predicted event distribution as a prior. Given the activities of the core DSB repair pathways of a cell, we can reweight this prior according to the pathway to obtain the final repair outcome for an unseen cell type.
While inDecay demonstrates robust adaptability to new editing contexts, its architecture is specifically tailored to the cleavage preferences of CRISPR/Cas systems to maintain a compact, parameter-efficient design. The framework assumes that the editor (1) induces a double-strand break at a precise cleavage site (e.g., 3 bp upstream of the PAM for SpCas9) and (2) triggers standard MMEJ or NHEJ repair pathways. Consequently, the model is not directly applicable to non-CRISPR editors such as Transcription Activator-Like Effector Nucleases (TALENs) and Zinc-Finger Nucleases (ZFNs) [27], which would require redefining the cut geometry and the potential indel spectrum. Given that CRISPR/Cas systems currently dominate the field of genome editing, we anticipate that inDecay will remain applicable across editor variants.
Large DNA deletions are a class of unintended repair outcomes not typically captured by self-targeting systems. In our mouse embryo data, we observed large deletions ranging from hundreds to thousands of base pairs, extending far beyond the target site. Contradictory findings have been reported: Owens et al. [28] observed microhomology at large deletion breakpoints, implicating MMEJ, whereas Kosicki et al. [29] found that many large deletions lacked flanking microhomology, suggesting alternative mechanisms. A very recent study suggested that additional repair mechanisms were involved in producing large deletions, rather than solely relying on the MMEJ and c-NHEJ pathways [30]. Predicting the emergence of large deletions from the sequence alone remains challenging and requires further investigation.
As CRISPR-based gene therapy approaches clinical use, accurate estimates of editing efficiency in advance will be essential. Given concerns about the security of individuals’ genetic data and other ethical issues, repair-outcome data on actual human embryos or stem cells will foreseeably remain very limited. A flexible and parameter-efficient prediction system like inDecay will substantially benefit few-shot transfer to specific use cases with different cell types and limited training data. Looking forward, incorporating richer molecular features such as chromatin accessibility, epigenetic marks, and multi-omic data may further enhance prediction fidelity, especially for more divergent cell types or species. Additionally, integrating inDecay into experimental design workflows can accelerate gene editing projects by enabling in silico screening and ranking of gRNAs with optimized expected outcomes, reducing resource expenditure and improving experimental success rates.
Conclusions
CRISPR editing yields a complex distribution of indels that emerges from a competition among distinct DNA repair pathways, whose relative activities shift with cell state and cellular environment. inDecay is a parameter-efficient, cell-type-aware deep-learning model that represents this competition through interpretable event-level features, enabling it to learn from small datasets via few-shot transfer and to predict editing outcomes for rare samples such as embryos, where large training cohorts cannot be obtained.
Across five somatic cell lines, inDecay predicts repair profiles more accurately than inDelphi, Lindel, and FORECasT, and its compactness is precisely what makes it transferable. Through few-shot fine-tuning, it quickly recovers the editing patterns of unseen cell types and even a different editor, the Cas9–TREX2 fusion, with as few as 30–50 samples. Building on this, we generated the first large-scale embryo editing profile with 1,878 edited mouse and 434 edited livestock embryos which exhibit repair preferences distinct from somatic cell lines. On these data, inDecay recovers 80% of major editing events in mouse zygotes, compared with 37–52% for existing tools, and achieves comparable major-event recall (80%) in goat, cattle, and porcine embryos with no more than four guides per species.
As genome editing extends to embryos and non-model species where training data are inherently scarce, inDecay offers accurate prediction that can directly guide gRNA design for mouse-model generation, livestock engineering, and therapeutic editing.
Methods
Data collection
Embryos derived from murine, bovine (cattle), goat, porcine, and sheep species [31–34] were utilized. A ribonucleoprotein (RNP) complex—comprising Cas9 protein (Invitrogen Truecut Cas9 protein V2 catalog: A36499) (80 ng/L) and sgRNA (TsingKe Biotechnology Co., Ltd) (20 ng/L) in 70 L Opti-MEM medium—was delivered into zygotes via electroporation (murine) or pronuclear microinjection (bovine, goat, porcine, and sheep). Electroporation parameters: Poring pulse:200 V, 2 ms duration, 50 ms interval, 4 pulses, + polarity; Transfer pulse:20 V, 50 ms duration, 50 ms interval, 5 pulses, ± polarity. Method: 60 L RNP complex was loaded into the electrode chamber (impedance: 0.48–0.52 k). Post-electroporation, zygotes were cultured in KSOM medium (Merck Millipore, Cat. No. MR-107-D) to the blastocyst stage or transferred to recipients after overnight culture. For bovine, goat, sheep, and porcine embryos, pronuclear microinjection was performed using 5 pL of a solution containing 50 ng/L sgRNA and 100 ng/L Cas9 mRNA. Injected embryos were cultured to blastocyst for bovine, goat, and porcine. Genomic DNA from blastocyst-stage embryos or ear biopsies served as reference and experimental material. Whole-genome DNA extraction of pooled embryos was executed using the Single-Cell Whole Genome Amplification Kit (Vazyme, China; Cat# N603-02). The whole-genome DNA of ear biopsies was extracted using NP40 lysis buffer. Target regions were PCR-amplified and analyzed via Sanger sequencing. Resulting sequences were processed using ICE (Synthego) or DECODR (RGEN Tools) for editing efficiency quantification.
Data preprocessing
The prediction takes the target sequence as the input feature X and predicts the detailed editing outcomes Y, covering a diverse spectrum of events. The input sequence X was generally standardized, but the output events Y may have different annotation formats from method to method, depending on the coverage of the output events.
Transcode FORECasT data with the Lindel coding system
To convert FORECasT’s event identifiers into higher-resolution Lindel classes, we built an editing outcome transcoding system based on FORECasT’s indelmap results, in which every unique indel was coupled with an identifier. We incorporated two indel labeling functions from separate studies and corroborated their labeling results to ensure the reliability of the conversion.
Our conversion pipeline combined two complementary annotation functions: the CIGAR-string conversion function introduced by Liu et al. [35] and the IndelGen function from Chen et al. [15]. The transcoding procedure took three inputs — an intact target sequence, a FORECasT identifier, and a paired editing outcome sequence — and mapped them to a Lindel class through the following procedure. We first truncated the 79-bp target sequence to 60 bp, centering the cut site at position 30, and used IndelGen to simulate all possible outcome–class label pairs for the truncated sequence. We then matched the observed editing outcome sequence to one of these simulated outcomes, thereby retrieving its corresponding Lindel class label. In parallel, we used the Apindel CIGAR-string conversion function [35] to map the FORECasT identifier directly to a Lindel class. A Lindel class was output only when the two annotation methods agreed, ensuring reliable conversion. Finally, we aggregated the frequency vectors across all samples into an () matrix, which was used to construct an AnnData object: the name of each Lindel class (e.g., “”) was stored along the var axis, while guide-level metadata (target sequence, pam site, organism, strand, etc.) was stored along the obs axis. Overall, this transcoding system converts a large FORECasT-format data table into a frequency matrix with a second dimension of 557.
Fused-nuclease TREX2 editor data
TREX2 high-throughput editing data from the Cas9–TREX2 fusion editor [14] were obtained from the figshare repository (https://doi.org/10.6084/m9.figshare.7312067). Two files were curated: (i) a reference file recording, for each sample (guide–target pair), the identifier, PAM-site coordinate, and genomic strand; and (ii) a read-count table listing every observed indel outcome per sample, with an allele identifier in SelfTarget notation and a raw count column. We then converted these files into the format required by the inDecay training pipeline. For each entry in the reference, the 20-bp protospacer was extracted as the last 20 unambiguous bases immediately 5‘ of the cleavage site (defined as cutsite = pamsite - 3), and candidate indels were simulated using the indelgentarget tool from the SelfTarget package. Approximately 21% of TREX2 reads correspond to one-sided deletions, for which either the left breakpoint lies to the right of the cut site or the right breakpoint lies to its left. These events fall outside the event space enumerated by indelgentarget, which requires , and would be discarded by a conventional inner-join against the indelgen universe. To retain them as trainable labels, we merged each sample’s indelgen event table with its one-sided deletions in an outer join. For events absent from the indelgen universe, we set MH-related features to fixed defaults: (i) MH_n_coevent was set to 1, reflecting a deletion with no flanking MH ambiguity, and (ii) MH scores were set to zero by our alignmap feature extraction function. Code for downloading and reprocessing the TREX2 data is available in the rebuttal branch of the inDecay GitHub repository.
In-house embryonic data
For mouse and livestock embryonic editing data, we input the paired wild-type file and experimental file(s) of each gRNA into the Sanger analysis tool Decodr [36] to quantify editing efficiency from Sanger sequencing traces. We obtained each deletion sequence and its ratio directly from the analysis results. Given that the software only provided an aggregated proportion for all 1-bp insertions and similarly for all 2-bp insertions, we performed further processing on the insertion results. The 1-bp insertion ratio was split by the estimated relative contribution of the inserted base. For 2-bp insertions, we used the most frequent base pair event, with the ratio set to the sum of two insertion events. Each analyzed editing result was then mapped to the corresponding identifier by our transcoding system based on the final editing sequence. A small portion of the files failed to be analyzed and were therefore discarded. Subsequently, the remaining results for the same gRNA were aggregated for single-clonal data, while for bulk data, the ratios were adjusted by multiplying them by the total number of embryos used in the experiment.
Algorithmic design of inDecay
Detection of microhomology events
To compile the data , we first needed to label whether an event was associated with microhomology-mediated end joining (MMEJ) or non-homologous end joining (NHEJ). In this study, we used a pairwise sequence identity matrix to identify all possible microhomologies within our samples. The process involved several steps, as follows.
We started with a target sequence and truncated it if it exceeded 79 bp. At the designated cut site, we split the sequence into two fragments at the cut site. We then constructed a matrix where the left fragments occupied the rows (sequences before the cut site) and the right fragments filled the columns (sequences after the cut site). Each element in this matrix reflected the pairwise identity between nucleotides from the row and column fragments. We assigned a value of 1 for identical nucleotides and −1 for non-identical ones. Additionally, we can assign 1 to identical nucleotides and 0 as the penalty for mismatches. This setting will encourage the convolution filter to tolerate 1-bp mismatches within the MH-track. In theory, more sophisticated scoring methods could be employed to differentiate between purines and pyrimidines.
To detect the diagonal signal patterns indicating microhomologies, we applied kernel convolution, using a 2x2 identity matrix as the convolution kernel. We selected diagonal patterns that exceeded a predefined threshold. In this study, we set the threshold to 3 as the default value in our package, meaning that only MH-tracks longer than 3 bp were considered to induce MH deletion events. Each diagonal line in the matrix allowed us to identify its corresponding deletion start site and deletion length. For every filtered line, we denoted the coordinates of the head and tail ends as and , respectively. This enabled us to assign the deletion start site as and the deletion length as . The length of the microhomology was calculated using the formula . We mapped all filtered lines to their event labels and compiled them into a set .
The detection process was encapsulated within a single-function model in our package, specifically in the function align_map.diagonal_map. For each target sequence paired with the guide g, this function allows us to obtain the specific set of microhomology events associated with g.
Feature extraction
Our model, inDecay, was designed to be event-centered. Each event will be scored uniquely in the features except for the shared features (see Table S4 for comprehensive description of each feature). Then we parameterized a regression function to predict their frequency. We conceptualized deletion events as a competition between the decay of frequency and the recovery induced by microhomologies. Let represent the features of a microhomology-mediated deletion event i, characterized by its deletion length , distance to the cut site ss, and maximal microhomology length . An MH deletion event can be first characterized using the following terms:
| 1 |
where and were the strength of decay with respect to the deletion start site (distance to the cut site) and deletion length, respectively. The feature of a Non-Homologous End Joining (NHEJ) deletion event can be obtained easily by setting the maximal microhomology length to 0. Alternatively, we can use the following transformation to extract features for the NHEJ deletion event if there is no lagging of decay in deletion length where is the same in (1) which controls the strength of decay by deletion length.
When compiling the deletion features, we repeated each decay term with different hyperparameters to make the decay terms more stable. The full features extracted for deletion events include the raw start site ss, three ss decay terms with hyper-parameter , , , the raw deletion length , three decay terms with hyper-parameter , , , the raw microhomology length and its power transformation with hyper-parameter h, the power transformation of allowing 1-bp mismatch with hyper-parameter h, and whether the deletion was proximal or distal. In total, there were 13 event-specific features to describe deletion.
We modeled 1-bp and 2-bp insertions, a total of 20 insertion events, comprising four single-nucleotide insertions and 16 di-nucleotide insertions. For FORECasT’s coding system, several insertion events will be collapsed into one identifier. For our analysis, we only considered insertions that occurred at the cut site as valid. The nucleotide composition around the cut site largely influences the frequency of the insertion event. The full features we used to represent an insertion event were characterized by its insertion length, the existence of complementary nucleotides, the length of complements, the number of insertion indels collapsed in the identifier, and whether the complementary nucleotides were located to the left or right of the cut site. In total, there were 7 event-specific features to describe insertion.
Additionally, we added several features that were shared among all events to allow the model to sense the global context of the target sequence. The shared features involved overall MH strength with/without mismatch, the prior probability of deletion and insertion ratio which were the output of ratio module , GC ratio of the guide RNA, which affected the residence time of the CRISPR-gRNA complex [37] and the one-hot encoding of sequence 9 bp left to the PAM site (5 prime to 3 prime). The one-hot encoded features provide raw sequence information for the neural network to extract relevant hidden features. The two overall MH strengths were calculated from the filtered substitution matrices obtained during the step of MH-detection. The distance matrix D denotes the distance of each point to the cut site. There were in total of 41 shared features.
| 2 |
In summary, we ended up using 61 features (13 for del, 7 for ins, and 41 shared) as the input for the model.
Multistage model
inDecay model consisted of 2 modules, a ratio prediction module and an event frequency prediction module . The ratio predictor takes in the one-hot encoded sequences and predicts two scalars: the deletion ratio and the insertion ratio . A linear model was used, which was the same as Lindel [15]. The backbone of inDecay can be flexible. One can use a linear regression model if interpretability is preferred. In this study, we chose to use a multilayer perceptron (MLP) with only two hidden layers to parameterize the event predictor. The size of hidden variables was set to 128 and 64 to maintain a small model size. Additionally, we tested the backbone KAN proposed in [38], which stands for a new line of neural networks. KAN achieved similar performance and enabled new functions like symbolic regression, but it required substantially more parameters and slowed training.
A sample g with n possible events will have a feature matrix . The rate of an event was predicted by the module from the features array , depending on whether i was an insertion or deletion event:
| 3 |
Finally, the full event probability matrix was obtained by transforming the rate into probability:
| 4 |
Train and test split
For somatic cell line training, we split the entire dataset into train-val and test sets. The test set was first held out to benchmark different models, and the remaining samples acted as a train-val set. A train-val split was performed with different random seeds for different training repeats to sample a unique training dataset. Specifically for the retraining of FORECasT, we included only guides with over 1,000 total counts that mapped to the forward strand in the training process, which was required by [14]. To find a set of samples whose editing profiles were well-represented across all cell lines, we selected test set samples with the following criteria: 1) the total count of the sample was greater than 1000 in all five cell lines; 2) both the insertion ratio and deletion ratio were not 0, which was to remove insertion-free guides and deletion-free guides. Finally, 1133 guides passed the above criteria, and they were withheld during the training process.
For cross-cell line transfer learning, in each sample size setting, we randomly selected samples 10 times with different seeds, separately in the mESC and iPSC datasets. And 20% of the samples () were used for validation. The test set for each cell line was the same as the dataset used in somatic cell lines.
For few-shot learning in embryonic data, we used a leave-one-out strategy, with one gRNA for testing and the remaining data for training, 20% of which were used for validation.
Model training
All the models were developed with PyTorch version 1.12.1. Our study employed two distinct loss functions in somatic cell line training. The first was a cross-entropy loss, which was used to optimize each event predictor model based on the observed event frequency and the predicted probability P. Both Lindel and FORECasT followed the same training schema. In addition, we introduced a multinomial loss function that computed the negative log-likelihood of observing the true event counts with a multinomial distribution parameterized by the predicted probability P.
| 5 |
For few-shot learning in mouse embryonic editing data, we used a weighted cross-entropy loss that penalizes predictions further from the true label for gRNAs with larger embryo sample sizes , with an additional term to regularize the trained weights by penalizing the distance from the initial pre-trained weights . The default was set to be 0.5 for mouse and livestock fine-tuning.
| 6 |
Also, in the last layer, we applied a temperature parameter in the softmax to control the randomness of predictions by scaling the logits . The default temperature was set to be 1 for somatic cell training and 0.5 for embryonic editing data fine-tuning.
Adam optimizer was employed with a learning rate of 0.0003 for both training and few-shot learning. The weight decay parameter of Adam was set to 0.0001.
Model evaluation
Multiple metrics were included in our study to evaluate the prediction performance (also see the supplementary methods in Additional file 1 for more evaluation metrics and their definitions).
The KL divergence measures how one probability distribution differs from a second probability distribution,
| 7 |
where denoted the observed events distribution while was the predicted events distribution,
In addition, we introduced top-k precision to measure the accuracy of the most frequent events. These two metrics took the concept of precision@k and recall@k from the field of recommender systems. We refer to the metric as top-k event recall, and we normally chose k from 1, 5, and 10 to check the prediction precision at different levels in the paper.
| 8 |
In addition, Kendall’s is a correlation coefficient that measures the association between two ranked variables. It is a non-parametric statistic that evaluates the similarity of the orderings of the data.
| 9 |
Finally, we employed to measure the concordance of various ratio metrics, including frameshift proportion and deletion-insertion ratio
| 10 |
where was the predicted frameshift or deletion ratio vectors for , while was the observed frameshift or deletion ratio vectors for .
All metrics above, except those associated with R-squared, were calculated with two probability distributions. It is, therefore, possible to reuse these metrics after transforming the event probability distribution into an indel length distribution. Despite its lower resolution than the event-based distribution, the indel length distribution enables comparison of the results of different methods regardless of the coding system used.
| 11 |
where were the events that have a true ratio larger than the threshold , were the events that predicted ratio larger than the threshold , and was the number of available gRNAs. This metric will be omitted for the gRNA if Count () = 0.
The radar plot was generated using normalized performance metrics to allow direct and fair comparison of different evaluation criteria across multiple prediction methods. For each model and metric, raw performance values were normalized using min-max scaling across all models evaluated on that metric, mapping values to a common range. Metrics where lower numeric values indicate better performance (such as absolute frameshift error and Kullback–Leibler divergence of indel length distribution) were inverted prior to normalization to ensure that for all metrics, higher normalized scores consistently represent better performance. The normalized scores were then plotted on a radial coordinate system, with each axis representing one performance metric. The radar chart facilitates simultaneous visualization of multiple metrics, highlighting relative strengths and weaknesses of each prediction model.
SHAP analysis for event-level feature importance
To obtain per-feature, per-event attributions, we ran SHAP analysis on the K562-trained inDecay model using the shap package. SHAP values were computed on the pre-softmax scalar output (logit) of the three-layer module. This choice avoids cross-event coupling during explanation: because the inDecay prediction for event i within a sample is
the partition function is shared across all events of the same sample. Consequently, the gradient of with respect to the feature vector of event i equals the gradient of , and SHAP attributions computed on the logit are identical to those computed on . Computing on the logit is therefore attribution-equivalent and explains each event independently of its neighbors in the same sample.
Features were computed on the 6,234 SelfTarget-scaffold samples used to pre-train the K562 model. For each sample, candidate outcomes were generated with indelgentarget, flanking microhomology lengths were annotated using our align_map.label_mh function, and the 61-dimensional feature matrix was constructed accordingly. To focus the analysis on outcomes with biologically meaningful frequencies, we retained only the top five events per sample as ranked by the model’s predicted softmax probability. Events whose feature vectors did not match the expected 61 dimensions were discarded. Stacking across all samples yielded an explanation matrix of approximately events by 61 features, with each event labeled by its indel type (deletion or insertion).
We used the GradientExplainer from the shap package, taking the frequency regressor as the target function. Finally, a background set of 200 events and a disjoint explanation set of 2,000 events were sampled with stratification by indel type, such that the deletion-to-insertion ratio matched the full cohort. Each entry of the resulting SHAP matrix denotes the marginal contribution of feature k to . The SHAP matrix was serialized together with the feature tensor, feature names, feature group labels, and indel-type metadata for downstream analysis.
Supplementary information
Additional file 1. Supplementary methods and supplementary figures
Additional file 2. Supplementary tables as a multi-tab Excel file — Table S1, mouse gRNA guides and read counts; Table S2, livestock gRNA guides and read counts; Table S3, embryo viability and editing efficiency across electroporation conditions; Table S4, the complete 61-feature list used by inDecay. A PDF rendering of the same tables is also provided
Acknowledgements
This project is supported by the National Natural Science Foundation of China (No. 62222217 and No. 32372885), the University of Hong Kong through a startup fund and a seed fund (Y.H.), the InnoHK initiative of the Innovation and Technology Commission of the Hong Kong Special Administrative Region Government, the National Key Research and Development Program of China (2021YFA0805901-2), the Jiangsu Seed Industry Vitalization and Open Competition Project (JBGS[2021]025) and the Natural Science Foundation of Heilongjiang Province, China (ZL2024c013). We extend our sincere thanks to the TCF team and CCMR at HKU for their invaluable support.
Peer review information
Luca Pinello and Claudia Feng were the primary editors of this article and managed its editorial process and peer review in collaboration with the rest of the editorial team. The peer-review history is available in the online version of this article.
Authors' contributions
Y.H., G.L., and P.L. conceived the project. W.Z. designed the inDecay model and performed the benchmarking with the help of L.Y., Y.H., and J.W.K.H. G.L. designed and organized all the embryonic editing experiments. P.L. supplied resources for the mouse embryo editing experiments. C.W., G.W., and K.H. provided mouse embryonic editing data. H.W. provided resources for bovine, porcine, and goat embryonic editing. S.C. conducted experiments and collected editing data in porcine, goat, and bovine embryonic editing. X.L. and M.W. performed the porcine embryonic editing experiments and collected the corresponding data. J.S. and Z.L. carried out experiments and data collection in rabbit embryonic editing. G.L. and M.Z. controlled the quality of the raw editing data. L.Y. pre-processed the in-house embryonic editing data and compiled the dataset with support from W.Z., Y.H., and C.C. L.Y. performed the transfer-learning analyses and built the inDecay web interface with assistance from W.Z. and Y.H. W.Z., L.Y., and Y.H. wrote the manuscript with input from all authors. All authors read and approved the final manuscript.
Funding
This project is supported by the National Natural Science Foundation of China (No. 62222217 and No. 32372885), the Research Grants Council of the Hong Kong SAR, China (No. YCRG-C7003-24Y), the University of Hong Kong through a startup fund and a seed fund (Y.H.), the InnoHK initiative of the Innovation and Technology Commission of the Hong Kong Special Administrative Region Government, the National Key Research and Development Program of China (2021YFA0805901-2), the Jiangsu Seed Industry Vitalization and Open Competition Project (JBGS[2021]025) and the Natural Science Foundation of Heilongjiang Province, China (ZL2024c013).
Data availability
All processed data supporting the findings of this study are available in the figshare repository: “Processed CRISPR editing outcome profiles for inDecay: somatic cell lines, mouse zygotes and livestock embryos”, https://doi.org/10.6084/m9.figshare.25133564 [39]. The original self-targeting data generated by FORECasT are available at https://doi.org/10.6084/m9.figshare.7312067 [40]. The transformed self-targeting data and Sanger sequencing data required to reproduce the inDecay results can be accessed via the data download script in the GitHub repository. Decoded data tables are provided as additional files. inDecay is implemented as a standard Python package; the source code is freely available under the Apache 2.0 license at https://github.com/StatBiomed/inDecay, and an archived version is deposited on Zenodo, https://doi.org/10.5281/zenodo.20979864 [41]. All analysis notebooks are included in the repository for reproducibility, and inDecay is also available via a web interface at https://indecay.online.
Declarations
Ethics approval and consent to participate
All animal experiments were performed in compliance with the relevant institutional and national regulations on the care and use of laboratory animals and were approved by the respective animal ethics committees. Experiments performed at The University of Hong Kong and Genome Technologies Limited were approved by the Committee on the Use of Live Animals in Research (CULATR) of The University of Hong Kong (CULATR 5803-21). Experiments performed at Northeast Agricultural University were approved by the Experimental Animal Welfare and Ethics Committee of Northeast Agricultural University (NEAU20240114). Experiments performed at the Jiangsu Academy of Agricultural Sciences were approved by the Research Committee of the Jiangsu Academy of Agricultural Sciences, following the Regulations for the Administration of Affairs Concerning Experimental Animals. Oocytes from bovine, goat, and porcine sources were collected from local abattoirs, and mice were euthanized via cervical dislocation at the study endpoints.
Consent for publication
Not applicable.
Competing interests
Y. H. is an Editorial Board Member for Genome Biology but not involved in the editorial process of this manuscript.
Footnotes
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Weizhong Zheng and Lu Yu co-first authors.
Contributor Information
Huili Wang, Email: wanghuili318@163.com.
Pentao Liu, Email: pliu88@hku.hk.
Guocheng Lan, Email: lan01@baizegtl.com.
Yuanhua Huang, Email: yuanhua@hku.hk.
References
- 1.Jinek M, Chylinski K, Fonfara I, Hauer M, Doudna JA, Charpentier E. A programmable dual-RNA-guided DNA endonuclease in adaptive bacterial immunity. Science. 2012;337(6096):816–21. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Cong L, Ran FA, Cox D, Lin S, Barretto R, Habib N, et al. Multiplex genome engineering using CRISPR/Cas systems. Science. 2013;339(6121):819–23. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Ran FA, Hsu PD, Wright J, Agarwala V, Scott DA, Zhang F. Genome engineering using the CRISPR-Cas9 system. Nat Protoc. 2013;8(11):2281–308. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Polak P, Karlić R, Koren A, Thurman R, Sandstrom R, Lawrence MS, et al. Cell-of-origin chromatin organization shapes the mutational landscape of cancer. Nature. 2015;518(7539):360–4. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Blanpain C, Mohrin M, Sotiropoulou PA, Passegué E. DNA-damage response in tissue-specific and cancer stem cells. Cell Stem Cell. 2011;8(1):16–29. [DOI] [PubMed] [Google Scholar]
- 6.Bowling S, Sritharan D, Osorio FG, Nguyen M, Cheung P, Rodriguez-Fraticelli A, et al. An engineered CRISPR-Cas9 mouse line for simultaneous readout of lineage histories and gene expression profiles in single cells. Cell. 2020;181(6):1410–22. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Eker A, Quayle C, Chaves I, Van der Horst G. DNA repair in mammalian cells: Direct DNA damage reversal: elegant solutions for nasty problems. Cell Mol Life Sci. 2009;66:968–80. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Ceccaldi R, Rondinelli B, D’Andrea AD. Repair pathway choices and consequences at the double-strand break. Trends Cell Biol. 2016;26(1):52–64. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.Liu M, Zhang W, Xin C, Yin J, Shang Y, Ai C, et al. Global detection of DNA repair outcomes induced by CRISPR–Cas9. Nucleic Acids Res. 2021;49(15):8732–42. 10.1093/nar/gkab686. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Xue C, Greene EC. DNA Repair Pathway Choices in CRISPR-Cas9-Mediated Genome Editing. Trends Genet. 2021;37(7):639–56. 10.1016/j.tig.2021.02.008. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Bothmer A, Phadke T, Barrera LA, Margulies CM, Lee CS, Buquicchio F, et al. Characterization of the interplay between DNA repair and CRISPR/Cas9-induced DNA lesions at an endogenous locus. Nat Commun. 2017. 10.1038/ncomms13905. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.van Overbeek M, Capurso D, Carter MM, Thompson MS, Frias E, Russ C, et al. DNA repair profiling reveals nonrandom outcomes at Cas9-mediated breaks. Mol Cell. 2016;63(4):633–46. [DOI] [PubMed] [Google Scholar]
- 13.Shen MW, Arbab M, Hsu JY, Worstell D, Culbertson SJ, Krabbe O, et al. Predictable and precise template-free CRISPR editing of pathogenic variants. Nature. 2018;563(7733):646–51. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Allen F, Crepaldi L, Alsinet C, Strong AJ, Kleshchevnikov V, De Angeli P, et al. Predicting the mutations generated by repair of Cas9-induced double-strand breaks. Nat Biotechnol. 2019;37(1):64–72. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Chen W, McKenna A, Schreiber J, Haeussler M, Yin Y, Agarwal V, et al. Massively parallel profiling and predictive modeling of the outcomes of CRISPR/Cas9-mediated double-strand break repair. Nucleic Acids Res. 2019;47(15):7989–8003. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Fuchs E, Blau HM. Tissue stem cells: architects of their niches. Cell Stem Cell. 2020;27(4):532–56. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.da Silva JF, Meyenberg M, Loizou JI. Tissue specificity of DNA repair: the CRISPR compass. Trends Genet. 2021;37(11):958–62. [DOI] [PubMed] [Google Scholar]
- 18.Khokhlova EV, Fesenko ZS, Sopova JV, Leonova EI. Features of DNA Repair in the Early Stages of Mammalian Embryonic Development. Genes. 2020;11(10):1138. 10.3390/genes11101138. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Tichy ED, Stambrook PJ. DNA repair in murine embryonic stem cells and differentiated cells. Exp Cell Res. 2008;314(9):1929–36. 10.1016/j.yexcr.2008.02.007. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Morozumi R, Shimizu N, Tamura K, Nakamura M, Suzuki A, Ishiniwa H, et al. Changes in repair pathways of radiation-induced DNA double-strand breaks at the midblastula transition in Xenopus embryo. J Radiat Res. 2024;65(3):315–22. 10.1093/jrr/rrae012. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Naert T, Tulkens D, Van Nieuwenhuysen T, Przybyl J, Demuynck S, van de Rijn M, et al. CRISPR-SID: identifying EZH2 as a druggable target for desmoid tumors via in vivo dependency mapping. Proc Natl Acad Sci. 2021;118(47):e2115116118. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Naert T, Tulkens D, Edwards N, Carron M, Shaidani N, Wlizla M. Maximizing CRISPR/Cas9 phenotype penetrance applying predictive modeling of editing outcomes in Xenopus and zebrafish embryos. Sci Rep. 2020. 10.1038/s41598-020-71412-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Brinkman EK, Chen T, de Haas M, Holland HA, Akhtar W, van Steensel B. Kinetics and Fidelity of the Repair of Cas9-Induced Double-Strand DNA Breaks. Mol Cell. 2018;70(5):801-813.e6. 10.1016/j.molcel.2018.04.016. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Lin Y, Li J, Li C, Tu Z, Li S, Li XJ, et al. Application of CRISPR/Cas9 system in establishing large animal models. Front Cell Dev Biol. 2022;10:919155. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Fischer K, Schnieke A. How genome editing changed the world of large animal research. Front Genome Editing. 2023;5:1272687. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Hussmann JA, Ling J, Ravisankar P, Yan J, Cirincione A, Xu A, et al. Mapping the genetic landscape of DNA double-strand break repair. Cell. 2021;184(22):5653–69. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Gaj T, Gersbach CA, Barbas CF. ZFN, TALEN, and CRISPR/Cas-based methods for genome engineering. Trends Biotechnol. 2013;31(7):397–405. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Owens DDG, Caulder A, Frontera V, Harman JR, Allan AJ, Bucakci A, et al. Microhomologies are prevalent at Cas9-induced larger deletions. Nucleic Acids Res. 2019;47(14):7402–17. 10.1093/nar/gkz459. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Kosicki M, Allen F, Steward F, Tomberg K, Pan Y, Bradley A. Cas9-induced large deletions and small indels are controlled in a convergent fashion. Nat Commun. 2022;13(1):3422. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 30.Hwang GH, Lee SH, Oh M, Kim S, Habib O, Jang HK, et al. Large DNA deletions occur during DNA repair at 20-fold lower frequency for base editors and prime editors than for Cas9 nucleases. Nat Biomed Eng. 2025;9(1):79–92. [DOI] [PMC free article] [PubMed]
- 31.Bath ML. Inhibition of in vitro fertilizing capacity of cryopreserved mouse sperm by factors released by damaged sperm, and stimulation by glutathione. PLoS ONE. 2010;5(2):e9387. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Agung B, Otoi T, Di F, Senbon S, Onishi A, Nagai T. In vitro fertilization and development of porcine oocytes matured in follicular fluid. J Reprod Dev. 2013;59(2):103–6. [DOI] [PMC free article] [PubMed]
- 33.Speckhart SL, Wooldridge LK, Ealy AD. An updated protocol for in vitro bovine embryo production. STAR Protoc. 2023;4(1):101924. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 34.Souza-Fabjan JMG, Locatelli Y, Duffard N, Corbin E, Touzé JL, Perreau C, et al. In vitro embryo production in goats: slaughterhouse and laparoscopic ovum pick up-derived oocytes have different kinetics and requirements regarding maturation media. Theriogenology. 2014;81(8):1021–31. [DOI] [PubMed] [Google Scholar]
- 35.Liu X, Wang S, Ai D. Predicting CRISPR/Cas9 repair outcomes by attention-based deep learning framework. Cells. 2022;11(11):1847. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Bloh K, Kanchana R, Bialk P, Banas K, Zhang Z, Yoo BC, et al. Deconvolution of complex DNA repair (DECODR): establishing a novel deconvolution algorithm for comprehensive analysis of CRISPR-edited sanger sequencing data. CRISPR J. 2021;4(1):120–31. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Ma H, Tu LC, Naseri A, Huisman M, Zhang S, Grunwald D, et al. CRISPR-Cas9 nuclear dynamics and target recognition in living cells. J Cell Biol. 2016;214(5):529–37. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 38.Liu Z, Wang Y, Vaidya S, Ruehle F, Halverson J, Soljačić M, et al. KAN: Kolmogorov-Arnold Networks. 2024. arXiv preprint arXiv:2404.19756.
- 39.Zheng W, Yu L, Processed HY, CRISPR editing outcome profiles for inDecay: somatic cell lines, mouse zygotes and livestock embryos. Datasets. FigShare. 2026. 10.6084/m9.figshare.25133564. [DOI]
- 40.Allen F, Crepaldi L, Alsinet C, et al. Processed mutational profiles (FORECasT self-targeting dataset). Datasets. FigShare. 2018. 10.6084/m9.figshare.7312067. [DOI]
- 41.Zheng W, Yu L, Huang Y. inDecay: few-shot prediction of CRISPR editing outcomes. 2026. Zenodo. 10.5281/zenodo.20979864. [DOI]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Additional file 1. Supplementary methods and supplementary figures
Additional file 2. Supplementary tables as a multi-tab Excel file — Table S1, mouse gRNA guides and read counts; Table S2, livestock gRNA guides and read counts; Table S3, embryo viability and editing efficiency across electroporation conditions; Table S4, the complete 61-feature list used by inDecay. A PDF rendering of the same tables is also provided
Data Availability Statement
All processed data supporting the findings of this study are available in the figshare repository: “Processed CRISPR editing outcome profiles for inDecay: somatic cell lines, mouse zygotes and livestock embryos”, https://doi.org/10.6084/m9.figshare.25133564 [39]. The original self-targeting data generated by FORECasT are available at https://doi.org/10.6084/m9.figshare.7312067 [40]. The transformed self-targeting data and Sanger sequencing data required to reproduce the inDecay results can be accessed via the data download script in the GitHub repository. Decoded data tables are provided as additional files. inDecay is implemented as a standard Python package; the source code is freely available under the Apache 2.0 license at https://github.com/StatBiomed/inDecay, and an archived version is deposited on Zenodo, https://doi.org/10.5281/zenodo.20979864 [41]. All analysis notebooks are included in the repository for reproducibility, and inDecay is also available via a web interface at https://indecay.online.
