diff add_fst_column.py @ 24:248b06e86022

Added gd_genotype datatype. Modified tools to support new datatype.
author Richard Burhans <burhans@bx.psu.edu>
date Tue, 28 May 2013 16:24:19 -0400
parents 2c498d40ecde
children 8997f2ca8c7a
line wrap: on
line diff
--- a/add_fst_column.py	Wed May 22 15:58:18 2013 -0400
+++ b/add_fst_column.py	Tue May 28 16:24:19 2013 -0400
@@ -18,8 +18,8 @@
     print >> sys.stderr, "Usage"
     sys.exit(1)
 
-input, p1_input, p2_input, genotypes, min_reads, min_qual, retain, discard_fixed, biased, output = sys.argv[1:11]
-individual_metadata = sys.argv[11:]
+input, p1_input, p2_input, input_type, genotypes, min_reads, min_qual, retain, discard_fixed, biased, output = sys.argv[1:12]
+individual_metadata = sys.argv[12:]
 
 p_total = Population()
 p_total.from_tag_list(individual_metadata)
@@ -52,10 +52,14 @@
 
 columns = p1.column_list()
 for column in columns:
+    if input_type == 'gd_genotype':
+        column = int(column) - 2
     args.append('{0}:1'.format(column))
 
 columns = p2.column_list()
 for column in columns:
+    if input_type == 'gd_genotype':
+        column = int(column) - 2
     args.append('{0}:2'.format(column))
 
 fh = open(output, 'w')