Browse code

Fixed getTssObjectFromTxObject

Jean-Philippe Fortin authored on 17/07/2024 18:24:49
Showing 3 changed files

... ...
@@ -1,6 +1,6 @@
1 1
 Package: crisprDesign
2 2
 Title: Comprehensive design of CRISPR gRNAs for nucleases and base editors
3
-Version: 1.7.0
3
+Version: 1.7.1
4 4
 Authors@R: c(
5 5
     person("Jean-Philippe", "Fortin", email = "[email protected]", role = c("aut", "cre")),
6 6
     person("Luke", "Hoberecht", email = "[email protected]", role = c("aut"))
... ...
@@ -24,13 +24,14 @@ getTssObjectFromTxObject <- function(txObject){
24 24
     tss <- tss[!duplicated(mcols(tss)[,cols])]
25 25
     tss$promoter <- tss$tx_id
26 26
     tss$ID <- paste0(tss$gene_id, "_", tss$promoter, recycle0=TRUE)
27
+
27 28
     # Making sure we only retain one coordinate:
28
-    if (length(tss) > 0){
29
-        if (as.character(strand(tss))[[1]]=="+"){
30
-            end(tss) <- start(tss)
31
-        } else {
32
-            start(tss) <- end(tss)
33
-        }
34
-    }
29
+    whPos <- which(strand(tss) == "+")
30
+    whNeg <- which(strand(tss) == "-")
31
+    end(tss)[whPos] <- start(tss)[whPos]
32
+    start(tss)[whNeg] <- end(tss)[whNeg]
33
+    
35 34
     return(tss)
36 35
 }
36
+
37
+
... ...
@@ -3,6 +3,13 @@
3 3
 \encoding{UTF-8}
4 4
 
5 5
 
6
+\section{Version 1.7.1}{
7
+\itemize{
8
+    \item Fixed getTssObjectFromTxObject for negative strand.
9
+}
10
+}
11
+
12
+
6 13
 \section{Version 1.5.2}{
7 14
 \itemize{
8 15
     \item Added function addReinitiationFlag.