tomatoiscoding
10/13/2016 - 12:33 PM

replace string with python

replace string with python

ped = open('/data/bbl/bbl/bbl/ped/nnped.txt')
try:
  peds = ped.readlines()
finally:
  ped.close()
outfile = open('/data/bbl/bbl/bbl/ped/pedxin.txt', 'w')
for ped in peds:
  for i in range(0, 605997):
    this_snp = ped[i*4] + ped[i*4 + 1] + ped[i*4 + 2]
    outfile.write(this_snp + '\t')
  outfile.write('\n')