crisprVerse / crisprDesign

Comprehensive design of CRISPR gRNAs for nucleases and base editors
MIT License
19 stars 6 forks source link

`addEditedAlleles()` fails when the guide sequence is not editable #33

Closed RussBainer closed 4 months ago

RussBainer commented 5 months ago

Hi JP and Team, really enjoying this set of tools.

I've run into an error from the addEditingWeights() function that occurs when the targeted sequence doesn't have any nucleotides with values greater than zero in the base editor weight matrix.

I'm not sure how you'd want to address circumstances like this in terms of the functionality of the code, so I thought I'd raise it as an issue instead of a PR. I think you can resolve it on line 220 of addEditedAlleles.R by checking length(nNucs) > 0. For example:

> crisprDesign:::.getExtendedSequences(gs, start = editingWindow[1], 
+                                      end = editingWindow[2])
spacer_1160 
   "GGGTGGTTGGGGT" 
> addEditedAlleles(gs, baseEditor = abe, txTable = txtable, editingWindow = win)
[addEditedAlleles] Obtaining edited alleles at each gRNA target site.
Error in -out$score : invalid argument to unary operator
Jfortin1 commented 5 months ago

Hi @RussBainer, taking a look at it right now

Jfortin1 commented 5 months ago

Pushed a fix; let me know if that works

RussBainer commented 4 months ago

Sorry @Jfortin1 ! I just realized that my github notifications were going to my old work email.

This looks like a good fix. Thanks!