select {RGMQL} | R Documentation

## Method select

### Description

Wrapper to GMQL PROJECT operator

It creates, from an existing dataset, a new dataset with all the samples from input dataset, but keeping for each sample in the input dataset only those metadata and/or region attributes specified. Region coordinates and values of the remaining metadata and/or region attributes remain equal to those in the input dataset. It allows to:

- Remove existing metadata and/or region attributes from a dataset

- Update or set new metadata and/or region attributes in the result

### Usage

    ## S4 method for signature 'GMQLDataset'
    select(
      .data,
      metadata = NULL,
      metadata_update = NULL,
      all_but_meta = FALSE,
      regions = NULL,
      regions_update = NULL,
      all_but_reg = FALSE
    )

### Arguments

`.data` | GMQLDataset class object
`metadata` | vector of strings made up by metadata attributes
`metadata_update` | list of updating rules in the form of key = value generating new metadata attributes and/or attribute values. The following options are available: All aggregation functions already defined by AGGREGATES object All basic mathematical operations (+, -, *, /), including parenthesis SQRT constructor object defined by OPERATOR object
`all_but_meta` | logical value indicating which metadata you want to exclude; If FALSE, only the metadata attributes specified in metadata argument are kept in the output of the operation; if TRUE, the metadata are all kept except those in metadata argument. If metadata input parameter is not defined all_but_meta is not considerd.
`regions` | vector of strings made up by region attributes
`regions_update` | list of updating rules in the form of key = value generating new genomic region attributes and/or values. The following options are available: All aggregation functions already defined by AGGREGATES object All basic mathematical operations (+, -, *, /), including parenthesis SQRT, META, NIL constructor objects defined by OPERATOR object
`all_but_reg` | logical value indicating which region attributes you want to exclude; if FALSE, only the regions attributes specified in regions argumentare kept in the output of the operation; if TRUE, the regions attributes are all kept except those in regions argument. If regions is not defined, all_but_reg is not considerd.

### 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 folder "DATASET" in the subdirectory "example"
    ## of the package "RGMQL" and opens such folder as a GMQL dataset
    ## named "data"

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

    ## This statement creates a new dataset called CTCF_NORM_SCORE by preserving
    ## all region attributes apart from score, and creating a new region
    ## attribute called new_score by dividing the existing score value of each
    ## region by 1000.0 and incrementing it by 100.
    ## It also generates, for each sample of the new dataset,
    ## a new metadata attribute called normalized with value 1,
    ## which can be used in future selections.

    CTCF_NORM_SCORE = select(data, metadata_update = list(normalized = 1),
        regions_update = list(new_score = (score / 1000.0) + 100),
        regions = c("score"), all_but_reg = TRUE)

[Package RGMQL version 1.14.1 Index]