Posts

Showing posts from 2014

Dot programming to draw cryptic relationships from GWAS samples

Image
One of the confounding factors in GWAS is genetic relatedness between the samples. PLINK offers utilities to find relatedness and filter samples as per degree of relatedness you wish to exclude for statistical association analysis. As often GWA studies involve larger number of unrelated samples, it becomes very hard to manually draw relationship between the samples, especially when the population in question is highly inbred. In this context one can make use application of DOT programming to draw directed graphs and select unrelated individuals from the cluster of related individuals, quite easily. To do so Get second and fourth column from your PLINK IBD command output filename.genome. awk –F “ ” ‘{print $2,$4}’ FileName.genome > CrypticRel.dot Then insert ‘->’ between the sample ids sed –i ‘%s/\s/->/g’ CrypticRel.dot Then, add following lines to top of the file CrypticRel.dot Diagraph CrypticRelatedness { Graph [splines=true overlap=false center=1]; Node [shape=no...

Scatter Plot Matrix in Lattice: A way to join multiple scatter plot matrices in one plot

Image
A best way to understand relationship between quantitative variables is visualizing data with pairwise correlations. Recently, I had to display pairwise correlation of multiple phenotypes with respect genotypes of a variant. Since, 'scatterplotMatrix' function available in 'car' package of R is one stop solution to do that I initially used it. However, I was surprised when I wanted to bring multiple plots on one single plot. Because, below scripts did not create a plot having side by side plot. library(car) data1=data[rs3827103=='GG',] data2=data[rs3827103=='GA',] par(mfrow=c(1,2)); scatterplotMatrix(~SBP + DBP + Leptin + WC + BMI + Weight | factor(data1$rs3827103), data=data1, diagonal='none', pch=c(18),smoother=FALSE, reg.line=lm) scatterplotMatrix(~SBP + DBP + Leptin + WC + BMI + Weight | factor(data2$rs3827103), data=data2, diagonal='none', pch=c(18),smoother=FALSE, reg.line=lm) I finally could find reason for this to behave ...