... | ... |
@@ -20,7 +20,10 @@ |
20 | 20 |
{ |
21 | 21 |
schema_name <- list.files(datasetName, pattern = "*.schema$", |
22 | 22 |
full.names = TRUE) |
23 |
- if(length(schema_name)==0) |
|
23 |
+ schema_name_xml <- list.files(datasetName, pattern = "*.xml$", |
|
24 |
+ full.names = TRUE) |
|
25 |
+ |
|
26 |
+ if(length(schema_name)==0 || length(schema_name_xml) == 0) |
|
24 | 27 |
stop("schema not present") |
25 | 28 |
|
26 | 29 |
xml_schema <- xml2::read_xml(schema_name) |
... | ... |
@@ -89,45 +89,29 @@ setMethod("merge", c("GMQLDataset","GMQLDataset"), |
89 | 89 |
ptr_data_y <- y@value |
90 | 90 |
joinBy = list(...) |
91 | 91 |
gmql_join(ptr_data_x, ptr_data_y, genometric_predicate, |
92 |
- joinBy, region_output="contig") |
|
92 |
+ joinBy, region_output) |
|
93 | 93 |
}) |
94 | 94 |
|
95 | 95 |
|
96 |
-gmql_join <- function(right_data, left_data, genometric_predicate, joinBy, |
|
97 |
- region_output="contig") |
|
96 |
+gmql_join <- function(left_data, right_data, genometric_predicate, joinBy, |
|
97 |
+ region_output) |
|
98 | 98 |
{ |
99 | 99 |
if(!is.null(genometric_predicate)) |
100 | 100 |
{ |
101 |
+ if(length(genometric_predicate) >4) |
|
102 |
+ stop("genometric_predicate: only 4 DISTAL condition") |
|
103 |
+ |
|
101 | 104 |
if(!is.list(genometric_predicate)) |
102 |
- stop("genometric_predicate must be list of lists") |
|
105 |
+ stop("genometric_predicate must be a list") |
|
103 | 106 |
|
104 |
- #if(!all(sapply(genometric_predicate, function(x) is.list(x) ))) |
|
105 |
- # stop("genometric_predicate must be list of lists") |
|
106 |
- |
|
107 |
- #lapply(genometric_predicate, function(list_pred) { |
|
108 |
- # if(length(list_pred)>4) |
|
109 |
- #{ |
|
110 |
- # warning("only 4 element per list, we cut the rest") |
|
111 |
- # length(list_pred)=4 |
|
112 |
- #} |
|
113 | 107 |
if(!all(sapply(genometric_predicate, function(x) {is(x,"DISTAL")} ))) |
114 | 108 |
stop("All elements should be DISTAL object") |
115 |
- #}) |
|
116 |
- |
|
117 |
- #genomatrix <- t(sapply(genometric_predicate, function(list_pred) { |
|
109 |
+ |
|
118 | 110 |
genomatrix <- t(sapply(genometric_predicate, function(x) { |
119 | 111 |
new_value = as.character(x) |
120 | 112 |
array <- c(new_value) |
121 | 113 |
})) |
122 |
- na_matrix <- matrix("NA", nrow = 3, ncol = 2) |
|
123 |
- genomatrix <- rbind(genomatrix,na_matrix) |
|
124 |
- col <- dim(genomatrix)[1] |
|
125 |
- if(col>4) |
|
126 |
- { |
|
127 |
- array <- seq(5, to = col) |
|
128 |
- genomatrix <- genomatrix[-array,] |
|
129 |
- } |
|
130 |
- # })) |
|
114 |
+ |
|
131 | 115 |
genomatrix <- .jarray(genomatrix, dispatch = TRUE) |
132 | 116 |
} |
133 | 117 |
else |