Hi,
I have written a script which parses a UTF-8 text file and prints the required result. The code is below:
import os
import sys
import string
import csv
import codecs
usage = "usage: Specify the directories for files and the RDOCK cut-off value"
tm_append=[]
if len(sys.argv) < 1:
print usage
sys.exit()
else:
f=codecs.open(sys.argv[1], encoding='utf-8')
for line in f:
if line[0:3] =="The":
print line[56:]
elif line[0:4] == "Stru":
print line[24:]
elif line[0:4] == "RMSD":
print line
elif line[0:4] =="TM-s":
print line
elif line [0:4] == "MaxSu":
print line
elif line[0:4] =="GDT-":
print line
elif line[0:4] =="Supe":
print line
print "-------------------------------------------------------------------------------------"
The output given is:
ab_c/with_d/complex.394
/ab_c/with_d/complex.1094
Length= 917
Length= 917 (by which all scores are normalized)
RMSD of the common residues= 38.213
TM-score = 0.3821 (d0=10.18, TM10= 0.3501)
GDT-TS-score= 0.3501 %(d<1)=0.3501 %(d<2)=0.3501 %(d<4)=0.3501 %(d<8)=0.3501
GDT-HA-score= 0.3501 %(d<0.5)=0.3501 %(d<1)=0.3501 %(d<2)=0.3501 %(d<4)=0.3501
Superposition in the TM-score: Length(d<5.0)=321 RMSD= 0.00
Though the output is correct, I want them to be printed on the same line instead of multiple lines? Can anyone help me?
Cheers,
Chavanak