#!/usr/bin/env python

import pydigree
import itertools
import sys

pop = pydigree.Population(5000)
ped = pydigree.io.read_ped(sys.argv[1], pop)

for pedigree in ped:
    lab = pedigree.label
    ids = sorted([x.label for x in pedigree])
    # itertools combinations with replacement isn't available in 2.6
    # So we'll do this as a two step process
    # 1) Pairwise kinship coefs
    for x, y in itertools.combinations(ids, 2):
        k = pedigree.kinship(x, y)
        print lab, x, y, k
    # 2) Inbreeding coefs.
    for x in ids:
        print lab, x, x, pedigree.inbreeding(x)

@@ -53,51 +53,210 @@
 ols%0A
+%0A
 import 
-sys%0A%0Apop = pydigree.Population(5000)
+argparse%0A%0Aparser = argparse.ArgumentParser()%0Aparser.add_argument('--file', required=True,%0A                    help='Pedigree file for kinship/inbreeding calculation')%0Aargs = parser.parse_args()%0A
 %0Aped
@@ -283,24 +283,17 @@
 ped(
-sys.argv%5B1%5D, pop
+args.file
 )%0A%0Af

update kinship.py to use argparse