Browse code

version 1.9.42

fix the error when no CNEs in CNEDensity

Ge Tan authored on 04/10/2016 16:58:59
Showing 2 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: CNEr 
2
-Version: 1.9.41
2
+Version: 1.9.42
3 3
 Date: 2016-10-04
4 4
 Title: CNE Detection and Visualization
5 5
 Description: Large-scale identification and advanced visualization 
... ...
@@ -31,6 +31,16 @@ CNEDensity <- function(dbName, tableName, chr, start, end,
31 31
   rangesPair <- readCNERangesFromSQLite(dbName, tableName, chr,
32 32
                                     context_start, context_end, 
33 33
                                     whichAssembly, minLength)
34
+  ## When no CNEs are returned
35
+  if(length(rangesPair) == 0L){
36
+    ans <- GRanges(seqnames=chr,
37
+                   ranges=IRanges(start=context_start,
38
+                                  end=context_end),
39
+                   strand="*",
40
+                   score=0)
41
+    return(ans)
42
+  }
43
+  
34 44
   if(whichAssembly == "first"){
35 45
     ranges <- first(rangesPair)
36 46
   }else if(whichAssembly == "second"){