build_condition: Construct logical condition to query database

Description Usage Arguments Value Author(s) Examples

View source: R/build_condition.R

Description

Given a list of filters, this function builds a logical condition to query database. The output is used in get_dataset().

Usage

1
build_condition(regulondb, dataset, filters, operator, interval, partialmatch)

Arguments

regulondb

A regulondb() object.

dataset

dataset of interest

filters

List of filters to be used. The names should correspond to the attribute and the values correspond to the condition for selection.

operator

A string indicating if all the filters (AND) or some of them (OR) should be met

interval

the filters with values considered as interval

partialmatch

name of the condition(s) with a string pattern for full or partial match in the query

Value

A character(1) with the sql logical condition to query the dataset .

Author(s)

Carmina Barberena Jonás, Jesús Emiliano Sotelo Fonseca, José Alquicira Hernández, Joselyn Chávez

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Connect to the RegulonDB database if necessary
if (!exists("regulondb_conn")) regulondb_conn <- connect_database()

## Build the regulon db object
e_coli_regulondb <-
    regulondb(
        database_conn = regulondb_conn,
        organism = "E.coli",
        database_version = "1",
        genome_version = "1"
    )

## Build the condition for ara
build_condition(
    e_coli_regulondb,
    dataset = "GENE",
    filters = list(
        name = c("ara"),
        strand = c("forward"),
        posright = c("2000", "40000")
    ),
    operator = "AND",
    interval = "posright",
    partialmatch = "name"
)

regutools documentation built on Dec. 20, 2020, 2 a.m.