Learn R Programming

vcfR (version 1.0.0)

create.chromR: Create chromR object

Description

Creates and populates an object of class chromR.

Usage

create.chromR(name = "CHROM1", vcf, seq = NULL, ann = NULL,
  verbose = TRUE)

vcfR2chromR(x, vcf)

seq2chromR(x, seq = NULL)

ann2chromR(x, gff)

getFIX(x)

getCHROM(x)

getPOS(x)

getQUAL(x)

Arguments

name
a name for the chromosome (for plotting purposes)
vcf
an object of class vcfR
seq
a sequence as a DNAbin object
ann
an annotation file (gff-like)
verbose
should verbose output be printed to the console?
x
an object of class chromR
gff
a data.frame containing annotation data in the gff format

Details

Creates and names a chromR object from a name, a chromosome (an ape::DNAbin object), variant data (a vcfR object) and annotation data (gff-like). The function create.chromR is a wrapper which calls functions to populate the slots of the chromR object.

The function vcf2chromR is called by create.chromR and transfers the data from the slots of a vcfR object to the slots of a chromR object. It also tries to extract the 'DP' and 'MQ' fileds (when present) from the fix slot's INFO column. It is not anticipated that a user would need to use this function directly, but its placed here in case they do.

The function seq2chromR is currently defined as a generic function. This may change in the future. This function takes an object of class DNAbin and assigns it to the 'seq' slot of a chromR object.

The function ann2chromR is called by create.chromR and transfers the information from a gff-like object to the 'ann' slot of a chromR object. It is not anticipated that a user would need to use this function directly, but its placed here in case they do.

See Also

chromR-class, vcfR-class, DNAbin, http://www.1000genomes.org/wiki/analysis/variant%20call%20format/vcf-variant-call-format-version-41{vcf format}, http://www.sequenceontology.org/gff3.shtml{gff3 format}

Examples

Run this code
library(vcfR)
data(vcfR_example)
chrom <- create.chromR('sc50', seq=dna, vcf=vcf, ann=gff)
head(chrom)
chrom
plot(chrom)

chrom <- masker(chrom, min_QUAL = 1, min_DP = 300, max_DP = 700, min_MQ = 59, max_MQ = 61)
chrom <- proc.chromR(chrom, win.size=1000)

plot(chrom)
chromoqc(chrom)

Run the code above in your browser using DataLab