Learn R Programming

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

Mega2R Bitbucket repository

Mega2R is an R package that makes it easy to load SQLite databases created by Mega2 directly into R as data frames. It also provides support for carrying out gene-based association tests, automatically looping over genes, using a variety of other R packages. For more information about Mega2R, see this web page: https://watson.hgen.pitt.edu/mega2/mega2r/

The latest development snapshot of the Mega2R R package can be obtained from this Bitbucket repository. Please note that this development snapshot is not as thoroughly tested as our stable release version, but does contain the newest features and changes.

To obtain the stable release version, please go to https://CRAN.R-project.org/package=Mega2R

Contact

Daniel E. Weeks, Ph.D.
Professor of Human Genetics and Biostatistics
Department of Human Genetics
University of Pittsburgh
Public Health 3119
130 DeSoto Street
Pittsburgh, PA 15261
USA

Work: 1 412 624 5388
Email: weeks@pitt.edu
Web site: https://watson.hgen.pitt.edu
Twitter: @StatGenDan

Copy Link

Version

Install

install.packages('Mega2R')

Monthly Downloads

52

Version

1.0.5

License

GPL-2

Maintainer

Daniel E Weeks

Last Published

February 28th, 2019

Functions in Mega2R (1.0.5)

Mega2GenABEL

generate gwaa.data-class object from a Mega2R database
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
computeDosage

computeDosage function
Mega2GenABELClean

delete temporary PLINK tped files processed by GenABEL
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
dump_mega2rtutorial_data

dump tutorial data
DOSKAT

SKAT call back function
DOfamSKATRC

DofamSKATRC call back function
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.
Mega2RVersion

Mega2R version
mkfam

assemble pedigree information into a data frame
Mega2R-TBLSFilter

Mega2R SQLite3 table filter
setRanges

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

replace the pedigree data frame
mkGenABELtfam

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

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

Mega2R package
Mega2gdsfmt

transcode mega2 to gdsfmt/SNP_ARRAY
Mega2pedgene

Execute the pedgene function on a transcript ranges
mkGenABELtped

generate a PLINK TPED file for GenABEL
mkVCFfreq

generate required VCF frequency (.freq) file
getgenotypesdos

fetch dosage integer matrix for specified markers
getAlleles

pull allele pairs
getgenotypesgenabel

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

return the genotypes for all markers of a given person
init_famSKATRC

load Mega2 SQLite database and perform initialization for famSKATRC usage
mkVCFhdr

generate required VCF header
mkAlleles

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

compare two gwaa.data-class objects
mkGenABELcoding

generate GenABEL coding vector
init_pedgene

load Mega2 SQLite database and perform initialization for pedgene usage
mkVCFphe

generate required PLINK (.phe) file
mk_markers_with_skip

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

show the association between index no and phenotype
mkMarkers

create "markers" data frame
mkVCFfam

generate required VCF family (.fam) file
DOpedgene

pedgene call back function
Mega2ENVGenABEL

generate gwaa.data-class object
uniqueFamMember

regenerate fam data frame with unique values in member column
Mega2R-TBLS

Mega2R SQLite3 tables
resetMega2ENV

return an initialized environment
Mega2VCF

generate a VCF file set for a collection of markers
setAnnotations

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

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

fetch genotype character matrix for specified markers
applyFnToRanges

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

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

fetch genotype integer matrix for specified markers
clean_mega2rtutorial_data

remove tutorial data
init_SKAT

load Mega2 SQLite database and perform initialization for SKAT usage
showMapNames

show the association between mapno and mapname
showMega2ENV

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

generate required PLINK (.phe) file
mkGenABELgenotype

generate GenABEL compressed genotype matrix
where_mega2rtutorial_data

show directory of tutorial data
mkVCFmap

generate required Mega2 map (.map) file
mkVCFpen

generate required Mega2 penetrance (.pen) file
mkphenotype

generate a phenotype data frame
read.Mega2DB

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