snpcor: Correlating SNP dendrograms with the trait dendrogram

Description Usage Arguments Value Author(s) Examples

View source: R/snpcor.R

Description

Calculate Baker's Gamma correlation coefficient between two trees

Usage

1
snpcor(snpdata, snptree, trait.dend)

Arguments

snpdata

SNP data downloaded from open source databases such as <http://msub.csbio.unc.edu/> or <http://www.informatics.jax.org/javawi2/servlet/WIFetch?page=snpQF>

snptree

a list of dendrograms generated from snp data

trait.dend

a dendrogram generated from quantitative trait data

Value

a data frame of positions, snp chromosomal location, and correlation coefficient

Author(s)

Xingyao Chen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
set.seed(1234) #simulate quantitative trait dataframe
x <- rnorm(n=(16*12), mean=10, sd=30)
trait=matrix(x,16,12)
rname=paste("trait",1:16,sep="")
cname=paste("strain", 1:12, sep="")
rownames(trait)=rname
colnames(trait)=cname

mytrait.dend=traittree(traitdata=trait, nboot=10) #cluster strains by traitbiome

chrX = SampSNP() #load SNP data
strain.names=colnames(trait) #assign the same strain names
mysnptree=maketree(snpdata=chrX, strain.names=strain.names) #cluster strains by every 100 SNPs

mycordata=snpcor(snpdata=chrX, snptree=mysnptree, trait.dend=mytrait.dend) #calculate correlation coefficient for micribiome dendrogram and each SNP dendrogram

16xchen/Biomy documentation built on May 5, 2019, 10:39 a.m.