crisprVerse / crisprBowtie

Bowtie-based alignment of CRISPR gRNA spacer sequences
MIT License
2 stars 0 forks source link

crisprVerse issue with the function addSpacerAlignmentsIterative #1

Closed edoardobertolini closed 1 year ago

edoardobertolini commented 1 year ago

Hi Jean-Philippe,

thanks for this great R package.

I would like to use crisprVerse package to design gRNAs in plant species and speed up the CRISPR construct design.

I have tested the package with the new sorghum genome (JGIv5) but I think something went wrong with the function addSpacerAlignmentsIterative

In particular, I do see differences in the results when I run the functions addSpacerAlignmentsIterative and runCrisprBowtie .

Although the parameter I used were the same ( bowtie, # mismatches, the two functions reported different results for the 21 spacers found :

Please see output below.

In addition, only few alignments derived from addSpacerAlignmentsIterative were properly stored in the S4 object guideSet:

image

For reproducibility, I have created a google drive folder with the data used and the R code to run the analysis: https://drive.google.com/drive/folders/1SP7ijDdpKqB1ElWSpfAyewIsM0CJm2lJ?usp=share_link

These are the outputs for a quick look:

addSpacerAlignmentsIterative(guideSet,
                                         aligner_index="Documents/Ref_sorghum/v5.1/assembly/Sbicolor_730_v5.0", #change the path to the index according to your local DIR
                                         aligner="bowtie",
                                         bsgenome=bsgenome,
                                         n_mismatches=3,
                                         both_strands = TRUE,
                                         canonical = FALSE)

[runCrisprBowtie] Using BSgenome.Sbicolor.JGI.sorBic5 [runCrisprBowtie] Searching for SpCas9 protospacers reads processed: 21 reads with at least one alignment: 21 (100.00%) reads that failed to align: 0 (0.00%) Reported 21 alignments [runCrisprBowtie] Using BSgenome.Sbicolor.JGI.sorBic5
[runCrisprBowtie] Searching for SpCas9 protospacers reads processed: 21 reads with at least one alignment: 21 (100.00%) reads that failed to align: 0 (0.00%) Reported 22 alignments [runCrisprBowtie] Using BSgenome.Sbicolor.JGI.sorBic5
[runCrisprBowtie] Searching for SpCas9 protospacers reads processed: 21 reads with at least one alignment: 21 (100.00%) reads that failed to align: 0 (0.00%) Reported 75 alignments [runCrisprBowtie] Using BSgenome.Sbicolor.JGI.sorBic5
[runCrisprBowtie] Searching for SpCas9 protospacers reads processed: 21 reads with at least one alignment: 21 (100.00%) reads that failed to align: 0 (0.00%) Reported 1384 alignments

crisprNuclease <- SpCas9
spacers <- as.character(protospacers(guideSet))
runCrisprBowtie(spacers,
                crisprNuclease=crisprNuclease,
                n_mismatches=3,
                canonical=FALSE,
                all_alignments = TRUE,
                bowtie_index="Documents/Ref_sorghum/v5.1/assembly/Sbicolor_730_v5.0")  #change the path to the index according to your local DIR

[runCrisprBowtie] Searching for SpCas9 protospacers reads processed: 84 reads with at least one alignment: 84 (100.00%) reads that failed to align: 0 (0.00%) Reported 178 alignments

Thanks, Edo

Jfortin1 commented 1 year ago

@edoardobertolini Thanks for reporting this, and sharing your reproducible code, much appreciated! Investigating the problem right now and we'll get back to you soon.

Jfortin1 commented 1 year ago

@edoardobertolini The discrepancy comes from the fact that the addSpacerAlignments and addSpacerAlignmentsIterative has an argument standard_chr_only set to TRUE by default, which retains standard chromosomes for human and mouse, which is not relevant for other species; setting it to FALSE resolves this issue for your example.

The default should be set to FALSE, we will change that immediately. Thanks!

edoardobertolini commented 1 year ago

Thank you!