Project

General

Profile

RE: upload helical picking from EMAN1/2 to Appion ยป convert.py

Rui Zhang, 12/28/2017 12:13 PM

 
#!/usr/bin/env python
import os

count = 1
fout = file('particledata-test.csv',"w")
fout.write("particle# x_coord y_coord helix_num image_name\n")

box = 300

for i in range(675):
try:
f1 = file("17dec01x_%03d.box"%i)
except:
continue
l1 = f1.readlines()
n = len(l1)
MT = 0
for j in range(n):
tmp = l1[j].split()
if int(tmp[-1]) == -1:
MT += 1
cen_x = int(tmp[0])+box/2
cen_y = int(tmp[1])+box/2
fout.write("%d\t%d\t%d\t%d\t17dec01x_%03d\n"%(count,cen_x,cen_y,MT,i))
count += 1
f1.close()

fout.close()
    (1-1/1)