semijoin {RGMQL} | R Documentation

## Semijoin condition

### Description

This function is used as support to the filter method to define semijoin conditions on metadata

### Usage

    semijoin(.data, is_in = TRUE, groupBy)

### Arguments

`.data` | GMQLDataset class object
`is_in` | logical value: TRUE => for a given sample of input dataset '.data' in `filter` method, if and only if there exists at least one sample in dataset 'data' with metadata attributes defined in groupBy and these attributes of 'data' have at least one value in common with the same attributes defined in at least one sample of '.data' in `filter` method, FALSE => semijoin condition is evaluated accordingly.
`groupBy` | `condition_evaluation` function to support methods with groupBy or JoinBy input paramter

### Value

semijoin condition as list

### 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 GMQL datasets
    ## named "data" and "join_data", respectively

    init_gmql()
    test_path <- system.file("example", "DATASET", package = "RGMQL")
    test_path2 <- system.file("example", "DATASET_GDM", package = "RGMQL")
    data <- read_gmql(test_path)
    join_data <-  read_gmql(test_path2)

    ## This statement creates a new dataset called 'jun_tf' by selecting those
    ## samples and their regions from the existing 'data' dataset such that:
    ## Each output sample has a metadata attribute called antibody_target
    ## with value JUN.
    ## Each output sample also has not a metadata attribute called cell
    ## that has the same value of at least one of the values that a metadata
    ## attribute equally called cell has in at least one sample
    ## of the 'join_data' dataset.
    ## For each sample satisfying previous conditions, only its regions that
    ## have a region attribute called pValue with the associated value
    ## less than 0.01 are conserved in output

    jun_tf <- filter(data, antibody_target == "JUN", pvalue < 0.01,
        semijoin(join_data, FALSE, conds("cell")))

[Package RGMQL version 1.10.0 Index]