Learn R Programming

Mega2R (version 1.1.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 run the 'famSKATRC' package to carry out gene-based association tests on families (optionally) and with rare or common variants 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.1.0

License

GPL-2

Maintainer

Daniel E Weeks

Last Published

December 21st, 2023

Functions in Mega2R (1.1.0)

DOfamSKATRC

DofamSKATRC call back function
applyFnToGenes

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

execute the CRAN famSKAT_RC function on a subset of the gene transcripts
Mega2VCF

generate a VCF file set for a collection of markers
Mega2SKAT

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

Execute the pedgene function on a transcript ranges
Mega2gdsfmt

transcode mega2 to gdsfmt/SNP_ARRAY
Mega2RVersion

Mega2R version
applyFnToRanges

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

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

remove tutorial data
getAlleles

pull allele pairs
dump_mega2rtutorial_data

dump tutorial data
dmpPed

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

return the genotypes for all markers of a given person
getgenotypesraw

fetch genotype integer matrix for specified markers
init_SKAT

load Mega2 SQLite database and perform initialization for SKAT usage
getgenotypesdos

fetch dosage integer matrix for specified markers
mkAlleles

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

generate GenABEL coding vector
getgenotypesgenabel

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

computeDosage function
dbmega2_import

read Mega2 SQLite database into R
mkVCFphe

generate required PLINK (.phe) file
mk_markers_with_skip

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

regenerate fam data frame with unique values in member column
showPhenoNames

show the association between index no and phenotype
mkfam

assemble pedigree information into a data frame
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.
getgenotypes

fetch genotype character matrix for specified markers
showMapNames

show the association between mapno and mapname
showMega2ENV

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

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

generate a PLINK TPED file for GenABEL
mkGenABELtfam

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

generate a phenotype data frame
init_famSKATRC

load Mega2 SQLite database and perform initialization for famSKATRC usage
mkGenABELgenotype

generate GenABEL compressed genotype matrix
mkVCFmap

generate required Mega2 map (.map) file
init_pedgene

load Mega2 SQLite database and perform initialization for pedgene usage
where_mega2rtutorial_data

show directory of tutorial data
read.Mega2DB

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

generate required Mega2 penetrance (.pen) file
mkVCFfreq

generate required VCF frequency (.freq) file
mkMarkers

create "markers" data frame
mkGenABELphenotype

generate required PLINK (.phe) file
mkVCFhdr

generate required VCF header
mkVCFfam

generate required VCF family (.fam) file
resetMega2ENV

return an initialized environment
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
setfam

replace the pedigree data frame
Mega2ENVGenABEL

generate gwaa.data-class object
DOpedgene

pedgene call back function
DOSKAT

SKAT call back function
Mega2R-package

Mega2R: Accessing and Processing a 'Mega2' Genetic Database
Mega2R-TBLSFilter

Mega2R SQLite3 table filter
Mega2GenABEL

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

delete temporary PLINK tped files processed by GenABEL
Mega2R-TBLS

Mega2R SQLite3 tables
Mega2GenABELtst

compare two gwaa.data-class objects