setdiff {RGMQL} | R Documentation

## Method setdiff

### Description

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 joinBy clause is used to extract a subset of pairs from the Cartesian product of the two input datasets x and 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.

### Usage

    ## S4 method for signature 'GMQLDataset,GMQLDataset'
    setdiff(x, y, joinBy = conds(),
      is_exact = FALSE)

### Arguments

`x` | GMQLDataset class object
`y` | GMQLDataset class object
`joinBy` | `conds` function to support methods with groupBy or JoinBy input parameter
`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

### Value

GMQLDataset object. It contains the value to use as input for the subsequent GMQLDataset method

### Examples

    ## 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

    init_gmql()
    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"))

[Package RGMQL version 1.6.0 Index]