readCNERangesFromSQLite: readCNERangesFromSQLite function

Description Usage Arguments Value Author(s) Examples

View source: R/IO-methods.R

Description

Query the SQLite database based on chromosome, coordinates and some other criteria. Primarily not intended to be used directly. For the CNE density plot, fetchCNEDensity function should be used.

Usage

1
2
3
readCNERangesFromSQLite(dbName, tableName, chr=NULL, start=NULL, end=NULL,
                        whichAssembly=c("first","second"), minLength=NULL,
                        tAssemblyFn=NULL, qAssemblyFn=NULL)

Arguments

dbName

A object of character, the path of the local SQLite database.

tableName

A object of character, the name of table for this CNE data table.

chr

character(n): the chromosomes to query. When it's NULL, all CNEs will be returned.

start, end

integer(n): the start and end coordinates to fetch the CNEs.

whichAssembly

character(1): The coordinates to fetch CNEs are based on ‘first’ genome or ‘last’ genome.

minLength

integer(1): the minimal length for selected CNEs. The pair of CNEs must be both longer than this minLength.

tAssemblyFn,qAssemblyFn

character(1): filename of the ‘twoBit’ or ‘fasta’ file for the target and query genome.

Value

An object of GRangePairs is returned.

Author(s)

Ge Tan

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
26
27
28
29
30
31
32
33
34
35
36
  dbName <- file.path(system.file("extdata", package="CNEr"),
                    "danRer10CNE.sqlite")
  tableName <- "danRer10_hg38_45_50"
  
  qAssemblyFn <- file.path(system.file("extdata",
                           package="BSgenome.Hsapiens.UCSC.hg38"),
                           "single_sequences.2bit")
  tAssemblyFn <- file.path(system.file("extdata",
                           package="BSgenome.Drerio.UCSC.danRer10"),
                           "single_sequences.2bit")
                           
  ## single chr, start, end
  chr <- "chr6"
  start <- 24000000L
  end <-  27000000
  minLength <- 50L
  fetchedCNERanges <- readCNERangesFromSQLite(dbName, tableName, chr, 
                                              start, end, 
                                              whichAssembly="first",
                                              minLength=minLength,
                                              tAssemblyFn=tAssemblyFn,
                                              qAssemblyFn=qAssemblyFn)
  ## multiple chr, start, end
  chr=c("chr1", "chr3")
  start=c(90730248, 137523122)
  end=c(90730300, 137523190)
  fetchedCNERanges <- readCNERangesFromSQLite(dbName, tableName, chr, 
                                              start, end, 
                                              whichAssembly="second",
                                              minLength=minLength)
  
  ## chr, NULL, NULL
  fetchedCNERanges <- readCNERangesFromSQLite(dbName, tableName, chr, 
                                              start=NULL, end=NULL,
                                              whichAssembly="second",
                                              minLength=minLength)

CNEr documentation built on Nov. 8, 2020, 5:36 p.m.