dfh=open('selex_ctcf_motif_CpGi.bed','r')
rfh=open('selex_ctcf_motif_CpGi.bed_mod','w')
rfh.write('Index\tbound\n')
for i in dfh:
	line=i.split()
	if line[3]=='.':
		rfh.write('_'.join(line[:3])+'\t0\n')
	else:
		rfh.write('_'.join(line[:3])+'\t1\n')
