README.md

Random useful functions for Moose's work

Authors: David Hughes

Date started: 31st Jan. 2020

About:

This repo contains a variety of helpful functions that I come back to time and time again. Rather than adding them into a variety of different packages I will try to maintain this catch-all that I and my colleagues can source when necessary.

Installation instructions of the moosefun package

1. insure that the devtools library is installed on your local machine
     > ifelse("devtools" %in% rownames(installed.packages()), 
     NA, 
     install.packages("devtools"))

2. install moosefun
    > devtools::install_github("hughesevoanth/moosefun")

iPVs functions have moved to their own package

Date moved: March 6th 2020
For functions to aid in the identification of principal variables in inter-correlated data sets please follow the path below.

https://github.com/hughesevoanth/iPVs

coverting rsid to SNPID and SNPID to rsid

the useful functions are: rsid_2_chrbp() & chrbp_2_rsid()

EXAMPLE:

#########################
## install biomaRt
#########################
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("biomaRt")

#########################
##  load libraries
#########################
library(moosefun)
library(biomaRt)

#########################
## convert rsids to snpids
#########################
## read in the SNP list
snps = c("rs4987657","rs4987667","rs4987682")
## Extract mapping cooridinates
map = rsid_2_chrbp(snps)
o = order(map$chr, map$bp)
map = map[o,]

#########################
## convert snpids to rsids
#########################
## read in the SNP list
snps = c("7:142569596:A_G","7:142572908:T_C","7:142574913:A_G")

## NOTE: the function splits snpids on ":" and only uses the first two 
## strings as chr and bp, all else is ignored

## Extract mapping cooridinates
map2 = chrbp_2_rsid(snps)
o = order(map2$chr, map2$bp)
map2 = map2[o,]

--

DESCRIPTION OF OTHER FUNCTIONS

ztransform()

rntransform()

moose_biplot()



hughesevoanth/moosefun documentation built on Aug. 22, 2022, 7:04 a.m.