diff prepare_population_structure.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/prepare_population_structure.py	Wed May 22 15:58:18 2013 -0400
+++ b/prepare_population_structure.py	Tue May 28 16:24:19 2013 -0400
@@ -53,12 +53,12 @@
 
 ################################################################################
 
-if len(sys.argv) < 9:
+if len(sys.argv) < 10:
     die("Usage")
 
 # parse command line
-input_snp_filename, min_reads, min_qual, min_spacing, output_filename, output_files_path = sys.argv[1:7]
-args = sys.argv[7:]
+input_snp_filename, input_type, min_reads, min_qual, min_spacing, output_filename, output_files_path = sys.argv[1:8]
+args = sys.argv[8:]
 
 individual_metadata = []
 population_files = []
@@ -119,6 +119,9 @@
 
 tags = p1.tag_list()
 for tag in tags:
+    if input_type == 'gd_genotype':
+        column, name = tag.split(':')
+        tag = '{0}:{1}'.format(int(column) - 2, name)
     args.append(tag)
 
 #print "args:", ' '.join(args)