def write_data(args): path, ext = os.path.splitext( args.out ) tped_file = TPedFile( path + ".tped" ) tfam_file = TFamFile( path + ".tfam" ) pair_file = PairFile( path + ".pair" ) write_genotypes( args, tped_file, tfam_file, pair_file ) tped_file.close( ) tfam_file.close( ) pair_file.close( ) status = os.system( "plink --tfile {0} --make-bed --out {1} > /dev/null".format( path, path ) ) if status == -1: print( "Could not run plink, is it installed?" ) exit( 1 )
def write_data(args): path, ext = os.path.splitext( args.out ) ped_file = PedFile( path + ".ped" ) map_file = MapFile( path + ".map" ) pair_file = PairFile( path + ".pair" ) cov_file = None if args.covariate: cov_file = CovFile( path + ".cov", [ c.name for c in args.covariate ] ) write_genotypes( args, ped_file, map_file, pair_file, cov_file ) ped_file.close( ) map_file.close( ) pair_file.close( ) if args.covariate: cov_file.close( ) status = os.system( "plink --file {0} --make-bed --out {1} > /dev/null".format( path, path ) ) if status == -1: print( "Could not run plink, is it installed?" ) exit( 1 )