Learn R Programming

vcfR (version 1.0.0)

show,vcfR-method: vcfR methods

Description

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

Usage

## S3 method for class 'vcfR':
show(object)

## S3 method for class 'vcfR': head(x, n = 6, maxchar = 80)

## S3 method for class 'vcfR': [(x, i, j, drop)

## S3 method for class 'vcfR': plot(x, y, ...)

## S3 method for class 'vcfR,missing': rbind2(x, y, ...)

## S3 method for class 'vcfR,ANY': rbind2(x, y, ...)

## S3 method for class 'vcfR,vcfR': rbind2(x, y, ...)

## S3 method for class 'vcfR': dim(x)

## S3 method for class 'vcfR': nrow(x)

Arguments

object
object of class vcfR
x
object of class vcfR
n
number of rows to print
maxchar
maximum number of characters to print per line
i
vector of rows (variants) to include
j
vector of columns (samples) to include
drop
delete the dimensions of an array which only has one level
y
not used
...
Arguments to be passed to methods

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.