Dot programming to draw cryptic relationships from GWAS samples


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=none];

By,
sed –i ‘1i \
           Diagraph CrypticRelatedness {\n
      Graph [splines=true overlap=false center=1];\n
           Node [shape=none]; \n
      ’ CrypticRel.dot
Then, add '}' at the end of the script
sed –i ‘$a\}’ CrypticRel.dot

Then, execute crypticRel.dot as follows
circo CrypticRel.dot –Tpng:gd –o CrypticRel.png


Now carefully look at the samples network and decide who to retain for further analysis.

Comments

Popular posts from this blog

Unzipping password protected files of Michigan Imputation Server

CollabNet: a Subversion client for Netbeans

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