Off topic:How To Read Enzyme Code And E-Value From File And Write To A Matrix?
0
0
Entering edit mode
13.1 years ago
Azam ▴ 60

HI all, How can I built matrix by reading whole files.I just need two things from file that enzyme code and E VALUES scores. Both characters are in two columns in 1000 lines. for this I wrote this code but it is not working.

f=open("output.txt")
data=f.readlines()
label=1
label_dictionary = {}
for lines in data:
        print lines,
        columns= lines.split()
        print columns
        if columns [1] not in label_dictionary:
           label_dictionary[columns[1]]=label
           label=label+1
           if  columns [-1] not in label_dictionary:
               label_dictionary[columns[-1]] = label
               label=label+1                   
               print label_dictionary

               print label_dictionary,[columns[1]],label_dictionary,[columns[-1]]
matrix file parsing • 2.1k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1798 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6