Learn R Programming

vcfR (version 1.4.0)

show,vcfR-method: vcfR-method

Description

Methods to show, subset or plot data from objects of class vcfR

head returns the first parts of an object of class vcfR.

The brackets ('[]') subset objects of class vcfR

The plot method visualizes objects of class vcfR

Usage

# S4 method for vcfR
show(object)

# S4 method for vcfR head(x, n = 6, maxchar = 80)

# S4 method for vcfR,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE)

# S4 method for vcfR plot(x, y, ...)

# S4 method for vcfR,missing rbind2(x, y, ...)

# S4 method for vcfR,ANY rbind2(x, y, ...)

# S4 method for vcfR,vcfR rbind2(x, y, ...)

# S4 method for vcfR dim(x)

# S4 method for vcfR nrow(x)

Arguments

object

object1 of class vcfR

x

object of class vcfR

n

number of rows to print

maxchar

maximum number of characters to print per line

##### Method show #####

i

vector of rows (variants) to include

j

vector of columns (samples) to include

...

Arguments to be passed to methods

drop

delete the dimensions of an array which only has one level

y

not used

Details

The method show is used to display an object. Because vcf data are relatively large, this has been abbreviated. Here we display the first four lines of the meta section, and truncate them to no more than 80 characters. The first eight columns and six rows of the fix section are also displayed.

The method head is similar to show, but is more flexible. The number of rows displayed is parameterized by the variable n. And the maximum number of characters to print per line (row) is also parameterized. In contract to show, head includes a summary of the gt portion of the vcfR object.

The square brackets ([]) are used to subset objects of class vcfR. Rows are subset by providing a vector i to specify which rows to use. The columns in the fix slot will not be subset by j. The parameter j is a vector used to subset the columns of the gt slot. Note that it is essential to include the first column here (FORMAT) or downsream processes will encounter trouble.

The plot method generates a histogram from data found in the 'QUAL' column from the 'fix' slot.