manip-methods: Return a subset of features or annotations from a GenBank...

Description Usage Arguments Details Value Examples

Description

filter returns a subset of features from gbRecordList, gbRecord or gbFeatureTable objects, based on filters provided as key, range, or qualifier values.

select returns a specified subset of annotations from GenBank Features as a data.frame.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
filter(x, ...)

select(x, ...)

## S4 method for signature 'gbFeatureTable'
filter(x, ..., .cols = NULL)

## S4 method for signature 'gbFeatureTable'
select(x, ..., .cols = NULL)

## S4 method for signature 'gbRecord'
filter(x, ..., .cols = NULL)

## S4 method for signature 'gbRecord'
select(x, ..., .cols = NULL)

## S4 method for signature 'gbRecordList'
filter(x, ..., .cols = NULL)

## S4 method for signature 'gbRecordList'
select(x, ..., .cols = NULL)

Arguments

x

A ‘gbRecord’ or ‘gbFeatureTable’ instance.

...

For filter: named values that specify the features to select. These are merged with the values of keys to create the actual query. See Details; for select: see .cols.

.cols

A character vector of ‘keys’ that specify annotaions to be returned as a data.frame from the filtered features. If NULL, a ‘gbFeatureTable’ is returned. Supported ‘keys’ are “index” or “idx”, “start”, tag (e.g., “locus_tag”, “product”, “db_xref”). Specific db_xrefs can by queried using, e.g. “db_xref.GI” or “db_xref.GeneID”.

Details

Filters are provided as named values using keywords and/or “qualifier = value” pairs:

Permissible keywords are:

index/idx

For example: idx = c(3,4,5,6), idx = 100:150, index = c(1,12:20)

range

For example: range = "10000..25000", range = "..10000,20000..25000", range = "30000.."

key

For example: key = "CDS", key = c("CDS", "gene")

arbitrary qualifiers

For example: product = "ribosomal", locus_tag = c("CPSIT_0123", "CPSIT_0124", "CPSIT_0125"), pseudo = TRUE

Value

Depending on the value of .col a gbRecordList, gbRecord, orgbFeatureTable or a data.frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
load(system.file("extdata", "S_cerevisiae_mito.rda", package = "biofiles"))

## filter all hydrophobic tRNAs from the yeast mitochondrion
hydrophobic <- c("Val", "Ile", "Leu", "Met", "Phe", "Trp", "Cys")
trna <- filter(x, key = "tRNA", product = hydrophobic)

## select start, end, orientation, product, and GeneID
df <- select(trna, "start", "end", "strand", "product", "db_xref.GeneID")
df

## combine the above steps into one
cols <- c("start", "end", "strand", "product", "db_xref.GeneID")
filter(x, key = "tRNA", product = hydrophobic, .cols = cols)

## filter all CDS from position 60,000 bp onward
filter(x, key = "CDS", range = "60000..")

biofiles documentation built on May 2, 2019, 3:31 p.m.