Learn R Programming

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

Mega2R (version 1.0.4)

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 CoreArray Genomic Data Structure (GDS) format.

Copy Link

Version

Install

install.packages('Mega2R')

Monthly Downloads

52

Version

1.0.4

License

GPL-2

Maintainer

Daniel E Weeks

Last Published

June 18th, 2018

Functions in Mega2R (1.0.4)

dmpPed

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

fetch genotype character matrix for specified markers
Mega2gdsfmt

transcode mega2 to gdsfmt/SNP_ARRAY
mkMarkers

create "markers" data frame
init_SKAT

load Mega2 SQLite database and perform initialization for SKAT usage
init_pedgene

load Mega2 SQLite database and perform initialization for pedgene usage
read.Mega2DB

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

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

generate required PLINK (.phe) file
mkVCFfam

generate required VCF family (.fam) file
mkGenABELphenotype

generate required PLINK (.phe) file
mkGenABELgenotype

generate GenABEL compressed genotype matrix
mkphenotype

generate a phenotype data frame
showMapNames

show the association between mapno and mapname
showMega2ENV

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

fetch genotype integer matrix for specified markers
getgenotypesgenabel

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

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

generate required Mega2 map (.map) file
getAlleles

pull allele pairs
mkAlleles

generate allele pairs in with MAJ(or) allele first
mkGenABELcoding

generate GenABEL coding vector
resetMega2ENV

return an initialized environment
mkVCFpen

generate required Mega2 penetrance (.pen) file
getgenotype_person

return the genotypes for all markers of a given person
mkGenABELtped

generate a PLINK TPED file for GenABEL
mkGenABELtfam

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

show directory of tutorial data
setfam

replace the pedigree data frame
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
mkfam

assemble pedigree information into a data frame
mkVCFhdr

generate required VCF header
mkVCFfreq

generate required VCF frequency (.freq) file
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.
showPhenoNames

show the association between index no and phenotype
uniqueFamMember

regenerate fam data frame with unique values in member column
Mega2GenABELClean

delete temporary PLINK tped files processed by GenABEL
Mega2GenABELtst

compare two gwaa.data-class objects
DOSKAT

SKAT call back function
DOpedgene

pedgene call back function
Mega2R-TBLS

Mega2R SQLite3 tables
clean_mega2rtutorial_data

remove tutorial data
applyFnToMarkers

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

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

read Mega2 SQLite database into R
Mega2R-TBLSFilter

Mega2R SQLite3 table filter
Mega2ENVGenABEL

generate gwaa.data-class object
dump_mega2rtutorial_data

dump tutorial data
Mega2GenABEL

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

generate a VCF file set for a collection of markers
Mega2R

Mega2R package
Mega2pedgene

Execute the pedgene function on a transcript ranges
Mega2SKAT

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

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