% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gmql_difference.R
\title{Method setdiff}
\S4method{setdiff}{GMQLDataset,GMQLDataset}(x, y, joinBy = conds(), is_exact = FALSE)
\item{x}{GMQLDataset class object}

\item{y}{GMQLDataset class object}

\item{joinBy}{\code{\link{conds}} function to support methods with 
groupBy or JoinBy input parameter}

\item{is_exact}{single logical value: TRUE means that the region difference 
is executed only on regions in 'x' dataset with exactly the same 
coordinates of at least one region present in 'y' dataset; 
if is_exact = FALSE, the difference is executed on all regions in 
'x' dataset that overlap (even just one base) with at least one region in 
'y' dataset}
GMQLDataset object. It contains the value to use as input 
for the subsequent GMQLDataset method
Wrapper to GMQL DIFFERENCE operator

It produces one sample in the result for each sample of the 
left operand, by keeping the same metadata of the left input sample 
and only those regions (with their attributes and values) of the left input 
sample which do not intersect with any region in any right operand sample.
The optional \emph{joinBy} clause is used to extract a subset of pairs
from the Cartesian product of the two input datasets \emph{x} and \emph{y} 
on which to apply the DIFFERENCE operator:
only those samples that have the same value for each specified metadata 
attribute are considered when performing the difference.
## This statement initializes and runs the GMQL server for local execution 
## and creation of results on disk. Then, with system.file() it defines 
## the path to the folders "DATASET" and "DATASET_GDM" in the subdirectory 
## "example" of the package "RGMQL" and opens such folders as a GMQL 
## datasets named "data1" and "data2", respectively, using CustomParser

test_path <- system.file("example", "DATASET", package = "RGMQL")
test_path2 <- system.file("example", "DATASET_GDM", package = "RGMQL")
data1 = read_gmql(test_path)
data2 = read_gmql(test_path2)

## This statement returns all the regions in the first dataset 
## that do not overlap any region in the second dataset.

out = setdiff(data1, data2)

## This statement extracts for every pair of samples s1 in data1 
## and s2 in data2 having the same value of the metadata 
## attribute 'cell' the regions that appear in s1 but 
## do not overlap any region in s2.
## Metadata of the result are the same as the metadata of s1.

out_t = setdiff(data1, data2, conds("cell"))