Learn R Programming

⚠️There's a newer version (1.1.0) of this package.Take me there.

Mega2R (version 1.0.0)

Accessing and Processing a 'Mega2' Genetic Database

Description

Uses as input genetic data that have been reformatted and stored in a 'SQLite' database; this database is initially created by the standalone 'mega2' C++ program (available freely from ). Loads and manipulates data frames containing genotype, phenotype, and family information from the input 'SQLite' database, and decompresses needed subsets of the genotype data, on the fly, in a memory efficient manner. We have also created several more functions that illustrate how to use the data frames as well as perform useful tasks: these permit one to run the 'pedgene' package to carry out gene-based association tests on family data using selected marker subsets, to run the 'SKAT' package to carry out gene-based association tests using selected marker subsets, to output the 'Mega2R' data as a VCF file and related files (for phenotype and family data), and to convert the data frames into 'GenABEL' gwaa.data-class objects.

Copy Link

Version

Install

install.packages('Mega2R')

Monthly Downloads

52

Version

1.0.0

License

GPL-2

Maintainer

Daniel E Weeks

Last Published

November 2nd, 2017

Functions in Mega2R (1.0.0)

Mega2GenABELClean

delete temporary PLINK tped files processed by GenABEL
Mega2GenABELcoding

generate GenABEL coding vector
Mega2R

Mega2R package
Mega2SKAT

execute the CRAN SKAT function on a subset of the gene transcripts
getgenotypes

fetch genotype character matrix for specified markers
getgenotypes_R

fetch genotype matrix for specified markers (assemble by rows)
mkVCFfam

generate required VCF family (.fam) file
mkVCFfreq

generate required VCF frequency (.freq) file
setfam

replace the pedigree data frame
showMapNames

show the association between mapno and mapname
DOSKAT

SKAT call back function
DOpedgene

pedgene call back function
dbmega2_import

read Mega2 SQLite database into R
dmpPed

generate the .ped, .fam and .map files of PLINK PED representation of a gwaa.data-class object
init_SKAT

load Mega2 SQLite database and perform initialization for SKAT usage
init_pedgene

load Mega2 SQLite database and perform initialization for pedgene usage
mkVCFpen

generate required Mega2 penetrance (.pen) file
mkVCFphe

generate required PLINK (.phe) file
mkfam

assemble pedigree information into a data frame
mkphenotype

generate a phenotype data frame
Mega2GenABELconvert

generate GenABEL compressed genotype matrix
Mega2GenABELtst

compare two gwaa.data-class objects
applyFnToRanges

apply a function to all the genotypes for markers found in several specified ranges
clean_mega2rtutorial_data

remove tutorial data
dump_mega2rtutorial_data

dump tutorial data
Mega2ENVGenABEL

generate gwaa.data-class object
Mega2GenABEL

generate gwaa.data-class object from a Mega2R database
getgenotype_person

return the genotypes for all markers of a given person
mkGenABELtped

generate a PLINK TPED file for GenABEL
mkMarkers

create "markers" data frame
read.Mega2DB

load Mega2 database and initialize family data frame and markers data frame
resetMega2ENV

return an initialized environment
Mega2R-TBLS

Mega2R SQLite3 tables
Mega2R-TBLSFilter

Mega2R SQLite3 table filter
Mega2VCF

generate a VCF file set for a collection of markers
Mega2pedgene

Execute the pedgene function on a transcript ranges
mkGenABELphe

generate required PLINK (.phe) file
mkGenABELtfam

generate required fam family for PLINK TPED (.tfam) file
mkVCFhdr

generate required VCF header
mkVCFmap

generate required Mega2 map (.map) file
setAnnotations

set default name of transcription database and name of database mapping gene name to entrez gene id
setRanges

set default range data: chromosome and start/end base pair
applyFnToGenes

apply a function to the genotypes (markers) in each gene transcript and/or base pair range
applyFnToMarkers

apply a function to the genotypes from a set of markers
mk_markers_with_skip

make the derived "markers" data frame and store it in the environment.
mk_unified_genotype_table

concatenate separate genotype vectors for each chromosome to one extended vector containing all the chromosomes and store it in the environment.
getgenotypesgenabel

process the genotype matrix for specified markers and return the corresponding GenABEL genotype matrix
getgenotypesraw

fetch genotype integer matrix for specified markers
showMega2ENV

show Mega2R environment, viz. data frames and related info.
showPhenoNames

show the association between index no and phenotype
where_mega2rtutorial_data

show directory of tutorial data