LihuaJulieZhu / CRISPRseek

Design of target-specific guide RNAs in CRISPR-Cas9, genome-editing systems
5 stars 2 forks source link

Bug fix and code indentation #3

Closed hukai916 closed 2 years ago

hukai916 commented 2 years ago
  1. Fixed a bug in findgRNAs::.getgRNA.cut.sites(): basically after
    starts.gRNA <- subset(starts.gRNA, starts.gRNA <= (seq.len - gRNA.size + 1))
    starts.gRNA <- subset(starts.gRNA, starts.gRNA > 0)

    starts.gRNA can be empty, leading to https://support.bioconductor.org/p/9140582/

Fixed by adding "if (length(starts.gRNA))":

if (length(starts.gRNA)) {
  if (reverse.subject) {
    gRNAs.cut <- cbind(seq, paste( subjectname,"_gR",
                      (seq.len - (starts.gRNA + cut.site -1 ) + 1), "r", sep = ""),
                      (seq.len - starts.gRNA + 1), "-", extendedSequence)

  } else {
    gRNAs.cut <- cbind(seq, paste(subjectname,"_gR", (starts.gRNA + cut.site - 1),
                       "f", sep = ""), starts.gRNA, "+", extendedSequence)
  }
} else {
  gRNAs.cut <- ""
}
  1. The indentations and formatting were crazy in findgRNAs::.getgRNA.cut.sites() and findgRNAs::findgRNAs(), cleaned them.
LihuaJulieZhu commented 2 years ago

I have done this part via a different route. Thanks though!