fixSeqInfo: Generate a list of genomic features GRangesList objects

Description Usage Arguments Value Examples

View source: R/fixSeqInfo.R

Description

This function extracts and filters gene, upstream and downstream features from a GenomicFeatures object.

Usage

1
2
fixSeqInfo(first = NULL, second = NULL, TxDb = NULL,
  method = c("first", "second", "union", "txdb"))

Arguments

first

A GenomicRanges or GenomicRanges object.

second

An optional GenomicRanges or GenomicRanges object.

TxDb

A GenomicFeatures object. It must contain GenomeInfoDb information.

method

A character string indicating which reference should be used to assign the seqlevels. One of 'first' (default), 'second', 'union', "txdb": can be abbreviated.

Value

A list of GenomicRanges or GenomicRanges object(s).

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
library("TxDb.Dmelanogaster.UCSC.dm3.ensGene")

TxDb = TxDb.Dmelanogaster.UCSC.dm3.ensGene

first = GRanges(c("chr4", "chr2L"), IRanges(c(10, 20), c(30, 30)), c("-", "+"))
second = GRanges(c("chr4", "chr3R"), IRanges(c(10, 20), c(30, 30)), c("-", "+"))

# Assign seqlevels and seqinfo from a TxDb object
fixList = fixSeqInfo(first, TxDb=TxDb)
sapply(fixList, head)
sapply(fixList, seqlevels)
sapply(fixList, seqinfo)

# Assign the seqlevels of the first to the second object
fixList = fixSeqInfo(first, second, method="first")
sapply(fixList, head)
sapply(fixList, seqlevels)
sapply(fixList, seqinfo)

# Assign the union of the seqlevels to both objects
fixList = fixSeqInfo(first, second, method="union")
sapply(fixList, head)
sapply(fixList, seqlevels)
sapply(fixList, seqinfo)

fagostini/Mimir documentation built on Dec. 3, 2019, 7:53 p.m.