I have a table with two columns (x1 and x2), and each having values like this:
Mytable
x1 x2
rs345 rs459
rs298 rs112
rs665 rs555
. .
. .
. .
n n
I want to calculate the r2 (pearson correlation) for every pair side by side in Mytable, let's say for rs345 and rs459 by using Plink (a command line genetic program). Typically yo have to enter manually every single pair:
plink --bifile genetic.data --r2 rs345 rs459 --out first_pair
But I want to get an easy way to loop the command over all the pairs and save time. I'll appreciate any comment!